News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

custom fields went crazy?

Started by marvays, February 02, 2022, 11:39:47 AM

Previous topic - Next topic

marvays

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

Studio 42

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.

marvays

I have custom fields as a list and there is always a field selected.
Example

I don't understand why it works 100 times and 1 time not :(

Studio 42

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

marvays

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?

Jörgen

Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

marvays

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

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.

Jörgen

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


Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

Studio 42

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

marvays

Thx.
Do I understand correctly that I have to redesign all custom fields for all products?

Studio 42

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

balai

Probably Patrick's plugin does the trick.

Alternatively you can try Custom Fields For All as well.
There is a functionality for required custom fields there as well.

sirius

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
J3.10.12 | PHP 7.4.33 + APC + memcached + Opcode
VM Prod : 3.8.6 | VM Test : 4.0.12.10777

Studio 42

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

marvays

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.