Author Topic: Non-unique IDs produced for all the products with exactly the same options  (Read 480 times)

arcturus

  • Jr. Member
  • **
  • Posts: 111
  • VirtueMart Version: 3.6.10 10211
Hello everyone,

I see that, by default, in case of category listing of products, in case there are several products with exactly the same options (say radio list), those options have non-unique IDs, and those ID's may also contain spaces, in case the repeated custom property name contains spaces.
A sample is here: https://www.arcturian.proxima-mundi.ro/printuri-pe-canvas-foto-n . In case a certain option for a certain product is chosen, a different product page might open (the javascript on the page might select the same id, but for another product (since the IDs are not unique).
The IDs generated are something like id="[mare (100 x 67 cm)" (begin with [ )

It seems the problem originates in /sublayouts/customfield.php.

Unique IDs might be constructed like product_ID.option-number, without spaces.

___

Later edit:

I found a workaround for this:
Around line 173 in /sublayouts/customfield.php, change
Code: [Select]
$o->value = $elem;for
Code: [Select]
$o->value = $product_id.$i;
This way, the IDs are made unique, even though the options are exactly the same for several products.

Later later edit: It does not actually work (some more thinkgs have to be changed in the javascript). I'll think of something else meanwhile :)
Cheers,
George
https://www.proxima-mundi.ro

Now I'm using Joomla! 3.9.15 and VM 3.6.10 10211 on PHP 7.3.9