Author Topic: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]  (Read 54014 times)

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2628
  • VirtueMart Version: 3.2.5
Designed to offer a simple way to setup product variants such as size / colour etc - without the  need to create multiple VM products

The Plugin has been modified to a new name - VMCustom - VM Product Cart Variants (this should help avoid confusion caused by old name of DropBox as this did not reflect functionality)

Tested on VM3 using J3 php5.6 and php7and J2.5.  Its functionality is based on the original DROPBOX by PRO with 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

    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 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.
regards
A

Joomla 3.8.2
php 5.6 + php 7

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2628
  • VirtueMart Version: 3.2.5
Updated version.
regards
A

Joomla 3.8.2
php 5.6 + php 7

lekreator

  • Beginner
  • *
  • Posts: 4
Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
« Reply #2 on: September 09, 2017, 05:39:44 am »
its possible to make percentage?

IE: variant 1 20%, variant 2 30% ?

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2628
  • VirtueMart Version: 3.2.5
Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
« Reply #3 on: September 09, 2017, 10:38:15 am »
Quote
IE: variant 1 20%, variant 2 30% ?

Code: [Select]
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
regards
A

Joomla 3.8.2
php 5.6 + php 7

arkimede360

  • Beginner
  • *
  • Posts: 1
  • A beginner
Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
« Reply #4 on: September 11, 2017, 12:39:40 pm »
Hi, the price is whitout tax, es:

Code: [Select]
15 gg lavorativi@+60
How to add price with tax?

Thank you.

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2628
  • VirtueMart Version: 3.2.5
Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
« Reply #5 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
regards
A

Joomla 3.8.2
php 5.6 + php 7

Vickham

  • Beginner
  • *
  • Posts: 2
  • A beginner
Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
« Reply #6 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

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2628
  • VirtueMart Version: 3.2.5
Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
« Reply #7 on: September 28, 2017, 11:15:39 am »
Format is :-

variantdisplayed@pricemodifier@skumodifier@weightmodifier

So in your case:-

variantdisplayed@pricemodifier@@weightmodifier

6kg@+10@@6


 :)



regards
A

Joomla 3.8.2
php 5.6 + php 7

Vickham

  • Beginner
  • *
  • Posts: 2
  • A beginner
Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
« Reply #8 on: September 28, 2017, 23:56:45 pm »
Thanks a lot AH!! You're a lifesavior!  :)

Pirosoft

  • Beginner
  • *
  • Posts: 34
Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
« Reply #9 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


AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2628
  • VirtueMart Version: 3.2.5
Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
« Reply #10 on: October 02, 2017, 09:29:18 am »
This is relevant to your issue:-

Code: [Select]
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.
regards
A

Joomla 3.8.2
php 5.6 + php 7

rvbgnu

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 107
    • Puma-IT.ie
Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
« Reply #11 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

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.
Best Regards, Hervé Boinnard - Irish Time (GMT+1)
Joomla! multilingual website and online business made easy - https://www.puma-it.ie

Updated for VM3 and Joomla 3.x! Stripe.com payment plugin for VirtueMart: http://forum.virtuemart.net/index.php?topic=120452.0
UPDATED Authipay (AIB Merchant Services) for VirtueMart 2 & 3: http://forum.virtuemart.net/index.php?topic=116420.0

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2628
  • VirtueMart Version: 3.2.5
Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
« Reply #12 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"|
regards
A

Joomla 3.8.2
php 5.6 + php 7

rvbgnu

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 107
    • Puma-IT.ie
Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
« Reply #13 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.
Best Regards, Hervé Boinnard - Irish Time (GMT+1)
Joomla! multilingual website and online business made easy - https://www.puma-it.ie

Updated for VM3 and Joomla 3.x! Stripe.com payment plugin for VirtueMart: http://forum.virtuemart.net/index.php?topic=120452.0
UPDATED Authipay (AIB Merchant Services) for VirtueMart 2 & 3: http://forum.virtuemart.net/index.php?topic=116420.0

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2628
  • VirtueMart Version: 3.2.5
Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
« Reply #14 on: October 06, 2017, 12:11:22 pm »
Quote
so 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)




regards
A

Joomla 3.8.2
php 5.6 + php 7