Orl_4 Posted February 9, 2021 Share Posted February 9, 2021 Hi, I am looking for a possibility to add the type of delivery defined by default in my Prestashop 1.7. Here is an example. I want to make click n collect appear. I manage in front but not really in dev. Thank you for your help Link to comment Share on other sites More sharing options...
Orl_4 Posted February 10, 2021 Author Share Posted February 10, 2021 Hello, I advanced a little but... I think we need to modify cart-detailled-total.tpl. And add a variable that specifies the type of delivery (Click n Collect / Home / Relay point ...). I think it's this variable: {$ carrier.name}, but how can I use it in this *.tpl ? Any help is appreciated Thank you Link to comment Share on other sites More sharing options...
Orl_4 Posted February 11, 2021 Author Share Posted February 11, 2021 In cartController.php I defined a new instance: public function initContent() { $carrier = new Carrier(1);//I want here the Id of the carrier $this->context->smarty->assign([ 'cart' => $presented_cart, 'static_token' => Tools::getToken(false), 'myCarrier'=> $carrier, ]); } And in cart-detailled-total.tpl : {else} {$subtotal.label} {* PAM *} {if $subtotal.type === 'shipping'} <span>({$myCarrier->name})</span> {/if} {* PAM *} {/if} So now I would have wanted to define the carrier ID in the initcontent function. Is it possible ? Thks !!! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now