Jump to content

How to remove items from cart without redirection


Recommended Posts

Hi,

 

I added a global cart to my website in which it appears on all pages.

 

However, whenever I remove an item it redirects me to shopping cart page.

 

This is the code I use to remove an item:

<a class="remove-from-cart xsmall" rel="nofollow" href="{$product.remove_from_cart_url}" data-link-action="remove-from-cart">

1- How can I remove the item without redirection?

 

2- How can I make the container dir only refreshes?

 

Find attached photo for clarification.

 

Thanks

 

Ahmad

post-1336110-0-53477200-1491088772_thumb.jpg

Link to comment
Share on other sites

  • 10 months later...

So i come with a solution,

 

first you must open the file : theme/your_theme/modules/ps_shoppingcart-product-line.tpl or ps_shoppingcart.tpl depends on the one which is used to display the product cart,

Then just replace your <a class="remove-from-cart"> by this one : 

	<a
		  class                       = "remove-from-cart"
		  rel                         = "nofollow"
		  href                        = "{$product.remove_from_cart_url}"
		  data-link-action            = "delete-from-cart"
		  data-id-product             = "{$product.id_product|escape:'javascript'}"
		  data-id-product-attribute   = "{$product.id_product_attribute|escape:'javascript'}"
		  data-id-customization   	  = "{$product.id_customization|escape:'javascript'}">
  {if !isset($product.is_gift) || !$product.is_gift}
  <i class="fa fa-times-circle"></i>
  {/if}
  </a>


If something goes wrong just say what is it, i'll try to help you 
 

 

Edited by Aurelink_ (see edit history)
  • Like 1
Link to comment
Share on other sites

  • 6 months later...
  • 1 year later...

Try this solution:

<a rel="nofollow" href="{$products.remove_from_cart_url}" data-link-action="delete-from-cart">

it helped me.

$product.remove_from_cart_url - removes only one item.

$products.remove_from_cart_url - removes multiple items, in series.

In my case, after removing the item: delete-from-cart - refreshes the page, remove-from-cart - redirects to the cart page.

  • Like 1
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...