VirtueMart Forum

VirtueMart 2 + 3 + 4 => Administration & Configuration => Topic started by: rckmad on January 22, 2013, 23:32:09 PM

Title: Custom Field Cart variant of product weight
Post by: rckmad on January 22, 2013, 23:32:09 PM
I need to create a custom field cart variant that not only change the price of the product but also change the product weight to calculate the shipping.
How can I do that?
I didn't find a way
It is a site that sells plants and each plant have different choices for the pot, and each pot weight different.

Thanks in advance

Joomla 2.5
VM 2
Title: Re: Custom Field Cart variant of product weight
Post by: Mysterion on February 11, 2013, 17:53:59 PM
I have the exact same requirement. Did you ever find a solution to this seemingly fairly standard requirement?

Many thanks - David
Title: Re: Custom Field Cart variant of product weight
Post by: webbits on March 29, 2013, 13:46:14 PM
Same situation here....can someone at Viturmart help us out?  Did either of you find a solution?  I need to generate either the correct weight or have cart variant override the "quantity field" in order to correctly calculate UPS shipping charges.


Thanks,
Ivey
Title: Re: Custom Field Cart variant of product weight
Post by: PolishedGeek on March 29, 2013, 14:50:31 PM
Hello -  We inquired a while back about this with Max Milbers, the VM lead developer. We'd like to be able to adjust weight via our "Breezing Forms Custom Fields" extension and can't do it yet either. Max said the ability to adjust weight and dimensions based on attributes or custom fields is coming in 2.2, I believe.

So unfortunately, it's not possible right now, even with a custom field plugin. :(
Title: Re: Custom Field Cart variant of product weight
Post by: webbits on March 29, 2013, 15:15:53 PM
Thanks!  For the reply that is....Polished Geek had really improved the site as it now stands; Your plug in and Breezing Form rock.....solving the weight challenges is the last thing need for launch.

FYI - Fields turn on/turn off really saved a lot of manual labor avoiding have to create a list of cart variants by each product.

Ivey

Title: Re: Custom Field Cart variant of product weight
Post by: dj_mystery on April 14, 2013, 01:57:44 AM
hi mate, i have the same issue and i was wandering if you found any solution. i realized this problem a little bit late, after i have setup about 600 products with custom fields and its big issue for me to find the solution. thanx
Title: Re: Custom Field Cart variant of product weight
Post by: PolishedGeek on April 14, 2013, 02:10:24 AM
Are you asking about the solution for the weight issue, and whether it can be controlled by custom fields?
Title: Re: Custom Field Cart variant of product weight
Post by: PRO on April 14, 2013, 04:57:46 AM
this can be done with child products easy

OR

in regards to changing the shipping price based on the custom.

a custom field product plugin that talks to a shipping plugin can do this.

The custom field plugin just has to define the variable

& in the shipping plugin

&getOrderWeight($cart, $method->weight_unit){
$newOrderWeight=code here
return $newOrderWeight;
}


OR

IF it's a small shop, with only a few products & custom fields (and using native customs NOT plugins), this can be done with just a shipping plugin & matching the "custom field id". This is too much code & hard to manage on a large site though.

Title: Re: Custom Field Cart variant of product weight
Post by: dj_mystery on April 14, 2013, 12:43:40 PM
Here is my problem :
I am developing an eshop with herbs and spices. So the default weight that a customer can buy for each product is 0.100 Kg (and this is also the default  weight  for each product in the backend). I have made custom fields for weight options (100gr, 200gr, 300gr ......) but independently from the selected option the final product in the cart has always as weight 0.100. I am looking  for a solution than can bridge the custom field weight with the actual weight in the cart so I will have right calculation in shipping costs.
Title: Re: Custom Field Cart variant of product weight
Post by: webbits on April 14, 2013, 14:17:01 PM
PRO - you make it sound so easy.  I would not know where to begin to make such a plugin.  There are less than six items in the cart that require weight adjustments....what would be the cost to get the plugin out of your head and into a useable file for distribution?  You would be welcomed to test with my site....

Thanks.....
Title: Re: Custom Field Cart variant of product weight
Post by: PRO on April 14, 2013, 15:12:31 PM
6 items. Use child products
Title: Re: Custom Field Cart variant of product weight
Post by: webbits on April 14, 2013, 15:23:43 PM
6 product each with quantities in increments of 250 going up to 5,000.   I am dealing with sheets/reams of printed paper; or selling at half ream increments.

There are so many variables I would like to keep it simple for the buyer and the site owner.  It has been a fun adventure automating the ordering process.  Weight is the final challenge.

Thanks for you input thus far.  If any ideas or models come to mind please let us know.  *smiling

Ivey



Title: Re: Custom Field Cart variant of product weight
Post by: leeburstroghm on August 10, 2013, 01:41:07 AM
I require the exact same options.. I have a cart variant, custom fields, for sizes.. the cost does change, however we really need the weight to change so the shipping module that calculates by weight, will work correctly!!

This is very important.. it seems like it would not be a big deal, for someone who understands VM and plugins, to take the existing custom field cart varient and add a weight, that will populate the correct weight in the cart..

Please. we would pay for this if someone can present it!!

PolishedGeek has breezing forms plugin, which is nice.. but nothing weight related.. this is a big deal!! any help. direction... do we have to use child products to accommodate for this little bit of functionality?
Title: Re: Custom Field Cart variant of product weight
Post by: PolishedGeek on August 10, 2013, 06:32:42 AM
Thanks for the nod to our Breezing Forms Custom Fields solution! :)

We did spec out a customization to do this for a client a while ago, but he never moved forward with the project due to budget constraints. I'm happy to share what we proposed (you can contact us off the forum for pricing at https://PolishedGeek.com/clients/contact.php).

The problem is that VirtueMart 2.0.x doesn't support weight modification, at least not last we checked. A while back we chatted with Max and he said they won't support it for custom fields until VirtueMart 2.2. If you can wait for that version, it's supposed to be out in Q4 this year. If someone must have this before the end of the year, what we propose is to add a new parameter to our Breezing Forms Custom Fields code, plus make a small hack to your calculated shipping plugins.

NOTE: This will require hacking all your shipping plugins that need the weight adjusted. As described here, the solution will only adjust the weight for the shipping calculation. If there are other places where you want/need the adjusted weight to be utilized, or the new weight to be displayed, this solution would require additional customizations to achieve that. If the end goal is just to be able to control the shipping weight based on the options chosen by the shopper, then this will work.

Here's the basic idea behind this solution.

1) Enhance our existing extension code to add a new field to adjust weight in the custom form of the product page.
2) Weight adjustment format would be "value|+price|+weight" (for example: "yes|+5.00|1.00" so it would add $5.00 and 1 kg or 1 pound or whatever, depending on your VirtueMart configuration).
3) Store that adjusted weight value in a variable when the shopper submits the form
4) Hack the shipping plugins to pick up that stored weight variable, and add it to the weight for that item, before it calculates the shipping cost.

The hardest part is modifying the various shipping plugins to support the weight as each one is different in how they process weight. The project cost would be a factor of the additional parameter work, which shipping plugins you are using, and how many plugins, and a few other factors.

Perhaps this proposed solution will spark some additional ideas as well!
Title: Re: Custom Field Cart variant of product weight
Post by: lindapowers on September 20, 2013, 17:03:36 PM
Hi, interesting post. I agree this is needed in VM2.

This will be great for fruit shops like ours and everyone that needs to sell products with cart variants per kg.
Title: Re: Custom Field Cart variant of product weight
Post by: servlet on February 07, 2015, 14:23:43 PM
And what happen in VM3.x? Is it available now. I am not tested VM3.x... Please share your xp.
Title: Re: Custom Field Cart variant of product weight
Post by: qb-virtue on June 30, 2015, 21:05:24 PM
I am need of this feature for a VM3 site, does anyone have any input? Child products are not an option for me.
Thanks in advance. 
Title: Re: Custom Field Cart variant of product weight
Post by: AH on June 30, 2015, 21:52:06 PM
Maybe this will help

http://forum.virtuemart.net/index.php?topic=127362.0 (http://forum.virtuemart.net/index.php?topic=127362.0)

I have posted a possible modification for weight settings if the base version does not meet your needs (NOTE THAT THIS IS NOT TESTED!)

http://forum.virtuemart.net/index.php?topic=130512.msg450014#msg450014 (http://forum.virtuemart.net/index.php?topic=130512.msg450014#msg450014)
Title: Re: Custom Field Cart variant of product weight
Post by: servlet on June 30, 2015, 22:45:32 PM
Thank you.
I will read it and test it :)
Title: Re: Custom Field Cart variant of product weight
Post by: Adwans on August 27, 2015, 20:04:14 PM
Hello Members!
This solution looks attractive and clear :
Quote from: PRO on April 14, 2013, 04:57:46 AM

in regards to changing the shipping price based on the custom.

a custom field product plugin that talks to a shipping plugin can do this.

The custom field plugin just has to define the variable

& in the shipping plugin

&getOrderWeight($cart, $method->weight_unit){
$newOrderWeight=code here
return $newOrderWeight;
}


OR
...
I ve started with cart plugin (not a problem) but cannot find customfield plugin. Where is a right place to start from?
My shop  - doors and windows  - has not many products BUT a lot of "size"  (this means "weight") variants. Just want to modify OrderWeight a bit.

Thanks in advance. PRO? Could You?
Zibi
Title: Re: Custom Field Cart variant of product weight
Post by: PRO on August 28, 2015, 13:17:25 PM
Quote from: Adwans on August 27, 2015, 20:04:14 PM
Hello Members!
This solution looks attractive and clear :
Quote from: PRO on April 14, 2013, 04:57:46 AM

in regards to changing the shipping price based on the custom.

a custom field product plugin that talks to a shipping plugin can do this.

The custom field plugin just has to define the variable

& in the shipping plugin

&getOrderWeight($cart, $method->weight_unit){
$newOrderWeight=code here
return $newOrderWeight;
}


OR
...
I ve started with cart plugin (not a problem) but cannot find customfield plugin. Where is a right place to start from?
My shop  - doors and windows  - has not many products BUT a lot of "size"  (this means "weight") variants. Just want to modify OrderWeight a bit.

Thanks in advance. PRO? Could You?
Zibi

in VM3 this is a lot easier.
This plugin does it
http://forum.virtuemart.net/index.php?topic=127362.0

Title: Re: Custom Field Cart variant of product weight
Post by: lindapowers on May 03, 2016, 15:18:52 PM
Quote from: PRO on August 28, 2015, 13:17:25 PM
Quote from: Adwans on August 27, 2015, 20:04:14 PM
Hello Members!
This solution looks attractive and clear :
Quote from: PRO on April 14, 2013, 04:57:46 AM

in regards to changing the shipping price based on the custom.

a custom field product plugin that talks to a shipping plugin can do this.

The custom field plugin just has to define the variable

& in the shipping plugin

&getOrderWeight($cart, $method->weight_unit){
$newOrderWeight=code here
return $newOrderWeight;
}


OR
...
I ve started with cart plugin (not a problem) but cannot find customfield plugin. Where is a right place to start from?
My shop  - doors and windows  - has not many products BUT a lot of "size"  (this means "weight") variants. Just want to modify OrderWeight a bit.

Thanks in advance. PRO? Could You?
Zibi

in VM3 this is a lot easier.
This plugin does it
http://forum.virtuemart.net/index.php?topic=127362.0



I tested but that plugin is super complicated, I couldn't even understand how to set up a basic dropdown for settings. Not complaining, is free and probably useful for many others.

I think guys here as me simply require the custom field of string value with weight modification per variant.

Sadly we seem forced to use childs or multivariants only cause we require a different weight.
Title: Re: Custom Field Cart variant of product weight
Post by: AH on May 03, 2016, 15:50:51 PM
Lindapowers

Quote"I tested but that plugin is super complicated, I couldn't even understand how to set up a basic dropdown for settings. Not complaining, is free and probably useful for many others."

I have posted the - extremely simple solution to your issue on the relevant plugin page.

QuoteQuote

    If a product has weight 5 kg and I want to add variants for 6 and 7 kg don't really understand how to handle that.


Assuming the base product is the 5kg product then the rest is basic maths!

5/6 = 1.2  5/7 = 1.4

Config:

5kg,6kg@*1.2,7kg@*1.4