Designed to offer a simple way to setup product variants such as size / colour etc - without the need to create multiple VM productsUpdate April 2022This plugin works with latest VM4 and Joomla 4
Update April 2021 - Version 6.1 - Support for Language Keys in Title and Variant names
- Add a new option to allow the price to be shown next to the variant option when using a multiply modifier (*)
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 - Removed some old vm2 functions: plgVmDisplayInOrderCustom, plgVmCreateOrderLinesCustom
- Tidied up preparecartproduct function and coded to handle accidental spaces that may have been set by the user in the parameter for modifier value (mv - below)
- Modified the template to handle the display of variants where accidental spaces have been set by the use in the modifier value (mv - below)
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 postThis plugin does not handle stock control at a variant levelPlugin 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:-- Standard sales price + or -
- Standard sales price Multiplied by a value (including decimals) e.g. *2.5 , *.5 , *1
- Fixed price (overrides Standard sales price)
- Append string to SKU (adds a string to the original SKU - useful for analytics and export of order lines)
- Fix the weight (Overrides the product weight)
Each variant can use a different price ruleAdditionally 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
Examples1.
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@*24.
Sell fixed multiples * Config:
2kg@*2,4kg@*4,6kg@*65.
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 skuConfig:
Sml@@sml,Med@+1@med,Lrg@+2@lrgGives 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 variantConfig:
Sml,Med@@@2,Lrg@@@4Gives 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 requiredConfig:
Sml@*2,Med@+12,Lrg@-2The custom field setup WILL save to the product with price variations.
You can adjust this in an individual product if required.
Multiple Cart variant customfieldsIt 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.
Updated version.
its possible to make percentage?
IE: variant 1 20%, variant 2 30% ?
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
Hi, the price is whitout tax, es:
15 gg lavorativi@+60
How to add price with tax?
Thank you.
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
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
Format is :-
variantdisplayed@pricemodifier@skumodifier@weightmodifier
So in your case:-
variantdisplayed@pricemodifier@@weightmodifier
6kg@+10@@6
:)
Thanks a lot AH!! You're a lifesavior! :)
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
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.
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.
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"|
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.
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)
rvbgnu
any luck?
I hope this plugin is helping you out there.
Always free
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
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
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
The plugin does not "chain" multiple methods
an adaptation of the plugin is not possible ???
You can do whatever you like to the plugin - I have no intention of making changes
would something like this possible with this plugin ??? How big would the effort ??? I would be very interested
I have no idea of the effort required or the possibility of doing such a thing
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
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
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?
You must be - I am using dropdowns and have never tried radios
It should be possible for you to figure it out
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.
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.
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.
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.
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
StepIT
Nice implementation - looks good
I will take a look and see what I can do with the code you have kindly provided. :)
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
The qvariant does not have this capability
Ok. It's clear. But you know how to make some modification? Changing Standard Pirce to final price?
Thenks for help
Michal
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
Create a template override for default.php
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.
The price override - is exactly what it says - it overrides all other prices.
So no, you cannot use this plugin
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
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
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
Hello,
after an update, if I put each record in each line, in frontend I see:
How can I solve it?
Thanks,
Davide
I have no idea - you have provided no information to help even understand your issue.
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
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
Solved using a str_replace after line 29.
$text = str_replace(array(" ","\n", "\t", "\r"), '', $text);
Thanks.
Yes - that will do it :)
Thank you for the update - glad you got it solved
Hi,
can you add a small image to the value? Thank you
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
Hello,
the problem came back.
Now when I add to the cart the product, I see
I used this code:
$text = str_replace(array(" ","\n", "\t", "\r"), '', $text);
Any idea on how can I solve this?
Thanks,
Davide
Still Free to al users
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?
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
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
just test the config -50
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
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
Hi,
That fixed the problem, thank you!
Language keys are now converted in the standard version update 6.1 see page 1 of this thread
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?
I don't think so with the way you are using this
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?
It would take some additional coding in the display template that would not be very flexible
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
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 !
... 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 !!!
What is the error melix?
What does not work?
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
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
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?
I figured out that downgrading customfields.php to VM 3.8.8 version solves this problem.
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
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.
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
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
This plugin has been tested and is working with Joomla 4/5 and VirtueMart 4 latest releases