Zen Cart Logo
Forums / Setting Up Categories, Products, Attributes / Quantity Units errors - in shopping cart

Quantity Units errors - in shopping cart

Locked

Views: 3,072

Results 1 to 16 of 16
This thread is locked. New replies are disabled.
28 Jun 2010, 7:31 AM
#1
mb1 avatar

mb1

Totally Zenned

Join Date:
Jun 2006
Posts:
565
Plugin Contributions:
0

Quantity Units errors - in shopping cart

i'm getting this shopping cart error just kinda curious what it is, as well it won't let me check out

Please update your order. The item: Apeman Training Gloves ... Quantity Units errors -
You ordered a total of: 1

i have have plenty of stock for that attribute so i'm not sure what is going on.

i've installed the latest version of stock by attributes on a clean cart

28 Jun 2010, 7:39 AM
#2
mb1 avatar

mb1

Totally Zenned

Join Date:
Jun 2006
Posts:
565
Plugin Contributions:
0

Re: Quantity Units errors - in shopping cart

also getting this errer in the debugger

[28-Jun-2010 08:13:15] PHP Warning: Division by zero in /store/includes/functions/functions_general.php on line 1329
[28-Jun-2010 08:13:15] PHP Warning: Division by zero in store/includes/functions/functions_general.php on line 1329s

which is this line of code

$zc_round = ($x1000)/($y1000);

which is not a file i've touched so far in this but i wonder if something else i install is effecting this piece of code or em i looking in the totally wrong place?

28 Jun 2010, 7:52 AM
#3
mb1 avatar

mb1

Totally Zenned

Join Date:
Jun 2006
Posts:
565
Plugin Contributions:
0

Re: Quantity Units errors - in shopping cart

i cornered it down to this my last install of group pricing per item, i assumed everything was working but obviously not here is a link to my attempt at merging 1.39d with group pricing per item, i wonder what i did wrong

http://www.2shared.com/file/BHl-BTXw...r_item_1-.html

28 Jun 2010, 1:31 PM
#4
mb1 avatar

mb1

Totally Zenned

Join Date:
Jun 2006
Posts:
565
Plugin Contributions:
0

Re: Quantity Units errors - in shopping cart

ok i found the file with that is the issue but i don't know what to do with it

store/includes/classes/shopping_cart.php

i'm just going back to the original code and test each line i modify till i track the issue down to the single line of code

28 Jun 2010, 1:50 PM
#5
mb1 avatar

mb1

Totally Zenned

Join Date:
Jun 2006
Posts:
565
Plugin Contributions:
0

Re: Quantity Units errors - in shopping cart

here is the piece of code around line 1135 that is screwing everything up

    $products_array = array();
    reset($this->contents);
    while (list($products_id, ) = each($this->contents)) {
      $products_query = "select p.products_id, p.master_categories_id, p.products_status, pd.products_name, p.products_model, p.products_image,
                                  p.products_price, p.products_weight, p.products_tax_class_id,

                                  [B]p.products_group_a_price, p.products_group_b_price,
                                  p.products_group_c_price, p.products_group_d_price,[/B]

                                  p.product_is_free, p.products_priced_by_attribute,
                                  p.products_discount_type, p.products_discount_type_from
                           from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
                           where p.products_id = '" . (int)$products_id . "'
                           and pd.products_id = p.products_id
                           and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'";

replaces this original code

 $products_array = array();
    reset($this->contents);
    while (list($products_id, ) = each($this->contents)) {
      $products_query = "select p.products_id, p.master_categories_id, p.products_status, pd.products_name, p.products_model, p.products_image,
                                  p.products_price, p.products_weight, p.products_tax_class_id,
                                  [B]p.products_quantity_order_min, p.products_quantity_order_units,[/B]
                                  p.product_is_free, p.products_priced_by_attribute,
                                  p.products_discount_type, p.products_discount_type_from
                           from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
                           where p.products_id = '" . (int)$products_id . "'
                           and pd.products_id = p.products_id
                           and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'";
                               

any ideas? on what to do with this

28 Jun 2010, 1:59 PM
#6
mb1 avatar

mb1

Totally Zenned

Join Date:
Jun 2006
Posts:
565
Plugin Contributions:
0

Re: Quantity Units errors - in shopping cart

ok i just merged the 2 instead of replace one for the other and it seems like everything is peachy now :D

    $products_array = array();
    reset($this->contents);
    while (list($products_id, ) = each($this->contents)) {
      $products_query = "select p.products_id, p.master_categories_id, p.products_status, pd.products_name, p.products_model, p.products_image,
                                  p.products_price, p.products_weight, p.products_tax_class_id,
                                   [B]p.products_quantity_order_min, p.products_quantity_order_units,[/B]
                                  [B]p.products_group_a_price, p.products_group_b_price,
                                  p.products_group_c_price, p.products_group_d_price,[/B]
                                  p.product_is_free, p.products_priced_by_attribute,
                                  p.products_discount_type, p.products_discount_type_from
                           from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
                           where p.products_id = '" . (int)$products_id . "'
                           and pd.products_id = p.products_id
                           and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'";
29 Jun 2010, 2:05 PM
#7
ajeh avatar

ajeh

Oba-san

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

Re: Quantity Units errors - in shopping cart

Before changing code, could you make sure your Products are not setup with a Product Unit of 0 it should be 1 as you cannot but 0 ... :unsure:

29 Jun 2010, 5:26 PM
#8
mb1 avatar

mb1

Totally Zenned

Join Date:
Jun 2006
Posts:
565
Plugin Contributions:
0

Re: Quantity Units errors - in shopping cart

sorry product unit? all the products have stock?

29 Jun 2010, 6:05 PM
#9
ajeh avatar

ajeh

Oba-san

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

Re: Quantity Units errors - in shopping cart

Edit your Products ...

Check the settings, the defaults are:

Product Qty Minimum: 1
Product Qty Maximum: 0
Product Qty Units: 1

If you have the Product Quantity Units set to 0 you will get errors ...

30 Jun 2010, 4:27 AM
#10
mb1 avatar

mb1

Totally Zenned

Join Date:
Jun 2006
Posts:
565
Plugin Contributions:
0

Re: Quantity Units errors - in shopping cart

would this be done through the admin or through the code?

30 Jun 2010, 4:42 AM
#11
ajeh avatar

ajeh

Oba-san

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

Re: Quantity Units errors - in shopping cart

Go to your Zen Cart Admin for your store ...

Go to the Catalog ... Categories/Products ... and find a Product that this happens on and hit E for EDIT ...

Find the settings for:

Product Qty Minimum: 1
Product Qty Maximum: 0
Product Qty Units: 1

What do you have set?

30 Jun 2010, 11:42 AM
#12
mb1 avatar

mb1

Totally Zenned

Join Date:
Jun 2006
Posts:
565
Plugin Contributions:
0

Re: Quantity Units errors - in shopping cart

Product Qty Minimum:1
Product Qty Maximum: 0 0 = Unlimited, 1 = No Qty Boxes
Product Qty Units:1

that is what i have

30 Jun 2010, 12:54 PM
#13
ajeh avatar

ajeh

Oba-san

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

Re: Quantity Units errors - in shopping cart

I tried the Apeman Training Gloves and do not get the error ... did you change something?

30 Jun 2010, 5:21 PM
#14
mb1 avatar

mb1

Totally Zenned

Join Date:
Jun 2006
Posts:
565
Plugin Contributions:
0

Re: Quantity Units errors - in shopping cart

the apeman training gloves have the same 1,0,1 setting

and i haven't touched the code since post number 6
http://www.zen-cart.com/forum/showpost.php?p=902859&postcount=6

which solve my issue at the time and i haven't touch anything since unless adding 10 or so more mods but non of which touched this code. please look at post 5 and 6 and is there an issue with what i did you make it work. Unless the problem is elsewhere

30 Jun 2010, 5:31 PM
#15
ajeh avatar

ajeh

Oba-san

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

Re: Quantity Units errors - in shopping cart

As long as the setting are right ... you will need to speak to the folks writting the Stock by Attribute to see why the error is happening ...

It is odd, others are using it and this is not happening that I have heard of ...

30 Jun 2010, 6:31 PM
#16
mb1 avatar

mb1

Totally Zenned

Join Date:
Jun 2006
Posts:
565
Plugin Contributions:
0

Re: Quantity Units errors - in shopping cart

well thank you like always for all the help