Clear/reset "Product" custom entry fields after <Add to cart> clicked

  • Posts: 31
  • Thank you received: 1
  • Hikashop Business
4 years 1 month ago #328659

-- url of the page with the problem -- : www.mathost3.co.uk/lou4/index.php/order-...oduct/1-potato-label
-- HikaShop version -- : 4.4.0
-- Joomla version -- : 3.9.1
-- PHP version -- : 7.4.11
-- Browser(s) name and version -- : Firefox Developer 85.0b9(64-bit)
-- Error-message(debug-mod must be tuned on) -- : N/A

Hi

I only have one product which has 6 custom options.After clicking <Add to cart> is it possible to reset to the default values shown for the product?

I have a separate button that reloads the product page which does what I need. Is there a way to force this to execute after the <Add to cart> button is executed?

Thank you

Neville Matthews

Please Log in or Create an account to join the conversation.

  • Posts: 83404
  • Thank you received: 13498
  • MODERATOR
4 years 1 month ago #328670

Hi,

You can add such javascript to the page instead of the extra button :

<script type="text/javascript">
window.Oby.registerAjax(["cart.updated","checkout.cart.updated"], function(params) {
	window.location.reload(true);
});
</script>
That will refresh the current page after the add to cart.

Please Log in or Create an account to join the conversation.

  • Posts: 31
  • Thank you received: 1
  • Hikashop Business
4 years 1 month ago #328884

Hi Nicolas

Thank you have added to javascript you suggested into a module on the page and it works :).

Brilliant....

Thank you

Neville Matthews

Last edit: 4 years 1 month ago by nevillematthews.
The following user(s) said Thank You: Philip

Please Log in or Create an account to join the conversation.

Time to create page: 0.049 seconds
Powered by Kunena Forum