- Posts: 1184
- Thank you received: 13
Characteristics price problem
5 years 10 months ago #325681
by verzevoul
Characteristics price problem was created by verzevoul
-- HikaShop version -- : 4.2.2
Hello,
In the product, each characteristic has different price.
The problem is that when i add to cart one item from characteristics, Hikashop adds the wrong item in cart.
For example:
https://ibb.co/BBtQHZw
https://ibb.co/LzWrLdJ
https://ibb.co/jLDstd8
Thank you!
Hello,
In the product, each characteristic has different price.
The problem is that when i add to cart one item from characteristics, Hikashop adds the wrong item in cart.
For example:
https://ibb.co/BBtQHZw
https://ibb.co/LzWrLdJ
https://ibb.co/jLDstd8
Thank you!
Please Log in or Create an account to join the conversation.
5 years 10 months ago #325684
by nicolas
Replied by nicolas on topic Characteristics price problem
Hi,
The issue comes from the customization you've made.
You made the HTML invalid and forgot to add one or two </div>
This lead to the variants HTML data to be inside of the form element of the product page:
monosnap.com/file/yyKs9vSnstDwvY6NkF8XYGxIdI9o9J
By default, that HTML data is outside of the form element so that the characteristics javascript can use that data to replace the HTML inside the form element when you change the selection of the characteristic.
But since that HTML data is now inside the form element, and since it contains the same input names as the inputs in the HTML elements, the last variant of that HTML data overrides the currently selected variant's data when the form is submit and thus on the server HikaShop only sees that last variant data.
The issue comes from the customization you've made.
You made the HTML invalid and forgot to add one or two </div>
This lead to the variants HTML data to be inside of the form element of the product page:
monosnap.com/file/yyKs9vSnstDwvY6NkF8XYGxIdI9o9J
By default, that HTML data is outside of the form element so that the characteristics javascript can use that data to replace the HTML inside the form element when you change the selection of the characteristic.
But since that HTML data is now inside the form element, and since it contains the same input names as the inputs in the HTML elements, the last variant of that HTML data overrides the currently selected variant's data when the form is submit and thus on the server HikaShop only sees that last variant data.
The following user(s) said Thank You: verzevoul
Please Log in or Create an account to join the conversation.
Time to create page: 0.165 seconds