Jump to content

Handling Cost


Gadget

Recommended Posts

Hi.

Is there a way to show the handling cost as a separate item from the shipping cost?

The reason we would like to do this is we would like to offer free shipping on orders over a certain value but would still like to charge a handling fee on all orders?

Andrew

  • Like 1
Link to comment
Share on other sites

It's not quite as easy as I thought it would be. Try changing line 55 of modules/blockcart/blockcart.php (in PrestaShop v1.3.1) from:

'shipping_cost' => Tools::displayPrice($params['cart']->getOrderTotal($usetax, 5), $currency),



to:

'shipping_cost' => Tools::displayPrice($params['cart']->getOrderTotal($usetax, 5), $currency) - Configuration::get('PS_SHIPPING_HANDLING'),
'handling_cost' => Configuration::get('PS_SHIPPING_HANDLING'),



and add the following before the return in the hookAjaxCall function

$smarty->assign('handling_cost', Configuration::get('PS_SHIPPING_HANDLING'));



and change line 68 of modules/blockcart/blockcart-json.tpl from:

'shippingCost': '{$shipping_cost|html_entity_decode:2:'UTF-8'}',



to:

'shippingCost': '{$shipping_cost|html_entity_decode:2:'UTF-8'}',
'handlingCost': '{$handling_cost|html_entity_decode:2:'UTF-8'}',



and change line 507 of modules/blockcart/ajax-cart.js from:

$('.ajax_cart_shipping_cost').text(jsonData.shippingCost);



to:

$('.ajax_cart_shipping_cost').text(jsonData.shippingCost);
$('.ajax_cart_handling_cost').text(jsonData.handlingCost);



and change lines 93-95 of modules/blockcart/blockcart.tpl from:

{l s='Shipping' mod='blockcart'}
{$shipping_cost}




to:

{l s='Shipping' mod='blockcart'}
{$shipping_cost}


{l s='Handling' mod='blockcart'}
{$handling_cost}


Link to comment
Share on other sites

  • 1 month later...

Change lines 460-461 of order.php (in PrestaShop v1.3.1) from:

'shippingCost' => $cart->getOrderTotal(true, 5),
'shippingCostTaxExc' => $cart->getOrderTotal(false, 5),



to:

'shippingCost' => $cart->getOrderTotal(true, 5) - Configuration::get('PS_SHIPPING_HANDLING'),
'shippingCostTaxExc' => $cart->getOrderTotal(false, 5) - Configuration::get('PS_SHIPPING_HANDLING'),
'handlingCost' => Configuration::get('PS_SHIPPING_HANDLING'),



Then add the following before line 131 of shopping-cart.tpl:


{l s='Total handling:'}
{displayPrice price=$handlingCost}

Link to comment
Share on other sites

  • 2 weeks later...

Thanks Rocky, but I've a problem : the shipping price of the block cart is set to -6,00€ (My Shipping Handling costs) for example when there is no product in my cart.

I tried to made an if condition when the price is set (following line), but without any success (I always get an PHP error).
'shippingCost' => $cart->getOrderTotal(true, 5) - Configuration::get('PS_SHIPPING_HANDLING'),

Any solution ?

Thanks.

Mat.

Link to comment
Share on other sites

  • 4 weeks later...
  • 3 months later...
  • 4 weeks later...

Hi Rocky,

I tried to use your changes for 1.3.7 and it made my right column entries disappear. It did seem to retain some of the updates though in the back end that you can see in the body of the order page.

I was simply trying to get the blockcart module to read "Shippiing & Handling" instead of just "Shipping" because the first thing that gets added is the $2.00 charge for handling when you click on the "Check out" button.

To add Shipping and Handling to the blockcart I followed the steps outlined here:
http://www.prestashop.com/forums/viewthread/104670/development/change_block_cart_text_wont_change_dot_

Essentially:
Any place you see {l s= blahblah} within a template
that indicates the string can be (should be) edited via the backoffice Translations tab.

Go to TOOLS>>TRANSLATIONS>>MODULES>>BLOCKCART to change the text for "Shipping" to "Shipping & Handling".

Thanks to your steps, I now have a specific line item for handling too.

Thanks,

Stinkyb.

Link to comment
Share on other sites

  • 1 year later...
  • 1 year later...
  • 3 months later...

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...