VirtueMart Forum

VirtueMart 2 + 3 + 4 => 3rd party extension => Topic started by: AH on December 20, 2014, 10:53:56 AM

Title: Simple VM4 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: AH on December 20, 2014, 10:53:56 AM
Designed to offer a simple way to setup product variants such as size / colour etc - without the  need to create multiple VM products
Update April 2022
This plugin works with latest VM4 and Joomla 4

Update April 2021 - Version 6.1

Update March 2021 - Version 6
GJC - Great idea to display variant in the cart using its own template, allowing for simple adjustments to be made
New tmpl/cartdisplay.php - can now be styled to control the look of the items in the cart


Update June 2018 - Version 5.1

Tested on VM3 using J3  PHP7.  Its functionality is based on the original DROPBOX by PRO - This version has greater functionality  :)

Download zip file is at the bottom of this post


This plugin does not handle stock control at a variant level

Plugin Features:

    Apply A Template Of Options with just 1 Click includes pricing adjustments -    Options are configured as a simple comma separated List
  Creates a Product drop down selection list of cart variants Or a Radio List (Radio list is new option in version 5 - thanks to Stefano Pascucci )

    Price Variants supported for each cart variant:-
Each variant can use a different price rule

Additionally you can adjust cart weight using the price multiplier * Where the Multiply rule is used, you can optionally modify the cart product weight by the same factor, (Configuration option for each Product cart customfield variant)

Instructions:
Install The Plugin,  Enable It
Go to custom fields.
Click "new"

Fill in the title. 
Make it a cart variant and cart input.
Additional parameters - Choose Plugins, Then "VMCustom - VM Product Cart Variants"
If you save at this point the configuration parameters will be shown. (If you alrady know what to complete - you can just add the parameters required)
Fill In the option field separated by Commas.
Then save.

Structure t@mv,
t = Item variant - Drop selection text and Item variant text that will show in cart
@ = separates the modifier from the selection text - If there is no modifier nothing else is needed
m = modifier either + - * or =
v = modifier value
, = separates variants

Examples

1.Simple selections no price adjust
Config: Red,Green,Blue
All variants are at Retail

2.Adjust the price + or -
Config: Sml,Med@+1,Lrg@+2
Give prices of: Sml = Retail, Med = Retail +1, Lrg = Retail +2

3.Multiply the price *
Config: 1m,2m@*2,3m@*3
Gives prices of: 1m = Retail, 2m = Retail * 2, 3m = Retail * 3

You can also use decimals here e.g. 1 feet,1.5 feet@*1.5,2 feet@*2

4.Sell fixed multiples *
Config: 2kg@*2,4kg@*4,6kg@*6

5.Fix the price of a variant
Config: Red,Green,Blue@=12.50
Gives prices of: Red Green = Retail, Blue = 12.50

And of course you can do a combination of all of the above

6. Append a string to the sku
Config: Sml@@sml,Med@+1@med,Lrg@+2@lrg
Gives SKU's of: SKU: origsku-sml, origsku-med, origsku-lrg

Note: you need 2@ symbols before the sku variant else you will change some other setting

7. Change the cart weight for a variant

Config: Sml,Med@@@2,Lrg@@@4
Gives cart weight of: Sml = product weight, Med = 2, Lrg = 4

Note: you need 3 @ symbols in a variant for the weight to be set correctly otherwise you will change some other setting
Setting a weight using this parameter will override any weight calculated by the multiplier option.


8. Product variant selections can be a set of mixed types if required
Config: Sml@*2,Med@+12,Lrg@-2
The custom field setup WILL save to the product with price variations.
You can adjust this in an individual product if required.


Multiple Cart variant customfields

It is possible to have multiple Cart variant customfields for a product
Each Cart variant customfields creates its' own value based on the Standard sales price of the item. They are not chained or linked, a selection in one product drop box that produces a price variant will not affect any other drop box calculation. 



The plugin is offered "as is" so make sure you test thoroughly before deploying in a live environment.
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: AH on July 03, 2017, 11:24:17 AM
Updated version.
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: lekreator on September 09, 2017, 05:39:44 AM
its possible to make percentage?

IE: variant 1 20%, variant 2 30% ?
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: AH on September 09, 2017, 10:38:15 AM
QuoteIE: variant 1 20%, variant 2 30% ?

3.Multiply the price *
Config: 1m,2m@*2,3m@*3
Gives prices of: 1m = Retail, 2m = Retail * 2, 3m = Retail * 3

You can also use decimals here e.g. 1 feet,1.5 feet@*1.5,2 feet@*2


So to increase by 50% =  *1.5
To decrease to 90% = *.9
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: arkimede360 on September 11, 2017, 12:39:40 PM
Hi, the price is whitout tax, es:

15 gg lavorativi@+60

How to add price with tax?

Thank you.
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: AH on September 11, 2017, 13:20:32 PM
Yes the prices are displayed without tax

You can modify your template to "hard code" a tax calculation

I have no plans to modify the plugin to support the displaying the modifier inclusive of tax
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: Vickham on September 28, 2017, 01:00:27 AM
EDIT: I solved this. Thanks!

Hi!

How can I add a price modifier for a cart weight total?

My product weights 1kg so I use 6kg@@@6 to add a variant of 6kg to the cart weight but also I want to add a +$10 for that variant of 6kg
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: AH on September 28, 2017, 11:15:39 AM
Format is :-

variantdisplayed@pricemodifier@skumodifier@weightmodifier

So in your case:-

variantdisplayed@pricemodifier@@weightmodifier

6kg@+10@@6


:)



Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: Vickham on September 28, 2017, 23:56:45 PM
Thanks a lot AH!! You're a lifesavior!  :)
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: Pirosoft on October 01, 2017, 15:40:31 PM
Hi, i have a problem with this plugin, if a set a multi variant calculations, don't give the right price.
for example i have the product with base price 79.9
And the custom qvariant:
1000@=79.70,3000@=105.00,5000@=128.50,7500@=156.75,10.000@=182.00,15000@=234.00,20000@=292
and in other i have:
7 days@*1,7 days@*1.15

if i set 3000 from the first
and 7 days from the second
105*1.15=120,75

But your plugin give me the price: 116,96

Because make the calcs over the base price in virtuemart product:
79,9*1,15-79,9=11,985
105+11,985=116,96

how i can resolve?

thanks

Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: AH on October 02, 2017, 09:29:18 AM
This is relevant to your issue:-

Multiple Cart variant customfields
It is possible to have multiple Cart variant customfields for a product
Each Cart variant customfields creates its' own value based on the Standard sales price of the item. [b]They are not chained or linked, a selection in one product drop box that produces a price variant will not affect any other drop box calculation. [/b]


This plugin does not chain multiple boxes - one variant will not affect another.

I have no plans to modify the plugin to support this.
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: rvbgnu on October 06, 2017, 01:53:32 AM
Hi AH,

Thank you for keeping this plugin up-to-date.

I migrated in 2015 a website from VM 2.6 to VM 3.0.x, which was using the Dropbox plugin by Pro. I found this thread and followed the discussion to get tips and SQL commands to update the old format. I took some notes, and also URLs of messages. Unfortunately, these posts are no longer available. Why?
http://forum.virtuemart.net/index.php?topic=127362.msg436581#msg436581 (http://forum.virtuemart.net/index.php?topic=127362.msg436581#msg436581)

Do you have instructions on how to do it?
(at that time, your plugin was in version 3.0.7).

I'm looking forward to hearing from you.
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: AH on October 06, 2017, 09:27:48 AM
The posts were removed because they had become outdated and irrelevant to the current version.

Regarding the updating from old versions to new version:

In table: #_virtuemart_customs

The content of custom_element and custom_value fields should now be qvariant

The content of custom_params should be in the format:

custom_qvariant="1m,2m@*2,3m@*3,4m@*4,5m@*5,6m"|custom_qvariant_weight="0"|
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: rvbgnu on October 06, 2017, 11:01:59 AM
Thank you for your reply A, it helps a bit. But I am not comfortable with SQL commands and Regex, so would you have the SQL to migrate from the last dropbox format (on VM2) to the current one? As I kept old versions on my dev environment, I would be able to test and adjust them if needed.

It should be helpful also to people with late migration.

And even if I did it on previous posts (now removed), thank you A for providing us with an up-to-date version of this plugin, and much better for free! I really appreciate it.
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: AH on October 06, 2017, 12:11:22 PM
Quoteso would you have the SQL to migrate from the last dropbox format (on VM2)
It should be helpful also to people with late migration.

Sorry but I never did a migration.

You will need to modify two tables  - my suggestion is to create a "dummy Customfield Cart variant" for the new plugin and see the changes you need to make to any existing ones.

#_virtuemart_customs  (where the Master variant is stored)
AND
#_virtuemart_product_customfields (where variant for the product is stored)




Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: AH on November 07, 2017, 10:24:52 AM
rvbgnu
any luck?
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: AH on January 05, 2018, 10:32:43 AM
I hope this plugin is helping you out there.
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: AH on January 09, 2018, 17:10:16 PM
Always free
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: Sileta on February 04, 2018, 19:57:59 PM
Hi guys, a nice plugin. But I have the following problem. I have all products on discount, because the calculation does not work properly. He always takes the value of the main price. Does one of you know a solution? Best regards
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: AH on February 05, 2018, 10:19:22 AM
Quotebecause the calculation does not work properly

How are you applying your discounts?

As far as I am aware - the valuation works as coded and is correct
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: Sileta on February 05, 2018, 20:49:50 PM
Hello, I have uploaded a few screenshoots for clarity. If I, as can be seen on picture # 2, on the standard price, the color selection and he should 30% to calculate that works flawlessly. But as soon as I choose a higher price, he counts wrong. He then adds the difference of standard price. the result on picture 3 is wrong. Actually, the result should be 345.85 in picture # 3, but it's 307.67. How can you adjust that to make it right? Please excuse my bad english. Thank you for your help
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: AH on February 06, 2018, 10:19:53 AM
The plugin does not "chain" multiple methods
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: Sileta on February 07, 2018, 19:57:39 PM
an adaptation of the plugin is not possible ???
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: AH on February 08, 2018, 16:04:06 PM
You can do whatever you like to the plugin - I have no intention of making changes
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: Sileta on February 08, 2018, 20:14:13 PM
would something like this possible with this plugin ??? How big would the effort ??? I would be very interested
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: AH on February 09, 2018, 16:02:14 PM
I have no idea of the effort required or the possibility of doing such a thing
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: SteP[IT] on February 10, 2018, 11:30:05 AM
I'm considering to use your nice plugin for some simple products having 1 attribute with less than 5-6 values: is there a way to modify it to get values listed as radiobutton instead of dropdown list? It will help alot to get a fast view of all available values for a single option. Regards
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: AH on February 10, 2018, 15:40:53 PM
You should be able to adjust the template default.php to your needs

Here is the api details for the radiolist

Quotehttps://api.joomla.org/cms-3/classes/JHtmlSelect.html
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: SteP[IT] on February 10, 2018, 18:34:28 PM
Modifying the template to use the radiolist API ( substituting 'select.genericlist' with 'select.radiolist' ) produces a radio list having empty 'value' and 'text' fields.
Looking at the API, it should works in that way: am I missing something?
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: AH on February 10, 2018, 23:19:03 PM
You must be - I am using dropdowns and have never tried radios

It should be possible for you to figure it out
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: SteP[IT] on February 11, 2018, 11:49:30 AM
I can't find where I'm wrong.
I have set this in default.php to get different API outputs:
$html = JHTML::_('select.genericlist', $selects,'customProductData['.$product->virtuemart_product_id.']['.$params->virtuemart_custom_id.']['.$params->virtuemart_customfield_id .'][custom_qvariant]','class=customqvariant','value','text',$selects[0],false,true);
$html .= JHTML::_('select.radiolist', $selects, 'customProductData['.$product->virtuemart_product_id.']['.$params->virtuemart_custom_id.']['.$params->virtuemart_customfield_id .'][custom_qvariant]',false,'value','text',$selects[0],false,true);
$html .= JHTML::_('select.suggestionlist', $selects, 'value','text',$selects[0],false,true);


The only one not working is the radiolist, this is the html I'm getting:

<span class="product-field-display">
<select id="customProductData11902412105custom_qvariant" name="customProductData[1190][24][12105][custom_qvariant]" class=customqvariant>
<option value="1" selected="selected">1</option>
<option value="2">2</option>
</select>
<div class="controls">
<label for="customProductData[1190][24][12105][custom_qvariant]" id="customProductData[1190][24][12105][custom_qvariant]-lbl" class="radio">

<input type="radio" name="customProductData[1190][24][12105][custom_qvariant]" id="customProductData[1190][24][12105][custom_qvariant]" value=""  />
</label>
<label for="customProductData[1190][24][12105][custom_qvariant]" id="customProductData[1190][24][12105][custom_qvariant]-lbl" class="radio">

<input type="radio" name="customProductData[1190][24][12105][custom_qvariant]" id="customProductData[1190][24][12105][custom_qvariant]" value=""  />
</label>
</div>
<datalist id="Array">
<option value="1">1</option>
<option value="2">2</option>
</datalist>
</span>


I shows that also datalist data are correctly generated, but not the radiolist ones.
Any hint?
Thank you in advance.
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: AH on February 11, 2018, 15:01:30 PM
Radiolist should be what you are aiming to create.

If you cannot get it to work with a radiolist you may need to look at the data being created prior to the display.

I do not provide support or development for the plugin - it was created to meet my needs and the needs of another forum member.



Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: SteP[IT] on February 18, 2018, 17:53:17 PM
I have sorted it, having spare time to do it.
I have made a simple change, and now you can specify if output has to be rendered as radio, giving the expected radio buttonlist  instead of the original dropdown one.
Are you interested to share with others my mod?

Quote from: AH on February 11, 2018, 15:01:30 PM
Radiolist should be what you are aiming to create.

If you cannot get it to work with a radiolist you may need to look at the data being created prior to the display.

I do not provide support or development for the plugin - it was created to meet my needs and the needs of another forum member.

Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: AH on February 18, 2018, 19:15:54 PM
StepIT

Great you got it working  :)

By all means share what you have done and I can consider if I will add it to base code.

Radios are unusual in the context of options - but if you only have a few it could be good to show as a radio option.
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: SteP[IT] on February 18, 2018, 19:30:44 PM
Attached here the file I have changed, you can sort the changes by comparing them with originals.
I found this useful when using few field values, allowing you to have a better global view in mobile viewport.
You have also to add the new admin strings to the .ini language file.

btw, you can see it working here:
https://www.toolware.it/it/prodotti-per-categoria/recupero-posta-elettronica/stellar-ost-to-pst-converter/stellar-phoenix-ost-to-pst-converter
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: AH on February 23, 2018, 16:50:46 PM
StepIT

Nice implementation - looks good

I will take a look and see what I can do with the code you have kindly provided.   :)
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: 1Jumpman on May 25, 2018, 00:45:24 AM
Is posibility to add multipy (*) to final product price (total summ of all customs fields choosed)  not multiply to Standard sales price? I need to add 133% to final price of product with some cf.

Regards
Michal
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: AH on May 25, 2018, 09:17:09 AM
The qvariant does not have this capability
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: 1Jumpman on May 25, 2018, 11:00:58 AM
Ok. It's clear. But you know how to make some modification? Changing Standard Pirce to final price?

Thenks for help
Michal
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: m.davide82 on June 07, 2018, 10:46:00 AM
Hello,

I have 2 questions:

- How do I remove the price in the dropdown?
- How do I change the price in the dropdown with the total (included baseprice)?


Thanks,
Davide
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: AH on June 07, 2018, 14:40:12 PM
Create a template override for default.php
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: zifou57 on June 25, 2018, 22:46:56 PM
Hi all,

We install this plugin today, but for many prices, we have a price override, and we want to apply the reduction to the price without tax.

With this plugin is possible ??

Thank you.
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: AH on June 26, 2018, 00:14:20 AM
The price override - is exactly what it says - it overrides all other prices.

So no, you cannot use this plugin
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: atlantis05 on June 29, 2018, 18:03:38 PM
Hello "AH"

I've been reading the thread of the forum and everything is pretty well explained, but I can not get the @ multiply me by the amount agreed.

Attached image with the images and settings

Thank you
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: AH on June 29, 2018, 18:34:37 PM
I configured the variant using euros

Multiply should not show ANY value as it is simply a multiple of the single item price.

In your Product customfield you look like you have spaces there should be no spaces in the master nor the product variant options:-

1m,2m@*2,3m@*3,4m@*4,5m@*5

There should be NO spaces  - a space will give you the problem you have.

In addition "Plug-ins  porcentaje" should be 0 not 10.00000

You can remove these spaces - or try the new version 5.1 now available in post 1
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: shanel on August 15, 2018, 16:46:51 PM
HI ,
I need help.
I updated VM version to 3.4.12.
now after i choose one from the dropdown , it doesn't change the price.

please help...

you can see it not working here : www.shel-siet.co.il

please please help.
thanks
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: m.davide82 on October 08, 2018, 16:39:54 PM
Hello,

after an update, if I put each record in each line, in frontend I see:
&#13;&#10;

How can I solve it?


Thanks,
Davide
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: AH on October 08, 2018, 18:23:09 PM
I have no idea - you have provided no information to help even understand your issue.
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: m.davide82 on October 08, 2018, 18:42:43 PM
Hello,

thanks for your answer.

If I write the records like this:
Record1, Record2, Record 3

Everything is ok.

But, when I write:

Record 1,
Record 2,
Record 3

I have the problem I mentioned above.

In the version 1 of the plugin, everything was working right.


Thanks in advance.
Davide
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: AH on October 08, 2018, 21:14:18 PM
Those characters are encoded carriage returns and line breaks

I was unaware that they were ever handled in the parameters.

They should not be there imho or, you can code the plugin to handle them
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: m.davide82 on October 10, 2018, 10:49:41 AM
Solved using a str_replace after line 29.

$text = str_replace(array("&#13;&#10;","\n", "\t", "\r"), '', $text);

Thanks.
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: AH on October 10, 2018, 16:59:36 PM
Yes - that will do it  :)

Thank you for the update - glad you got it solved
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: Radek_cz on November 15, 2018, 10:54:42 AM
Hi,
can you add a small image to the value? Thank you
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: AH on November 15, 2018, 18:01:53 PM
I have no intention of adding any images - you can develop it yourself as the plugin is free for you to adjust as you see appropriate for your purposes
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: m.davide82 on November 26, 2018, 11:19:34 AM
Hello,

the problem came back.

Now when I add to the cart the product, I see
&#13;&#10;

I used this code:
$text = str_replace(array("&#13;&#10;","\n", "\t", "\r"), '', $text);

Any idea on how can I solve this?


Thanks,
Davide
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: AH on April 11, 2019, 10:41:31 AM
Still Free to al users
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: SteP[IT] on May 02, 2019, 07:00:41 AM
I installed VM 3.4.3 and now it seems the plugin doens't work anymore.

I have set the plugin to show those prices:

Licenza 1 utente@=210@11-1,
Licenza 2 utenti@=420@11-2,
Licenza 3 utenti@=615@11-3

but the product price does not change when selecting one of those values.
Adding to cart you get the right variant description added (ie "Licenza 1 utente") but it adds the base product price
Any hint?
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: AH on May 02, 2019, 09:57:01 AM
The latest version I am testing is 3.4.5 and everything is working perfectly

The plugin has also been tested on previous versions and was working as designed.

However it looks as though you specify the first variant as a price adjustment so when the page loads - the variant is not being shown on page load

from my testing - It does add the correct value to cart

Are you saying that this behaviour was different in older versions of VM, because from my testing - it has always functioned in this manner
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: Sileta on December 31, 2019, 15:23:49 PM
Hello, I can also use the plugin to charge a deposit of, for example, € 50 on the base price. Not on the discounted price, it must be calculated from the base price.

Thank you and best regards
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: AH on January 13, 2020, 10:13:32 AM
just test the config -50
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: gap on February 12, 2021, 17:45:31 PM
Quote from: AH on January 13, 2020, 10:13:32 AM

Hi,
This is a great plugin, thank you!
There is one small bug I wonder how I could fix it:
If you use language variables in the custom field label and dropdown values: they will be translated rightly.
If you put this product into the cart: label is still translated, the value not - you will see the language variable.
For example you will see by the product in the cart:  color: VM_COLOR_RED
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: GJC Web Design on February 12, 2021, 20:15:21 PM
try something like

change 
$html .='<span>'.vmText::_($productCustom->custom_title).' '.$item['custom_qvariant'].'</span>';

to
$html .='<span>'.vmText::_($productCustom->custom_title).' '.vmText::_($item['custom_qvariant']).'</span>';

file qvariant.php in the  plgVmOnViewCartVM3() function around line 85

might work
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: gap on February 27, 2021, 15:38:12 PM
Hi,
That fixed the problem, thank you!
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: AH on April 16, 2021, 10:35:49 AM
Language keys are now converted in the standard version update 6.1 see page 1 of this thread
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: TaDrik on September 18, 2021, 16:10:00 PM
Helllo to all.
I am using the below contition. It is for installments and ads a % fee depanting on the number of installments.

No installments,6 installments@*1.079,12 installments@*1.125,18 installments@*1.155,24 installments@*1.195

It works fine ;as it displays the 4 options and by checking the option changs the proce. I shows also the modified price next to every option. Is it possible to show the monthly price that the costumer has to pay?
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: AH on September 18, 2021, 19:26:56 PM
I don't think so with the way you are using this
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: TaDrik on September 18, 2021, 21:15:46 PM
Quote from: AH on September 18, 2021, 19:26:56 PM
I don't think so with the way you are using this
Thank you for your answer. You mean there is another way?
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: AH on September 19, 2021, 11:37:52 AM
It would take some additional coding in the display template that would not be very flexible
Title: VAT Problems with Simple VM3 Product Cart Variant Custom Field Plugin
Post by: niko24 on August 06, 2022, 11:11:26 AM
Hi,

I have a problem with VAT.
If I create several variables e.g. red, green@+100, white@+200 in the plugin in the backend for an article (e.g. €2000 incl. VAT), these are net prices without VAT. Unfortunately, the drop-down menu in the frontend also shows the Net prices are displayed (e.g. red / green+100€ / white + 200€), but the price must be displayed including VAT (e.g. red / green+119€ / white+238€).
However, if I make the selection in the Dropdon menu, the total price is the correct amount including VAT. displayed (e.g. 2119€). Can somebody help me with it?

Many thanks in advance

Konstantin
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: melix on May 07, 2023, 18:56:18 PM
Hi there,
I updated Virtuemart to the version 4.0.14 , Qvariant version 5 (VMCustom - VM Product Cart Variants)with Horme3 Template and something has changed that I can't solve.
It seems to be simple :  Change the 2 Qvariant radio fields I created from vertical to horizontal display.
I have past the last 2 day trying to change this without succes.
Please help would be welcome !
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: melix on May 21, 2023, 19:42:24 PM
... And doesn't work at all with Virtuemart 4.0.20.
That's a pity it was a great plugin :(

Edit December 2023 : Works fine on Virtuemart 4.2.0 !!!
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: PRO on May 26, 2023, 17:45:37 PM
What is the error melix?
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: AH on May 30, 2023, 17:14:38 PM
What does not work?
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: Mister Paul on July 27, 2023, 20:03:23 PM
AH, many thanks for this free usefull plugin.
I instaled just it today.
;-)

For what I understand the default price has to be in first position in the list. Like this:
Core i5,Core i7@*1.5,Core i9@*2

But for some products I'd need to have a different order, and the default item somehere else. Like:
Core i5@*0.5,Core i7,Core i9@*2
where the default price and selected listed item would be here on Core i7 (second listed item)

But for now, when the page loads it's set on Core i5, and with the default price (instead of * 0.5)...

How could I manage that?

Thanks for your help
Paul
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: AH on July 28, 2023, 14:53:00 PM
You could try this

Core i7,Core i5@*0.5,Core i7,Core i9@*2

or

Core i7,Core i5@*0.5,Core i9@*2
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: gap on August 05, 2023, 19:22:47 PM
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?
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: 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.
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: gap on August 09, 2023, 18:53:47 PM
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
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: AH on August 22, 2023, 17:24:35 PM
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.
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: gap on March 25, 2024, 19:47:04 PM
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
Title: Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: AH on April 01, 2024, 15:54:40 PM
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


Title: Re: Simple VM4 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
Post by: AH on April 22, 2024, 17:18:16 PM
This plugin has been tested and is working with Joomla 4/5 and VirtueMart 4 latest releases