disabling submit after add to cart

  • Posts: 102
  • Thank you received: 0
13 years 3 months ago #24296

hi, my cart process eliminates the product page. i use a list template and then when you click for more options i altered the product>show page to only display variations and quantity box and submit and these display in a modal box. so far so good. the problem is it takes a while for the product to add to the cart after clicking the button. i wanted to prevent double clicking so i wrote a little jquery script to make the button go away and a message appear after click. this works fine except for products with variants. if the variant radio buttons remain unchecked the process works. but if the user clicks a variant then my script no longer works.

this is my script... but i think the issue isnt my script but the way it interacts with the variant script. i wonder if i attach the script inline to the submit button if that would work better? wanted to try that but cant find the template...

(function($) { 
  $(function() {
$('.hikashop_cart_input_button').click(function() {
  $(this).css("display","none");
$('#waitingMessage').removeClass('hide').addClass('show');
});
})
})(jQuery);


any help would be appreciated, thanks, Liz

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
13 years 3 months ago #24301

If I understand your code correctly, you attach the event to the input on page load. However, when you change a characteristic, the new add to cart button displayed is a copy. So the event is not attached to it and that's why it's not working.

having you js code inlined would indeed solve the problem.
The add to cart button display can be overridden with a button template override as explained there:
www.hikashop.com/support/documentation/6...tation.html#override

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

  • Posts: 102
  • Thank you received: 0
13 years 3 months ago #24304

thanks, will give it a try...

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

Time to create page: 0.042 seconds
Powered by Kunena Forum