News:

Looking for documentation? Take a look on our wiki

Main Menu

Simple VM4 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]

Started by AH, December 20, 2014, 10:53:56 AM

Previous topic - Next topic

gap

Quote from: AH on April 16, 2021, 10:35:49 AM
Hi again
In VirtueMart 4.0.12 10777, if you combine this qvariant plugin with "Generic Child Variant" then the 2nd, 3rd and next items of the very same parent product cannot be added properly to the cart: no custom fields of the next products and basic price only. I use the last version of QVARIANT.

Example:
1. custom field (Generic child variant on short desc): COLOR (gold, red, blue etc)
2. custom field qvariant: size in mm (50 mm : € 20; 100mm: € 30 etc)

problem:
First you add one item, for example red 150 mm. RESULT: Cart shows custom fields and price properly
Afterwards you add a second item. For example: blue, 300 mm. RESULT in the cart: 1st item: all OK. 2nd item: NO custom fields showed and the basic price (€ 20) appears instead of modifed price.

There have been a general problem of VM customfields in the cart in the past. If you comment the line
unset($productIds[$k]);
in customfields.php as it was suggested, I get even bigger problems!
I got custom field group multiplying in category view! (some products in category has the same parents and their custom fields start to multiply. 1st product: normal. 2nd: double custom fields. 3rd: triple custom fields.


This problem of not showing custom fields in the cart appear in case of products where there is a combination of QVARIANT and VM built-in custom field in one product. I tested it with multiple variant but it gave the same bug in the cart.

How to fix this?

gap

I figured out that downgrading customfields.php to VM 3.8.8 version solves this problem.

gap

Quote from: gap on August 08, 2023, 09:00:33 AM
I figured out that downgrading customfields.php to VM 3.8.8 version solves this problem.

And however it works on my site, of course it is not fully compatible and gives an error by saving a product with customfields:
vmError: Plugin plgVmCustomSpecification must be updated, called in vmcustomplugin.php OnStoreProduct

AH

Many thanks for the detailed posts.

I will look to see why the qvariant is having an issue with core vm and may post a fix at some point.
Regards
A

Joomla 4.4.5
php 8.1

gap

Hi guys

I had the problem that the sku modifier code added the modifying string to the sku multiple times.
You can fix this in qvariant.php in line 211.
old code

## code removed until submitter shows configuration see below for correct configurations

AH

That does not appear to be a valid change to the code. 

Please show the configuration that you had and the error that it gives.

Here are 2 sample configurations:-
This config option has two @'s for every choice, the data following the second @ is used to append to the original item sku:-

5m@*5@5m,6m@*6@6m,7m@*7@7m,8m@*8@8m

For an original sku of 31QU[/b}

This gives cart sku's of:

31QU-5m
31QU-6m
31QU-7m
31QU-8m



This config option has two @'s except for every choice except for 7m:

5m@*5@5m,6m@*6@6m,7m@*7,8m@*8@8m,9m@*9@9m

For an original sku of 31QU[/b}

This gives cart sku's of:

31QU-5m
31QU-6m
31QU
31QU-8m


Regards
A

Joomla 4.4.5
php 8.1

AH

This plugin has been tested and is working with Joomla 4/5 and VirtueMart 4 latest releases
Regards
A

Joomla 4.4.5
php 8.1