- Posts: 102
- Thank you received: 0
disabling submit after add to cart
- MinnieMouse
-
Topic Author
- Offline
Less
More
15 years 1 month ago #24296
by MinnieMouse
disabling submit after add to cart was created by MinnieMouse
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...
any help would be appreciated, thanks, Liz
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...
Code:
(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.
15 years 1 month ago #24301
by nicolas
Replied by nicolas on topic Re: disabling submit after add to cart
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
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.
- MinnieMouse
-
Topic Author
- Offline
Less
More
- Posts: 102
- Thank you received: 0
15 years 1 month ago #24304
by MinnieMouse
Replied by MinnieMouse on topic Re: disabling submit after add to cart
thanks, will give it a try...
Please Log in or Create an account to join the conversation.
Time to create page: 0.155 seconds