I have an interesting problem. On an e-shop that works a lot of crazy custom fields. Sometimes it happens that the product has 4 color variants. The customer chooses one and buys it. When an order arrives in the email, or I look at it in the administration, instead of the selected color, it lists all the colors I can select.
When I test this product, it doesn't do it again. It's a coincidence. I looked into GA and these orders have no connection. Sometimes it's on the desktop, other times it's on the mobile. Do you have any idea when this might happen?
VirtueMart 3.8.9 10473
Joomla! 3.10.5 Stable
PHP 7.3.30
marvays. The problem is that VIrtuemart do not check if a field is selected or not.
Try to not select a field > add to cart and you see the bug in the cart or order.
I have custom fields as a list and there is always a field selected.
Example (https://www.lukysipy.cz/omotavka-tetivy-flex-evo-15-0-19)
I don't understand why it works 100 times and 1 time not :(
Sorry, it's not the case
in your exemple HTML in product details :
<select name="customProductData[879][9]" class="vm-chzn-select form-control">
<option value="6592">červená - černá </option>
<option value="6593">oranžová - černá </option>
<option value="6594">stříbrná - černá </option>
<option value="6595">zelená - černá </option>
</select>
Nothing is selected by default
DO the test. Simply go to the product and add it to the cart and check your order
It's why i wrote product shortcode plugin, because my customers had same problem
The virtuemart standard cart fields are not verified by javascript and not verified using PHP
Quote from: Studio 42 on February 02, 2022, 16:14:34 PM
It's why i wrote product shortcode plugin, because my customers had same problem
Can I request a link to a plugin that I can buy and use?
I guess You find it here:
https://shop.st42.fr/en/products/shortcodes.htm (https://shop.st42.fr/en/products/shortcodes.htm)
Jörgen @ Kreativ Fotografi
Quote from: Jörgen on February 02, 2022, 22:57:43 PM
I guess You find it here:
https://shop.st42.fr/en/products/shortcodes.htm (https://shop.st42.fr/en/products/shortcodes.htm)
Jörgen @ Kreativ Fotografi
Hello. I was looking at this plugin. But I guess I translated it wrong, because I don't see this function anywhere. or I misunderstand.
Talk to Patrick @ Studio42, I think he can help you explain how to use it, it has a lot of funtionality, shortcodes beeing one of them.
I use some of his extensions already, multi upload of images is my favourite :)
I may look at this also.
Jörgen @ Kreativ Fotografi
You can find the setting here : https://shop.st42.fr/en/shorcodes-english-doc#cart_list
The screenshot are in french, but you have a setting "required" if you need to be sure the option is selected.
This mean that you can force or not the option in the basket.
Demo https://pro.st42.fr/en/shortcodes/test-product-no4-in-engb.html
Or using checkboxes see https://pro.st42.fr/en/shortcodes/checkboxes-insurances.html
Thx.
Do I understand correctly that I have to redesign all custom fields for all products?
Yes, you have to redo all customfields.
If you do not want then add a script to force to select first option or modify it in your sublayout override.
But javascript does not prevent a user from adding an invalid product to cart
Probably Patrick's plugin does the trick.
Alternatively you can try Custom Fields For All (https://breakdesigns.net/extensions/joomla/custom-fields-for-all) as well.
There is a functionality for required custom fields there as well.
Hi Patrick,
what happen when we use your "buy together" plugin ?
Because at this time, it adds all the options at once, if a product is involved in the "buy together" has options
Will it popup a warning like on the demo ?
Quote from: Studio 42 on February 03, 2022, 13:51:00 PM
You can find the setting here : https://shop.st42.fr/en/shorcodes-english-doc#cart_list
The screenshot are in french, but you have a setting "required" if you need to be sure the option is selected.
This mean that you can force or not the option in the basket.
Demo https://pro.st42.fr/en/shortcodes/test-product-no4-in-engb.html
Or using checkboxes see https://pro.st42.fr/en/shortcodes/checkboxes-insurances.html
Buy to gether plugin is to have similar option as amazon, so i never checked if it work with optional fields, but in all case you have a second check in shortcode cart list and the product with invalid options is not added to the cart because the PHP check again the values
thank you for offering plugins. I will definitely think about them, but not on this site. This site has been running for several years and suddenly makes this mistake. I have to find out the reason. I can't redesign all products and replace custom fields :( An error must be detected.
Quote from: Studio 42 on February 05, 2022, 10:26:51 AM
Buy to gether plugin is to have similar option as amazon, so i never checked if it work with optional fields, but in all case you have a second check in shortcode cart list and the product with invalid options is not added to the cart because the PHP check again the values
Hi
it works, but if there's several standard customfields options on a dropdown on a product of the buy together, all options are added at once in the basket.
sirius, the buy together is to add standard products. Not with options. VM internal code do not provide a way to force something
ok
no problem
I was hoping there was a way to bypass the options when adding :( ;)
You may not have locked the value (color) of the parent's product in child products. Then child products will display both values. This is the age-old problem of Virtuemart.
The "custom fields for all" plugin by BreakDesign works very well in this case. Email notifications come along with the selected color and other options.