Jump to content

Add delevery type in cart.tpl


Orl_4

Recommended Posts

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

ex..png

Link to comment
Share on other sites

 

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

 

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...