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: 4,001

Results 21 to 37 of 37
This thread is locked. New replies are disabled.
6 Jan 2008, 7:10 PM
#21
ajeh avatar

ajeh

Oba-san

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

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

Thanks for the update that setting the Quantity Decimal places let you use the minimums and units correctly for your products when they were set to less than 1 ... :smile:

7 Jan 2008, 7:05 AM
#22
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

Glad You Got It Working.

AA TECH

5 Jun 2009, 9:15 AM
#23
aboveallfabric avatar

aboveallfabric

New Zenner

Join Date:
Feb 2009
Posts:
17
Plugin Contributions:
0

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

Okay - so I have my decimal as 1 - my minimum as .5 and the units as .5 too. That is all great. But I only want full or half - and tonight I got an order for .6 instead. How can I force it to only go in increments of .5?

Melanie

5 Jun 2009, 4:29 PM
#24
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

Set the Units on the Product to .5 should do this ... :smile:

Have you an URL to this product?

5 Jun 2009, 11:14 PM
#25
aboveallfabric avatar

aboveallfabric

New Zenner

Join Date:
Feb 2009
Posts:
17
Plugin Contributions:
0

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

I have the units to .5 as well.

It's not just one product either - but here is one you can take a look at

http://aboveallfabric.com/shop/index.php?main_page=product_info&cPath=231_123_217_219&products_id=1189

And the corresponding admin area for this product

Product Qty Minimum: 0.5
Product Qty Maximum: 0 0 = Unlimited, 1 = No Qty Boxes
Product Qty Units: 0.5
Product Qty Min/Unit Mix: Yes

6 Jun 2009, 5:27 AM
#26
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

.6, .7, .8. .9 are being considered as units of .5 as they are .60 ... hmm ... :unsure:

Going to move this to Bug Fixes and see what that is about ... :blink:

6 Jun 2009, 5:31 AM
#27
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

Aha! A clue ... peek at #24 and apply the bug fix ... see if this corrects the problem:
http://www.zen-cart.com/forum/showthread.php?p=697924

6 Jun 2009, 5:33 AM
#28
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

Note: be sure in the Configuration ... Stock Settings ... you have set:

Product Quantity Decimals
Allow how many decimals on Quantity

0= off

0
1
2
3

6 Jun 2009, 5:45 AM
#29
aboveallfabric avatar

aboveallfabric

New Zenner

Join Date:
Feb 2009
Posts:
17
Plugin Contributions:
0

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

I double checked my decimal number and it is set at 1. In fact I checked it and had my husband check it too :blush:

STOCK:Product Quantity Decimal: 1

I made the changes in #24 on the other thread and it did not work. Still accepting numbers other than increments of .5 :no:

I really appreciate you helping!

6 Jun 2009, 5:55 AM
#30
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 version Zen Cart are you using?

Clean install or an Upgrade?

I am not able to repeat this issue in v1.3.8 with these settings ... :unsure:

You did change the code in both locations, correct?

6 Jun 2009, 5:56 AM
#31
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

And you did apply the change from #4 on this post that DrByte wrote out, correct?

6 Jun 2009, 4:30 PM
#32
aboveallfabric avatar

aboveallfabric

New Zenner

Join Date:
Feb 2009
Posts:
17
Plugin Contributions:
0

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

I did change it in both of those places. I added the extra line that was in red. That is what you wanted me to do, isn't it?

My version says Zen Cart 1.3.8a and it says Database Patch Level: 1.3.8 "fresh installation"

PHP Version 5.2.9

6 Jun 2009, 4:37 PM
#33
aboveallfabric avatar

aboveallfabric

New Zenner

Join Date:
Feb 2009
Posts:
17
Plugin Contributions:
0

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

Ajeh:

And you did apply the change from #4 on this post that DrByte wrote out, correct?

Yep - I had already changed that too.

7 Jun 2009, 3:13 AM
#34
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 cannot repeat this error that you are having regardless of how I try to configure it the Minimum of .5 and Units of .5 work ...

If you want, drop me a PM to your Zen Cart Admin and I can peek to see if I see anything odd on your setup ... :unsure:

10 Jun 2009, 1:32 PM
#35
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 changed the function fmod_round in the functions_general.php with a different method:

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

and this appears to fix your rounding issue ...

See if everything is now working for you as it appears to be working for me now ... :smile:

11 Jun 2009, 4:38 AM
#36
aboveallfabric avatar

aboveallfabric

New Zenner

Join Date:
Feb 2009
Posts:
17
Plugin Contributions:
0

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

Ajeh:

I changed the function fmod_round in the functions_general.php with a different method:

// replacement for fmod to manage values < 1
function fmod_round($x, $y) {
$x = strval($x);
$y = strval($y);
$zc_round = ($x1000)/($y1000);
$zc_round_ceil = (int)($zc_round);
$multiplier = $zc_round_ceil * $y;
$results = abs(round($x - $multiplier, 6));
return $results;
}

> 
> and this appears to fix your rounding issue ...
> 
> See if everything is now working for you as it appears to be working for me now ... :smile:

Yes!  That did the trick.  It is working like a charm!  Now to edit the rest of my products for 1/2 yards.  Thank you for all your help!
11 Jun 2009, 4:47 AM
#37
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

You are most welcome ... glad that this could get things running again for you ... :smile: