News:

Looking for documentation? Take a look on our wiki

Main Menu

VM3.0.16 bug with default product attribute?

Started by innato, September 03, 2016, 22:04:27 PM

Previous topic - Next topic

innato

I am using VM 3.0.16 with J3.6.2 and PHP 5.6.24. I have cancelled all overrides that have installed, except the language string overrides.
I am sorry but I believe that I have hit upon a VM3 bug. I have included 4 screen shots as attachments.

Through VM3 I am selling a subscription service that comes with different subscription periods, let's say 1 week and 1 month. The default product (default attribute) is a 1 week period.

Now...
If I go to the category view at the front-end where the product is displayed (pic 01) and click the "add to basket" button without touching the subscription period selector (therefore choosing for the default product attribute, i.e. "1 week"), then the product is placed into my shopping cart, of course. But... when I view my cart (pic 02), then the product attribute ("1 week") is not displayed.
Now I go back to the category view and first click the "Product Details" link of the same product. This takes me to the product details page (pic 03).
If I now click the "add to Basket" button (without touching the subscription period selector) and then view my shopping cart, the new product line does show the default subscription period below the product name, i.e. "1 week" (pic 04).
The REAL BAD THING is, that for the first product in the cart, the default attribute ("1 week") is also not stored in the product_atrribute field of table '#__virtuemart_order_items', whereas the second product (that has the subscription period displayed) does have an entry in the product_attribute field.
I am using proprietary software to process VM3 data, which of course gives me a headache when encountering such erratic VM behaviour.
Regards
Regards
Rob

VM3.2.6 (enhanced) on J3.8.8 and PHP 7.1 or 7.2

innato

Have I posted in the wrong category? After more than 14 days still waiting for some response...
Regards
Rob

VM3.2.6 (enhanced) on J3.8.8 and PHP 7.1 or 7.2

GJC Web Design

I don't see in pic one the selector at all?

Are these just normal custom field attributes?

If so I know the problem of a choice not be enforced and solve it on my installs with JS

see e.g. https://www.soesterpapierdiscounter.nl/pbm/handschoenen

Also vm3.0.18 is about to be released so maybe this is better in its action
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Studio 42

Vm do not select default value from the list (don't tried last releases), So perhaps it's why you don't have any values in some cases.
This need some update and adding obligatory input option in VM, so you have always all mandatory inputed(or not) value displayed in cart and order.
I use always plugin for mandatory fields and i check if  the input is set, and prevent add to cart, if value is missing, to correct this behavior.

innato

GJC and Studio thanks for your feedback. I'll need to dig a bit deeper and I'll also try VM3.0.18. Will need a bit of time but I'll post the outcome here.
Regards
Rob

VM3.2.6 (enhanced) on J3.8.8 and PHP 7.1 or 7.2

Milbo

#5
Quote from: Studio 42 on September 20, 2016, 16:48:25 PM
This need some update and adding obligatory input option in VM, so you have always all mandatory inputed(or not) value displayed in cart and order.
I use always plugin for mandatory fields and i check if  the input is set, and prevent add to cart, if value is missing, to correct this behavior.

This is not necessary. It depends on which solution is used to display the dropdown. Customfield String or with Children.

In any case, his first picture does not show the dropdown and there is the error. We have btw exactly the same problem/task in our store and we want to use the Multivariant and category browsing feature.

Yepp, innato, try vm3.0.18. In general, you can controll for any type of variants, if you have something preselected or not. You should just not have a preselected different price, then you need to enable again the direct calculation after page loading (which we disabled).

Btw, when you use child variants, then you wont see the values stored in the order, because it is stored with the product. When you use the customfield String "S" solution, then the values are stored with the order item.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

innato

Regards
Rob

VM3.2.6 (enhanced) on J3.8.8 and PHP 7.1 or 7.2

innato

#7
= PROBLEM SOLVED but there is a flaw=
I finally found the solution and the good news is: it's not a VM bug. I would rather call it an unintended VM programming flaw...
When setting up VM3.0.16 on a separate J3.6.2 install, I saw that the product attribute selector was present in the category view. HOW &^%!@#???

The solution lies in the back-end VM configuration:
VM3 menu CONFIGURATION/Configuration under the Shopfront tab and then at the bottom left "Product Listing". Third from the top of the list: "Show product customfields in browse views". Tick this and you're done!!

The programming flaw is, that if user decides not to show the product custom fields, the custom field data/settings should still be communicated to the next work flow stage (by a hidden field?) and this is not the case and was causing my problem.
But for the rest... I am happy again.
Thank you guys for your time!
Regards
Rob

VM3.2.6 (enhanced) on J3.8.8 and PHP 7.1 or 7.2

Studio 42

Simply hide the display with a CSS if you don't want see it, or remove the add to cart button in category view, this should solve your problem too  ;)

Milbo

Quote from: innato on September 21, 2016, 21:49:18 PM
The programming flaw is, that if user decides not to show the product custom fields, the custom field data/settings should still be communicated to the next work flow stage (by a hidden field?) and this is not the case and was causing my problem.
But for the rest... I am happy again.
Thank you guys for your time!

It is completly wrong to work with hidden fields. The info is stored with the product itself. When you do a selection it is always checked with the available options of the product. When you use the selection in the browse view with customfield S, and you click then on the product, the selection is lost.

but when you use a child variant, it will be preselected. It depends on your customfield, they have advantages and disadvantages.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/