1
votes

I'm using Hotcakes Commerce DNN modules and I'd like to know how I can allow the user to stay on the product page after the "Add to Cart" button is clicked. The default behaviour is to redirect the user to the cart page whenever the a product is added to the cart.

1

1 Answers

0
votes

The easiest way to make this happen is to modify your viewset to change how the add to cart buttons work. Here's a summary of the required steps:

  1. Add and begin modifying your viewset if you haven't started already.

  2. Modify your \VIEWSETNAME\Views\Products_ProductDetails.cshtml file to change the add to cart action from a post, to an AJAX link. This will allow you to add products to cart directly using a link, but keep you on the page.

  3. If you're using the Mini Cart, refresh the page using JS so that it updates appropriately.

Please note that this option won't work well if your products have choices. If this is the case, you should instead allow your customers to be directed to the cart page, and use a parameter there to determine whether or not you redirect back to the product page.