Jump to content

Option To Delete Free Product From The Cart PS 1.6


Design2Please

Recommended Posts

Hi,

 

I have a cart discount rule setup which adds a free product to the customer's cart when they spend over £50.

 

Currently the customer is not able to remove this product if they decide they do not want it.

 

Looking in "shopping-cart-product-line.tpl" I can see this is due to "&& empty($product.gift)" in the delete button code - so it won't show if the product on that line is a free gift. 

 

If I remove "&& empty($product.gift)"  then this does mean the delete icon shows however if you click on the button the page reloads but the free product is not removed.

 

I am not sure if this is because the product is removed but then added again due to the cart rule or whether the delete button code (below) needs amending so that it can remove the free product.

{if !isset($noDeleteButton) || !$noDeleteButton}
		<td class="cart_delete text-center" data-title="{l s='Delete'}">
		{if (!isset($customizedDatas.$productId.$productAttributeId) OR $quantityDisplayed > 0) && empty($product.gift)}
			<div>
				<a rel="nofollow" title="{l s='Delete'}" class="cart_quantity_delete" id="{$product.id_product}_{$product.id_product_attribute}_{if $quantityDisplayed > 0}nocustom{else}0{/if}_{$product.id_address_delivery|intval}" href="{$link->getPageLink('cart', true, NULL, "delete=1&id_product={$product.id_product|intval}&ipa={$product.id_product_attribute|intval}&id_address_delivery={$product.id_address_delivery|intval}&token={$token_cart}")|escape:'html':'UTF-8'}"><i class="icon-trash"></i></a>
			</div>
		{else}

		{/if}
		</td>
	{/if}
Link to comment
Share on other sites

  • 3 years 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...