Jump to content

Edit History

ps8modules

ps8modules

I think this is going about it the wrong way.
Just use the hook in the module.

Add Hook

$this->registerHook('actionPresentCart');

https://devdocs.prestashop-project.org/1.7/modules/concepts/hooks/list-of-hooks/

* find actionPresentCart for more info.

 

And hook function

public function hookActionPresentCart($params)
{
	$presentedCart = $params;    
	/* add your function for find values */

	$presentedCart['presentedCart']['subtotals']['shipping']['handling_cost_enabled'] = false;
	$presentedCart['presentedCart']['subtotals']['shipping']['handling_cost'] = floatval('5');

}

 

Tested in cart-summary-subtotals.tpl

{$cart.subtotals.shipping|@var_dump}

result:

obrazek.png.02e96fb6a1d15883e7fa565ce4ac35df.png

ps8modules

ps8modules

I think this is going about it the wrong way.
Just use the hook in the module.

Add Hook

$this->registerHook('actionPresentCart');

https://devdocs.prestashop-project.org/1.7/modules/concepts/hooks/list-of-hooks/

* find actionPresentCart for more info.

 

And hook function

public function hookActionPresentCart($params)
{
	$presentedCart = $params;    
    /* add your function for find values */

	$presentedCart['presentedCart']['subtotals']['shipping']['handling_cost_enabled'] = false;
	$presentedCart['presentedCart']['subtotals']['shipping']['handling_cost'] = floatval('5');

}

 

Tested in cart-summary-subtotals.tpl

{$cart.subtotals.shipping|@var_dump}

result:

obrazek.png.02e96fb6a1d15883e7fa565ce4ac35df.png

×
×
  • Create New...