Jump to content

Removing delivery price from "Ajax-Cart".


Recommended Posts

WHat's your prestashop version? On 1.5 you can remove

 

<span id="cart_block_shipping_cost" class="price ajax_cart_shipping_cost">{$shipping_cost}</span>
<span>{l s='Shipping' mod='blockcart'}</span>
 
from blockcart.tpl
  • Like 1
Link to comment
Share on other sites

Ah, sorry I missed that part. Well if that's  the issue, I fear you need modify the code quite heavily, it's a bit long to explain in a blog post. It involves modifying the cart controller so that it returns the total without shipping when called with ajax, and probably the cart class as well (getSummaryDetails)

Link to comment
Share on other sites

Open-up modules/blockcart/ajax-cart.js file.

 

Find:

		if (parseFloat(jsonData.shippingCostFloat) > 0 || jsonData.nbTotalProducts < 1)
			$('.ajax_cart_shipping_cost').text(jsonData.shippingCost);
		else if (typeof(freeShippingTranslation) != 'undefined')
				$('.ajax_cart_shipping_cost').html(freeShippingTranslation);
and comment it out:

 

		/*
		if (parseFloat(jsonData.shippingCostFloat) > 0 || jsonData.nbTotalProducts < 1)
			$('.ajax_cart_shipping_cost').text(jsonData.shippingCost);
		else if (typeof(freeShippingTranslation) != 'undefined')
				$('.ajax_cart_shipping_cost').html(freeShippingTranslation);
		*/
  • Like 1
Link to comment
Share on other sites

  • 1 year later...

V1.6.1.0

in order to solve problem with discount, i try to change in :

<span class="price cart_block_total ajax_block_cart_total">{$total}</span>

with

<span class="price cart_block_total ajax_block_cart_total">{$total-$shipping_cost}</span>

but I lose data after the decimal point and the sign of the currency :(

 

Do you know how to solve it ?

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