Problem with variants - the add to basket button remains disabled
Hi
I have used the starter kit and have not changed any logic in the product.cshtml page. When I add variants to my product it shows up fine as it should on the product details page, bit when I choose among the variants in the dropdown(s) and enter a digit for quantity, the "Add to basket" button remains disabled. (I can see the class disabled is on the button in the source".
I have changed the product variant property alieas to "variants" as in the instructions for setting up the starter kit, but I can't get it working like in the online starter kit demo, where e.g. "summer yacht" has variants, and enables the buy button when variants are selected.
Is there some criteria which should be fulfilled and that I am overseeing when when adding variants to a product? (sku, name, stock etc.) or maybe there is a guide or a screenshot on properly variants settings in the backend - or am I completely missing something?
There is no errors or warnings in the console. And it looks like the variants output JSon is generated as it should, but the button keeps the class "disabled" when choices are selected. Do I need to reference any extra JS-files?
I would really like to help, but this sounds like a bit of looking into the javascript and markup. From the data you have provided it's hard for me to address the problem.
What I would do was to try and debug the javascript to see where something is going wrong. Try to remove some variables and maybe make it more simple. And check out our demo.teacommerce.net, to maybe find out what is different in your setup.
Thanks for your reply. Your suggestion "try and debug the javascript" made me checkup on my .js references, and I realized that the product.js is not referenced in the Start Kit by default. So after adding:
<script src="/Scripts/product.js"></script>
to my master, it worked :-)
I noticed that some of the other js references also needs to be included manually.
Please note:
This .js file is referenced in the online Starter Kit demo:
<script src="/Scripts/cart.js"></script>
but it throws a 404 - File or directory not found error.
- Don't know if it does anything important regarding the cart functionality? No console errors here as far as I can see.
Problem with variants - the add to basket button remains disabled
Hi
I have used the starter kit and have not changed any logic in the product.cshtml page. When I add variants to my product it shows up fine as it should on the product details page, bit when I choose among the variants in the dropdown(s) and enter a digit for quantity, the "Add to basket" button remains disabled. (I can see the class disabled is on the button in the source".
I have changed the product variant property alieas to "variants" as in the instructions for setting up the starter kit, but I can't get it working like in the online starter kit demo, where e.g. "summer yacht" has variants, and enables the buy button when variants are selected.
Is there some criteria which should be fulfilled and that I am overseeing when when adding variants to a product? (sku, name, stock etc.) or maybe there is a guide or a screenshot on properly variants settings in the backend - or am I completely missing something?
Best regards.
Hi Thomsen,
Does your browser console display any errors? If the frontend shows the variants, they should be set up correctly.
/Rune
Hi Rune,
There is no errors or warnings in the console. And it looks like the variants output JSon is generated as it should, but the button keeps the class "disabled" when choices are selected. Do I need to reference any extra JS-files?
Here is my form:
Hi Thomsen
I would really like to help, but this sounds like a bit of looking into the javascript and markup. From the data you have provided it's hard for me to address the problem.
What I would do was to try and debug the javascript to see where something is going wrong. Try to remove some variables and maybe make it more simple. And check out our demo.teacommerce.net, to maybe find out what is different in your setup.
If you want someone to look into your code and help you, Tea Commerce provides the confidence program: https://teacommerce.net/products/confidence/
/Rune
Hi Rune
Thanks for your reply. Your suggestion "try and debug the javascript" made me checkup on my .js references, and I realized that the product.js is not referenced in the Start Kit by default. So after adding:
to my master, it worked :-)
I noticed that some of the other js references also needs to be included manually.
Please note:
This .js file is referenced in the online Starter Kit demo:
but it throws a 404 - File or directory not found error. - Don't know if it does anything important regarding the cart functionality? No console errors here as far as I can see.
Best regards.
Cool. Thanks for the heads up. We will have a look at it.
/Rune
is working on a reply...