2016-07-08 3 views
0

Я новичок в prestashop, и у меня возникли серьезные проблемы с удалением адреса (я хочу иметь только резюме = Shrnutí, Вход/гостевая оплата = Přihlásit se, Delivery = Doručení и Payment = Platba здесь https://www.enakupak.cz/objednavka?step=1) уровень ,. Я использую prestashop 1.6.1.5Prestashop удалить один этап оформления

Я знаю, что мне нужно изменить файл order-carrier.tpl и последовали за несколькими сообщениями здесь и там, но не смогли сделать это правильно.

Есть ли у вас какие-либо идеи о том, как это сделать?

Я думаю, что это будет изменение в этой части OrderController.php, но не знаете, как изменить его concretly

 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; 
    } 

ответ

0

Что делать, если вы CANN этот код после первого случая - перерыв:

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; 

Проверьте, это работает.