Prestashop删除一个结帐步骤

时间:2016-07-08 23:35:29

标签: php prestashop prestashop-1.6

我是prestashop的新手,我在删除地址方面遇到了很大的麻烦(我想只有摘要=Shrnutí,登录/访客结账=Přihlásitse,Delivery =Doručení和Payment = Platba https://www.enakupak.cz/objednavka?step=1 ) 步,。我正在使用prestashop 1.6.1.5

我知道我必须修改order-carrier.tpl文件并且已经在这里和那里跟踪了几个帖子但是无法正确完成它。

你们是否有任何关于如何做到这一点的实际想法?

我认为OrderController.php的这一部分会有变化,但不知道如何改变它

        switch ((int)$this->step) {

        case OrderController::STEP_SUMMARY_EMPTY_CART:
            $this->context->smarty->assign('empty', 1);
            $this->setTemplate(_PS_THEME_DIR_.'shopping-cart.tpl');
        break;


        case OrderController::STEP_DELIVERY:
            if (Tools::isSubmit('processAddress')) {
                $this->processAddress();
            }
            $this->autoStep();
            $this->_assignCarrier();
            $this->setTemplate(_PS_THEME_DIR_.'order-carrier.tpl');
        break;

        case OrderController::STEP_PAYMENT:
            // Check that the conditions (so active) were accepted by the customer
            $cgv = Tools::getValue('cgv') || $this->context->cookie->check_cgv;

            if ($is_advanced_payment_api === false && Configuration::get('PS_CONDITIONS')
                && (!Validate::isBool($cgv) || $cgv == false)) {
                Tools::redirect('index.php?controller=order&step=2');
            }

            if ($is_advanced_payment_api === false) {
                Context::getContext()->cookie->check_cgv = true;
            }

            // Check the delivery option is set
            if ($this->context->cart->isVirtualCart() === false) {
                if (!Tools::getValue('delivery_option') && !Tools::getValue('id_carrier') && !$this->context->cart->delivery_option && !$this->context->cart->id_carrier) {
                    Tools::redirect('index.php?controller=order&step=2');
                } elseif (!Tools::getValue('id_carrier') && !$this->context->cart->id_carrier) {
                    $deliveries_options = Tools::getValue('delivery_option');
                    if (!$deliveries_options) {
                        $deliveries_options = $this->context->cart->delivery_option;
                    }

                    foreach ($deliveries_options as $delivery_option) {
                        if (empty($delivery_option)) {
                            Tools::redirect('index.php?controller=order&step=2');
                        }
                    }
                }
            }

            $this->autoStep();

            // Bypass payment step if total is 0
            if (($id_order = $this->_checkFreeOrder()) && $id_order) {
                if ($this->context->customer->is_guest) {
                    $order = new Order((int)$id_order);
                    $email = $this->context->customer->email;
                    $this->context->customer->mylogout(); // If guest we clear the cookie for security reason
                    Tools::redirect('index.php?controller=guest-tracking&id_order='.urlencode($order->reference).'&email='.urlencode($email));
                } else {
                    Tools::redirect('index.php?controller=history');
                }
            }
            $this->_assignPayment();

            if ($is_advanced_payment_api === true) {
                $this->_assignAddress();
            }

            // assign some informations to display cart
            $this->_assignSummaryInformations();
            $this->setTemplate(_PS_THEME_DIR_.'order-payment.tpl');
        break;

        default:
            $this->_assignSummaryInformations();
            $this->setTemplate(_PS_THEME_DIR_.'shopping-cart.tpl');
        break;
    }

1 个答案:

答案 0 :(得分:0)

如果你在第一个案例 - 中断后插入这段代码怎么办?

 case OrderController::STEP_SUMMARY_EMPTY_CART:
            $this->context->smarty->assign('empty', 1);
            $this->setTemplate(_PS_THEME_DIR_.'shopping-cart.tpl');
        break;

在此案例之后添加此案例:

case OrderController::STEP_ADDRESSES:
                $this->_assignAddress();
                $this->processAddressFormat();
                if (Tools::getValue('multi-shipping') == 1) {
                    $this->_assignSummaryInformations();
                    $this->context->smarty->assign('product_list', $this->context->cart->getProducts());
                    $this->setTemplate(_PS_THEME_DIR_.'order-address-multishipping.tpl');
                } else {
                    $this->autoStep();
                    $this->_assignCarrier();
                    $this->setTemplate(_PS_THEME_DIR_.'order-carrier.tpl');
                }
            break;

检查,是否有效。