News:

Support the VirtueMart project and become a member

Main Menu

Child products and double quotes

Started by sandomatyas, January 24, 2019, 17:05:15 PM

Previous topic - Next topic

sandomatyas

There is a product which has children. The child products have doble quotes in their name.
Like the product is:
- cable
and the children are
- 10" red
- 10" green
- 20" red
- 20" green

We use multivariants to bind these, and the values are 10" and 20"
When I open the productdetails page and try to select the child product, VM doesn't load it at all.

I checked the code and found a code part in sublasouts/customfield.php:
$('select[data-cvsel="field324"]').on('change', { variants:[["
and there is a JS array with the variants but the variants should be escaped because if there is a double quote in the variant name, it breaks the array definition.

I modified the code a bit and added addslashes and it seems valid.

It's Joomla 3.9.2 and VM 3.4.3.9992