Zen Cart Logo
Forums / Setting Up Categories, Products, Attributes / PRODUCTS_QTY_BOX_STATUS in admin/includes/modules/*/collect_info.php

PRODUCTS_QTY_BOX_STATUS in admin/includes/modules/*/collect_info.php

Views: 1,320

Results 1 to 10 of 10
29 Mar 2011, 7:48 AM
#1
kamion avatar

kamion

New Zenner

Join Date:
Mar 2011
Posts:
93
Plugin Contributions:
0

PRODUCTS_QTY_BOX_STATUS in admin/includes/modules/*/collect_info.php

Zen Cart - v1.3.9h

Hi guys,
In the various collect_info.php, I'm trying to figure out where "PRODUCTS_QTY_BOX_STATUS" is defined. I understand the "DEFAULT_*" are defined in the product_type_layout table, but what about "PRODUCTS_QTY_BOX_STATUS"? Where is it defined?

Thanks.

Example code from admin/includes/modules/document_general/collect_info.php:

    $parameters = array('products_name' => '',
                       'products_description' => '',
                       'products_url' => '',
                       'products_id' => '',
                       'products_quantity' => '',
                       'products_model' => '',
                       'products_image' => '',
                       'products_price' => '',
                       'products_virtual' => DEFAULT_DOCUMENT_GENERAL_PRODUCTS_VIRTUAL,
                       'products_weight' => '',
                       'products_date_added' => '',
                       'products_last_modified' => '',
                       'products_date_available' => '',
                       'products_status' => '',
                       'products_tax_class_id' => DEFAULT_DOCUMENT_GENERAL_TAX_CLASS_ID,
                       'manufacturers_id' => '',
                       'products_quantity_order_min' => '',
                       'products_quantity_order_units' => '',
                       'products_priced_by_attribute' => '',
                       'product_is_free' => '',
                       'product_is_call' => '',
                       'products_quantity_mixed' => '',
                       'product_is_always_free_shipping' => DEFAULT_DOCUMENT_GENERAL_PRODUCTS_IS_ALWAYS_FREE_SHIPPING,
                       'products_qty_box_status' => PRODUCTS_QTY_BOX_STATUS,
                       'products_quantity_order_max' => '0',
                       'products_sort_order' => '0',
                       'products_discount_type' => '0',
                       'products_discount_type_from' => '0',
                       'products_price_sorter' => '0',
                       'master_categories_id' => ''
                       );
29 Mar 2011, 8:26 AM
#2
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: PRODUCTS_QTY_BOX_STATUS in admin/includes/modules/*/collect_info.php

kamion:

what about "PRODUCTS_QTY_BOX_STATUS"? Where is it defined?

Several places. Each product type has its own definition. The best way to locate them is with the 'Devolopers Toolkit'. Located under the 'tools' menu.

Cheers
Rod

29 Mar 2011, 8:46 AM
#3
kamion avatar

kamion

New Zenner

Join Date:
Mar 2011
Posts:
93
Plugin Contributions:
0

Re: PRODUCTS_QTY_BOX_STATUS in admin/includes/modules/*/collect_info.php

Ah, thanks! :) That's very useful.

One more define that the 'Developers Toolkit' can't seem to find: PRODUCTS_VIRTUAL_DEFAULT.

// Virtual Products
    if (!isset($pInfo->products_virtual)) $pInfo->products_virtual = PRODUCTS_VIRTUAL_DEFAULT;
    switch ($pInfo->products_virtual) {
      case '0': $is_virtual = false; $not_virtual = true; break;
      case '1': $is_virtual = true; $not_virtual = false; break;
      default: $is_virtual = false; $not_virtual = true;
29 Mar 2011, 11:22 AM
#4
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: PRODUCTS_QTY_BOX_STATUS in admin/includes/modules/*/collect_info.php

kamion:

Ah, thanks! :) That's very useful.

I've always thought so too :smile:

kamion:

One more define that the 'Developers Toolkit' can't seem to find: PRODUCTS_VIRTUAL_DEFAULT.

This is one for the Dev team to answer... You are correct in that the devolopers toolkit can't find this one, this is because it turns out that this used to be set in the database, and assumedly configured via the admin config settings.

However, after reviewing the changes made by the SQL upgrade scripts, it appears that this setting/option/definition is being deleted from the database, even though it is still referenced by the files. :unsure:

Cheers
Rod

29 Mar 2011, 11:47 AM
#5
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: PRODUCTS_QTY_BOX_STATUS in admin/includes/modules/*/collect_info.php

[quote=kamion;1012309
One more define that the 'Developers Toolkit' can't seem to find: PRODUCTS_VIRTUAL_DEFAULT.

// Virtual Products
    if (!isset($pInfo->products_virtual)) $pInfo->products_virtual = PRODUCTS_VIRTUAL_DEFAULT;
    switch ($pInfo->products_virtual) {
      case '0': $is_virtual = false; $not_virtual = true; break;
      case '1': $is_virtual = true; $not_virtual = false; break;
      default: $is_virtual = false; $not_virtual = true;
```[/quote]

I've just taken a closer look at this, and apparently the "PRODUCTS_VIRTUAL_DEFAULT" has been redefined to "DEFAULT_PRODUCT_PRODUCTS_VIRTUAL" (and also relocated into a different table), so to fix the problem that you are having simply update the file with this new constant name.  

A check on my system indcates that the file 'collect_info.php' is the only one affected ....   I must admit though that I am aware that I am using a rather old copy of this particular file, and a quick check shows that the latest zencart update (1.3.9h) has the correct information, so I suspect that you are also using an older copy of this file. 

Cheers
Rod.
29 Mar 2011, 12:02 PM
#6
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: PRODUCTS_QTY_BOX_STATUS in admin/includes/modules/*/collect_info.php

RodG:

a quick check shows that the latest zencart update (1.3.9h) has the correct information,

I retract this statement... The file(s) have been correctly updated in one place, but not the other (the "if (!isset($pInfo->products_virtual))" line).

I guess my next step is to check to see if this has already been reported as a bug or not.

Cheers
Rod

29 Mar 2011, 1:03 PM
#7
kamion avatar

kamion

New Zenner

Join Date:
Mar 2011
Posts:
93
Plugin Contributions:
0

Re: PRODUCTS_QTY_BOX_STATUS in admin/includes/modules/*/collect_info.php

Thanks for checking it out, RodG. :)

What happens in this case when PRODUCTS_VIRTUAL_DEFAULT is undefined? It still seem to work.

29 Mar 2011, 1:03 PM
#8
kamion avatar

kamion

New Zenner

Join Date:
Mar 2011
Posts:
93
Plugin Contributions:
0

Re: PRODUCTS_QTY_BOX_STATUS in admin/includes/modules/*/collect_info.php

<deleted - double post>

29 Mar 2011, 1:19 PM
#9
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: PRODUCTS_QTY_BOX_STATUS in admin/includes/modules/*/collect_info.php

kamion:

Thanks for checking it out, RodG. :)

What happens in this case when PRODUCTS_VIRTUAL_DEFAULT is undefined? It still seem to work.

Very little (nothing) will happen actually... As implied, this is for the storage of a default value, so it just means that should you set this default value to your choosing it will never have an effect... the code will always see it as a zero (or NULL) which is quite possibly the standard default setting anyway.

The data for the actual product is/will still be set when you enter or edit the individual product(s), so it really is no big deal.. you can even ignore it..

So minor is this one that it appears you are the first and only one to have stumbled across it. I have reported it as a bug though, as minor as it is.

Cheers
Rod

29 Mar 2011, 3:53 PM
#10
kamion avatar

kamion

New Zenner

Join Date:
Mar 2011
Posts:
93
Plugin Contributions:
0

Re: PRODUCTS_QTY_BOX_STATUS in admin/includes/modules/*/collect_info.php

Cheers.

Mods, please close this thread. Thanks.