Characteristics price problem

  • Posts: 1086
  • Thank you received: 12
  • Hikashop Business
4 years 4 months ago #325681

-- 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!

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

  • Posts: 83404
  • Thank you received: 13498
  • MODERATOR
4 years 4 months ago #325684

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 following user(s) said Thank You: verzevoul

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

Time to create page: 0.037 seconds
Powered by Kunena Forum