Zen Cart Logo
Forums / General Questions / Is It Possible To Make Add To Cart Minimum Unit .5 Like: 1.5 Units

Is It Possible To Make Add To Cart Minimum Unit .5 Like: 1.5 Units

Locked

Views: 3,999

Results 1 to 20 of 37
This thread is locked. New replies are disabled.
11 Aug 2007, 1:04 AM
#1
aatech avatar

aatech

New Zenner

Join Date:
Dec 2006
Posts:
87
Plugin Contributions:
0

Is It Possible To Make Add To Cart Minimum Unit .5 Like: 1.5 Units

I Am Trying To Make The Site Go By Yards, Customers Should Be Able To Purchase Like 1.5 or 1 and 1/2 Yards?
The Prices Vary For Different Fabrics.

I'm Thinking If They Could Put 1.5 In The Quantity or if there Could be a DropDown box That Shows 1/2 In It. That's Doable in Attributes But Then I have To Enter Two Prices Each time. Like If One Item Is $5 A Yard, I Need To Make The 1/2 In The Attribute to $2.50 And Etc For All The Different Prices.

So Any Help Or Opinion Is Definitely Appreciated.

Thanks in Advance.

11 Aug 2007, 3:42 AM
#2
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,616
Plugin Contributions:
0

Re: Is It Possible To Make Add To Cart Minimum Unit .5 Like: 1.5 Units

Yes, you can have .5 as a minimum.

8 Oct 2007, 11:24 PM
#3
aatech avatar

aatech

New Zenner

Join Date:
Dec 2006
Posts:
87
Plugin Contributions:
0

Re: Is It Possible To Make Add To Cart Minimum Unit .5 Like: 1.5 Units

Thank You For Replying.

Doesn't Seem To Work. I Changed The Minimum Value to 0.5

I get This Error When I Try To Place An Order:


Please update your order ...
Product Name: Blue Dalmations on Cream ... Quantity Units errors -
You ordered a total of: 0.5 Min: 0.5

9 Oct 2007, 1:50 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Is It Possible To Make Add To Cart Minimum Unit .5 Like: 1.5 Units

Try changing /includes/functions/functions_general.php

from this:// replacement for fmod to manage values < 1 function fmod_round($x, $y) { $i = fmod($x*1000,$y*1000); return $i; }to this instead:```
// replacement for fmod to manage values < 1
function fmod_round($x, $y) {
$zc_round =(int)(strval($x)*1000)/(strval($y)*1000);
$multiplier = $zc_round * $y;
$results = abs(round($x - $multiplier, 6));
return $results;
}

11 Oct 2007, 2:27 AM
#5
aatech avatar

aatech

New Zenner

Join Date:
Dec 2006
Posts:
87
Plugin Contributions:
0

Re: Is It Possible To Make Add To Cart Minimum Unit .5 Like: 1.5 Units

Thank you for the fast reply.

It's still not working. It doesn't give the error anymore but it rounds .5 to a 1 anyway.

Here's the link to the product I'm trying it on: http://www.fabrichotel.com/index.php?main_page=product_info&cPath=76&products_id=670

Thanks Again.

11 Oct 2007, 5:37 AM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Is It Possible To Make Add To Cart Minimum Unit .5 Like: 1.5 Units

Admin->Configuration->Stock ... what is your setting for "Product Quantity Decimals" ?

11 Oct 2007, 9:35 AM
#7
aatech avatar

aatech

New Zenner

Join Date:
Dec 2006
Posts:
87
Plugin Contributions:
0

Re: Is It Possible To Make Add To Cart Minimum Unit .5 Like: 1.5 Units

I Have The Option 1 Selected for "Product Quantity Decimals"

Now I See That In The Cart, It Shows the subtotal as half the actual price and total as full price of 1, and when you actually checkout it's back to the price of Quantity as 1 and not .5

See below for pictures:

12 Oct 2007, 6:26 PM
#8
aatech avatar

aatech

New Zenner

Join Date:
Dec 2006
Posts:
87
Plugin Contributions:
0

Re: Is It Possible To Make Add To Cart Minimum Unit .5 Like: 1.5 Units

DrByte Anymore Suggestions? or Anyone who could help?

Thanks.

12 Oct 2007, 7:13 PM
#9
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Is It Possible To Make Add To Cart Minimum Unit .5 Like: 1.5 Units

What are your mininum and unit settings for this product?

What happens if you switch to Classic Template, does it make a difference?

14 Oct 2007, 3:21 AM
#10
fatsheldon avatar

fatsheldon

New Zenner

Join Date:
Nov 2006
Posts:
6
Plugin Contributions:
0

Re: Is It Possible To Make Add To Cart Minimum Unit .5 Like: 1.5 Units

thanks guys. i had this exact question and believe that it now works fine. values:

zencart version 1.3.6
product minimum: 0.5
product unit: 1
Product Quantity Decimals: 1

i also changed the code DrByte referenced to eliminate the cart errors.

14 Oct 2007, 3:39 AM
#11
fatsheldon avatar

fatsheldon

New Zenner

Join Date:
Nov 2006
Posts:
6
Plugin Contributions:
0

Re: Is It Possible To Make Add To Cart Minimum Unit .5 Like: 1.5 Units

sorry. spoke too soon. Setting "Product Quantity Decimals to 1" causes the cart to ALWAYS throw errors, though it will still allow you to continue to checkout. so, even if i enter a whole number quantity i get an error like this:

Quantity Error Adjustment
product name - 1 => 1

however, like i said... i can still continue with the checkout. same thing for decimal values. shows error, but calculates the price correctly and allows me to continue.

any ideas why these warning/errors are showing up?

15 Oct 2007, 2:27 AM
#12
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Is It Possible To Make Add To Cart Minimum Unit .5 Like: 1.5 Units

I believe that is a bug ... :cry:

Now, was that bug fixed in v1.3.7.1 ... umm hmm ... I don't have a v1.3.6 handy to see if it is broke and then I have to put a clean v1.3.7.1 as I was working on new code for v1.3.8 so I cannot tell there either ... :lamo:

Might be awhile before I can confirm that v1.3.7.1 fixes that issue that you are having ...

15 Oct 2007, 12:27 PM
#13
fatsheldon avatar

fatsheldon

New Zenner

Join Date:
Nov 2006
Posts:
6
Plugin Contributions:
0

Re: Is It Possible To Make Add To Cart Minimum Unit .5 Like: 1.5 Units

thanks. Im working on getting a test environment setup for my site. when that's done i'll upgrade the thing to the latest version.

I'll post back to verify if it did/didn't fix that bug.

17 Oct 2007, 7:05 AM
#14
aatech avatar

aatech

New Zenner

Join Date:
Dec 2006
Posts:
87
Plugin Contributions:
0

Re: Is It Possible To Make Add To Cart Minimum Unit .5 Like: 1.5 Units

Alright People Thank You Very Much For All Your Help. I figured it out! :clap:
Make These Settings Plus DrByte's Post (#4):

In Product Details (Product in Category) Do:

Product Qty Minimum: 0.5 (As Said Before)

Product Qty Units: 0.5

Thank You All!

17 Oct 2007, 7:11 AM
#15
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Is It Possible To Make Add To Cart Minimum Unit .5 Like: 1.5 Units

Glad you got it fixed.

5 Jan 2008, 5:28 PM
#16
kokonutmama avatar

kokonutmama

New Zenner

Join Date:
Apr 2007
Posts:
20
Plugin Contributions:
0

Re: Is It Possible To Make Add To Cart Minimum Unit .5 Like: 1.5 Units

Ah, I hate to say it, but I made the changes as per post #4 in this thread, and changed the values as per AATECH's most recent post (except that I used .125 instead of .5 as both the minimum quantity and the quantity units, I'd prefer 1 as min and .125 as units, but when that didn't work I changed them to match) and unfortunately, it's still giving an error and rounding. Now, I am using 1.3.7, is there a more up to date version that will work better? What can I do?

You can see the problem at http://www.bamboofabricstore.com. I've only made the minimum and units change to the product "100% bamboo satin" in category "bamboo fabric by the yard." This site is live.

6 Jan 2008, 2:36 AM
#17
aatech avatar

aatech

New Zenner

Join Date:
Dec 2006
Posts:
87
Plugin Contributions:
0

Re: Is It Possible To Make Add To Cart Minimum Unit .5 Like: 1.5 Units

Does it work when you put .5 instead of .125?

6 Jan 2008, 2:59 AM
#18
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Is It Possible To Make Add To Cart Minimum Unit .5 Like: 1.5 Units

What setting do you have for the Configuration ... Stock ...

Product Quantity Decimals
Allow how many decimals on Quantity

0= off

0
1
2
3

6 Jan 2008, 4:48 AM
#19
aatech avatar

aatech

New Zenner

Join Date:
Dec 2006
Posts:
87
Plugin Contributions:
0

Re: Is It Possible To Make Add To Cart Minimum Unit .5 Like: 1.5 Units

I Have Set it Up For 2, But You Should Probably Put 3 In Your Case.

6 Jan 2008, 1:54 PM
#20
kokonutmama avatar

kokonutmama

New Zenner

Join Date:
Apr 2007
Posts:
20
Plugin Contributions:
0

Re: Is It Possible To Make Add To Cart Minimum Unit .5 Like: 1.5 Units

Sweet. Thanks. :smile:

It works with the 1/8ths, I just had to change the number of decimals allowed to 3 in configuration -> stock

In my own defense, I had set that up back when I originally installed the cart, but it didn't work so I changed it back and forgot it.