-
Book Overview & Buying
-
Table Of Contents
PrestaShop Module Development
By :
In order to keep the code clear in the module's main class, we will create a controller for shipping cost calculation:
public function getOrderShippingCost($params, $shipping_cost)
{
$controller = $this->getHookController('getOrderShippingCost');
return $controller->run($params, $shipping_cost);
}As you can see, we've passed the two parameters available in the method to the controller. The two parameters are:
$params: In this case (the getOrderShippingCost function), $params is in fact the Cart object
$shipping_cost: This parameter corresponds to the shipping cost calculated by PrestaShop, which is the addition of the shipping handling fee (if the shipping_handling parameter of the carrier has been set to true, which is the case) and the price range / weight range cost (if the need_range parameter has been set to true, which is the case too)
At this state, except if you set the shipping handling fee in the administration panel,...
Change the font size
Change margin width
Change background colour