ileriya Posted October 27, 2014 Share Posted October 27, 2014 Hello, I use Prestashop 1.6.0.9. I try to use a carrier by a product, but I have a problem on the Shipping step in my shopping-cart: I can't pass to the next step (because of several carriers and one radio button I suppose). Is it any possibility to resoudre my problem? Here is my screenshot: Link to comment Share on other sites More sharing options...
ileriya Posted October 29, 2014 Author Share Posted October 29, 2014 For those in search of solution: You need to make the override of OrderController.php. public function autoStep() { if ($this->step >= 2 && (!$this->context->cart->id_address_delivery || !$this->context->cart->id_address_invoice)) Tools::redirect('index.php?controller=order&step=1'); if ($this->step > 2 && !$this->context->cart->isVirtualCart()) { $redirect = false; if (count($this->context->cart->getDeliveryOptionList()) == 0) $redirect = true; $delivery_option = $this->context->cart->getDeliveryOption(); if (is_array($delivery_option)) $carrier = explode(',', $delivery_option[(int)$this->context->cart->id_address_delivery]); if (!$redirect && !$this->context->cart->isMultiAddressDelivery()) foreach ($this->context->cart->getProducts() as $product) { $carrier_list = Carrier::getAvailableCarrierList(new Product($product['id_product']), null, $this->context->cart->id_address_delivery); foreach ($carrier as $id_carrier) { if (!in_array($id_carrier, $carrier_list)) $redirect = true; else { $redirect = false; break; } } if ($redirect) break; } if ($redirect) Tools::redirect('index.php?controller=order&step=2'); } $delivery = new Address((int)$this->context->cart->id_address_delivery); $invoice = new Address((int)$this->context->cart->id_address_invoice); if ($delivery->deleted || $invoice->deleted) { if ($delivery->deleted) unset($this->context->cart->id_address_delivery); if ($invoice->deleted) unset($this->context->cart->id_address_invoice); Tools::redirect('index.php?controller=order&step=1'); } } 1 Link to comment Share on other sites More sharing options...
p.guerin Posted May 20, 2015 Share Posted May 20, 2015 I had the same issue and it worked for me ! Thanks guys Link to comment Share on other sites More sharing options...
bricowebstore Posted October 5, 2015 Share Posted October 5, 2015 Hi where do you have post this file? override/front or just override thks Link to comment Share on other sites More sharing options...
ileriya Posted October 5, 2015 Author Share Posted October 5, 2015 Hello Bricowebstore, It should help you: http://doc.prestashop.com/display/PS16/Overriding+default+behaviors Link to comment Share on other sites More sharing options...
bricowebstore Posted October 5, 2015 Share Posted October 5, 2015 thks for your reply but i try many options but nothing works i place it in override/front in override/classes/controller nothing... Link to comment Share on other sites More sharing options...
ileriya Posted October 5, 2015 Author Share Posted October 5, 2015 (edited) You have to place your OrderController.php here: override/controllers/front Be careful, first line in the OrderController.php is: <?php class OrderController extends OrderControllerCore{ If it doesn't work, try to delete your class_index.php from the cache folder. Edited October 5, 2015 by ileriya (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts