VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: bilalsaad on April 30, 2015, 12:41:46 PM

Title: Sell products by decimal weight
Post by: bilalsaad on April 30, 2015, 12:41:46 PM
Hello,

I have Joomla! 2.5.9 Stable & VM 2.0.18a

I have about 150 sweets products.

I want to sell them by weight not by integer quantity. i.e: I want to sell 0.5kg 1kg 1.5kg ...

How can I do that? (I don't want to set too many variants for each product, but just to enable a decimal quantity or weight)
:(
Title: Re: Sell products by decimal weight
Post by: Studio 42 on April 30, 2015, 12:55:53 PM
It's not possible in virtuemart 2.0.1, perhaps in vm 3.0.x, but the last time i tried to use decimal steps, this was converted to integers when adding product in cart.
The curriousity is that  you can save decimal qunatity step on product edit since many time.

Try the vm 3.0.8, perhaps you have luck.
Title: Re: Sell products by decimal weight
Post by: bilalsaad on April 30, 2015, 13:08:06 PM
Thank you for your reply.

But I want any certain solution to use 05.kg 1kg 1.5kg ...

Are your certain that vm 3.0.8 support this!!!
Title: Re: Sell products by decimal weight
Post by: Studio 42 on April 30, 2015, 15:30:53 PM
Hi,
I cannot certify this work in vm 3.0.8. You have to check your self.

If you need a plugin to add the funtionality, please PM or eMail me for a custom work.

Patrick
Title: Re: Sell products by decimal weight
Post by: Milbo on May 01, 2015, 20:02:05 PM
Of course there is something there since years

http://extensions.virtuemart.net/products/custom-size-detail

It also adjust the weight of your product for the correct shipment.
Title: Re: Sell products by decimal weight
Post by: bilalsaad on May 02, 2015, 10:38:42 AM
Thank you Mr. Milbo, but the plugin you mention (CUSTOM SIZE) is not what we want at all.

It is a customizes size not weight. Also, it need to add customization to each product. 

We need selling products based on decimal weight not size (0.5kg , 1 kg, 1.5kg ...).

Also, we don't want to add customization for every product since all the customization in all products are the same which is the weight.

(I mean, the customer have only to choose a decimal weight for the product instead of integer quantity).

You may check this link that reflects what exactly we need:

http://www.hallab.com.lb/en/products/details/0/221/Mixed%20Baklawa%20Pistachios


If any solution exist in virtuemart please let me know.
Title: Re: Sell products by decimal weight
Post by: Milbo on May 02, 2015, 10:47:27 AM
Quote from: Milbo on May 01, 2015, 20:02:05 PM
It also adjust the weight of your product for the correct shipment.

Use as unit kg and it is exactly what you want. => http://dictionary.cambridge.org/de/worterbuch/amerikanisches-englisch/size

weight is a "size".
Title: Re: Sell products by decimal weight
Post by: bilalsaad on May 02, 2015, 11:06:25 AM
Excuse me again,

But I checked the demo of the plugin, triple times, but I couldn't find any similar between it and what we want.

Did you checked the link I send?
http://www.hallab.com.lb/en/products/details/0/221/Mixed%20Baklawa%20Pistachios

We don't want to customize each product also. Please recheck the link I send again.

Do you have demo link for that plugin other than this?
http://istraxx.com/index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=76&virtuemart_category_id=12&Itemid=435
Title: Re: Sell products by decimal weight
Post by: Milbo on May 02, 2015, 11:16:38 AM
The demo had 20 different products to show all the possibilites. You dont need any variant and you can let enter your customer the size or provide a dropdown with fixed values.

Btw, the solution in the link is not nice. When I want to buy 10 kg, i have to click 19 times !
Title: Re: Sell products by decimal weight
Post by: bilalsaad on May 02, 2015, 11:54:28 AM
Quote from: Milbo on May 02, 2015, 11:16:38 AM
You dont need any variant and you can let enter your customer the size or provide a dropdown with fixed values.

My last question: Without introducing any variant to products, can the customer enter a decimal number for size (0.3 or 0.5 for example)?

If yes, then done, I will buy the plugin and use the size as weight.
Title: Re: Sell products by decimal weight
Post by: jenkinhill on May 02, 2015, 12:20:45 PM
Apart from the plugin you could use custom fields, maybe with this plugin: http://forum.virtuemart.net/index.php?topic=127362.0

eg see this page which was an example for a client:  http://www.keswick.biz/VM3062J34/index.php/vm/tcat/mytestproduct-detail
Title: Re: Sell products by decimal weight
Post by: Studio 42 on May 02, 2015, 12:30:39 PM
The problem with a plugin is that in the cart and product the quantity is 1 and not the size or length you enter.
Of course you can make an overide for the product view to hide quantity. But not in cart

The day virtuemart accept quantity as decimal, this solve the problem for many customer, All is ready for this, min/max and steps, you can set price per weight ...
Title: Re: Sell products by decimal weight
Post by: Milbo on May 02, 2015, 15:10:22 PM
Quote from: bilalsaad on May 02, 2015, 11:54:28 AM
My last question: Without introducing any variant to products, can the customer enter a decimal number for size (0.3 or 0.5 for example)?

If yes, then done, I will buy the plugin and use the size as weight.

Yes, you can also define the steps and your customers could also use fractions, for example 1/2. if you define steps of  0.25kg and your customer enters 0.2 it will set to 0.25. He could also enter 1/5 and would get as result 1/4 (because we defined the steps as 0.25).

And Patrick no you are wrong. Why you talk about a plugin, which you do not know? and Patrick as always, really, ranting without understanding the real problem behind it. A quantity has no unit, the unit of the quantity is the product. It makes a difference if you want to buy 500 pieces a 0,5kg of pistacies, because you sell them yourself again. Or if you want ot buy 250kg of pistacies.

and btw Patrick, we had the discussion often and it got answered very often. It would be nice if you just accept it.
Title: Re: Sell products by decimal weight
Post by: Milbo on May 02, 2015, 15:11:38 PM
Jenkinhill, your solution dont need any extra plugin and can be done easily directly with vm.

But only the customsize plugin changes also directly the weight for you.
Title: Re: Sell products by decimal weight
Post by: Studio 42 on May 03, 2015, 05:10:23 AM
Hi Max,
I never discussed this with you, I do not understand what you're talking about ?
But some vm user want the decimals as quantity to clarify order and card.(see attachment)

Title: Re: Sell products by decimal weight
Post by: bilalsaad on May 04, 2015, 09:45:47 AM
Quote from: Studio 42 on May 03, 2015, 05:10:23 AM
But some vm user want the decimals as quantity to clarify order and card.(see attachment)
You are right, many VM users prefer the simplicity and clarity, even if the significant of the quantity as Milbo says have to be an integer because it is the number you want from the product, no difference if the product is 0.5kg or any.

But, because VM doesn't support this (decimal quantity), I think the better alternative solution is what Milbo says.

I think I will temporary use the custom size plugin.
Title: Re: Sell products by decimal weight
Post by: lindapowers on May 05, 2015, 02:18:20 AM
I dont see your conflict here, we sell per kg and grams so we just define in the product name the quantity and in product weight 0.5 kg in the example of being 500 grams.

Make it simple and write the quantity in the product name!

We sell fruits and this was never a problem. 160 isnt that much either to create them.

You can do it even with the core functions.

If you create a product:

Pistacho sweets (500 g) and define product weight as 0.50 kg and the customer orders quantity 2 it will be 1 kg. Quantity 3: 1.50 kg

We have been doing this since vm2 and this way you are selling per weight. Yes you use the quantity box but the customer already knows is a package of 1 kg or whatever.
Title: Re: Sell products by decimal weight
Post by: Milbo on May 07, 2015, 13:43:06 PM
Patrick, there you see the problem, you have to add the unit to the cart layout. In my solution it is written at the "position" and the quantity of the position cannot have a unit.
Title: Re: Sell products by decimal weight
Post by: Studio 42 on May 07, 2015, 16:22:29 PM
He is sure that if you do not want to implement this solution, you will find unfavorable arguments. I just report what users requested on some forums and projects.

Many prefer to have a main menu at top, but it's not bad to have a main menu at left side, and if it's possible, i do what the customer want.
Title: Re: Sell products by decimal weight
Post by: Milbo on May 07, 2015, 17:25:31 PM
a "item of an invoice" needs a quantity, with the unit "the item of the line". This is indeed most time mandatory.
Title: Re: Sell products by decimal weight
Post by: Studio 42 on May 07, 2015, 19:17:39 PM
This i a real order :http://communaute.leroymerlin.fr/leroymerlin/attachments/leroymerlin/19/6713/1/001.jpg
And look for the quantity colomn.
Leroymerlin is one of the bigest DIY store in france.
Title: Re: Sell products by decimal weight
Post by: Seoirserob on May 15, 2015, 12:34:20 PM
Hi

Milbo pointed toward the following plugin as a solution to this problem:

http://extensions.virtuemart.net/products/custom-size-detail

I would also like to be able to sell food products by weight.

Does this plugin update the stock quantities once an order is placed . . ?

I would like a solution which allow the customer to enter 1.45 or other such decimal value when adding to cart, at a specific price set per kg, and have that amount taken from the overall stock in inventory.

I am be prepared to pay for such a solution, but it would need to fulfill these criteria . . .

Setting a product a definite steps or quantities is not suitable for my needs, ie, 100g, 500g, 1kg, etc as I would like the user to be able to enter a desired weight not choose from a set list.

Also, if it is to be a custom plugin, like the one linked above, shouldn't the quantity box be replaced by the plugin quantity box, rather than having both visible.

Thanks
Rob.
Title: Re: Sell products by decimal weight
Post by: Seoirserob on May 27, 2015, 14:18:48 PM
I have submitted a question to the developer of the plugin mentioned above, asking if the plugin handles update to stock quantities, as yet I have had no reply.

Can anyone shed some light on this?

Thanks.

Rob.
Title: Re: Sell products by decimal weight
Post by: Milbo on May 27, 2015, 15:12:58 PM
Cant find your ticket. But in short, most people who want this, sell meterware and just take a look on the "roll", because you have to pack it anyway.
Title: Re: Sell products by decimal weight
Post by: Studio 42 on June 23, 2015, 18:59:26 PM
Hi all,
I continue this post because i had some other PM and ask for this(decimal quantities).
Problem is to update the stock, if the stock is the size or weight. How you will handel this case ?
Current having 10 Kg in stock = 10 quantity.
Say you sale 2.5kg(using a plugin or not) how you can handel this case?
I know you can change to grams and say quantity = 1 gram, but if you need to update the stock/quantity you have to reconvert all.(it's same when you use size)
Do the virtuemart team change this a day or not ?

Simply say, never, not now or yes. If someone know the current position of the dev team. I will not debate the legislation because this depend the countries.
Title: Re: Sell products by decimal weight
Post by: Seoirserob on June 26, 2015, 18:38:04 PM
My request stands, and I'd like to put it out there to quote me by PM, to implement a system that can allow a vendor to sell by decimal quantity, and update the stock on hand.

Thanks in advance.

Rob.
Title: Re: Sell products by decimal weight
Post by: aftertaf on May 27, 2017, 23:30:24 PM
don't want to fan any flames on this...
I had a similar need : selling some products per metre (fabrics) and others unitary.

I did buy the custom size plugin from istraxx, but as i'm also using VM to power the bricks and mortar shop coupled with POS (which doesn't support this plugin) I had to approach it differently.

For fabrics etc sold per metre
-created product/category overrides
-hacked the currencydisplay.php to have a new public function createPriceDivPerMetre
-overrides use this new function, which only does *100 on the price to display online
-set each product concerned to have the unit of sale metre and product packaging to be 0.01
-stock is handled per cm so when we buy 5m of something we actually have 500 of them.
-cost price is entered per cm
-min sale quantity is 20, incrementing by 5

Took a bit of getting used to, but apart from having to FTP my own version of currencydisplay.php when i update VM component each time, its zero maintenance.

Both VM and POSForWebshops don't have the required level of reporting & statistics on sales, so i've also thrown together my own Access database with ODBC links to websites' VM tables.

Hardest part was learning to override the different views...

In case this helps anyone who is faced with the same 'dilemma'...

Title: Re: Sell products by decimal weight
Post by: AH on May 28, 2017, 11:18:40 AM
Maybe this plugin might have helped you??

Which allows you to set a price per metre and the variants of length you wish to sell plus lots of other config options

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

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

Title: Re: Sell products by decimal weight
Post by: K&K media production on May 28, 2017, 17:32:37 PM
Quote-hacked the currencydisplay.php to have a new public function createPriceDivPerMetre

You can add your own PHP-File as helper to your Template and call public functions from there.
Title: Re: Sell products by decimal weight
Post by: aftertaf on May 29, 2017, 12:00:32 PM
Quote from: K&K media production on May 28, 2017, 17:32:37 PM
Quote-hacked the currencydisplay.php to have a new public function createPriceDivPerMetre

You can add your own PHP-File as helper to your Template and call public functions from there.
Thankyou. I didn't know that.
Title: Re: Sell products by decimal weight
Post by: aftertaf on May 29, 2017, 12:02:37 PM
Quote from: AH on May 28, 2017, 11:18:40 AM
Maybe this plugin might have helped you??

Which allows you to set a price per metre and the variants of length you wish to sell plus lots of other config options

http://forum.virtuemart.net/index.php?topic=127362.0 (http://forum.virtuemart.net/index.php?topic=127362.0)
Hi, it almost would have: the problem is that POSforWebshops has the same limitations, and its the main component in use right now. Ship does physical sales and needed a solution that was pragmatic and simple to implement.
That's why i ended up doing it the way i described.

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


Title: Re: Sell products by decimal weight
Post by: aftertaf on August 03, 2017, 13:08:51 PM
Quote from: aftertaf on May 29, 2017, 12:00:32 PM
Quote from: K&K media production on May 28, 2017, 17:32:37 PM
Quote-hacked the currencydisplay.php to have a new public function createPriceDivPerMetre

You can add your own PHP-File as helper to your Template and call public functions from there.
Thankyou. I didn't know that.


Could you briefly describe how to do this ?
I didn't find any docs and i'm not so good at experimenting in PHP..
Title: Re: Sell products by decimal weight
Post by: K&K media production on August 06, 2017, 18:02:48 PM
new php file inside your template with content like this:


<?php
class myHelperClass {
    public static function 
myFunction() {
        return 
'result';
    }
}
?>



inside your php template files:


if (!class_exists('myHelperClass')) require_once(JPATH_BASE.'/path to your helper file');

$result = myHelperClass::myFunction();


Title: Re: Sell products by decimal weight
Post by: aftertaf on August 07, 2017, 11:13:45 AM
thx: i'll give that a try one of these summer evenings  8)