Table products

From Zen Cart(tm) Wiki
Revision as of 15:16, 21 October 2006 by Allcanadiansearch.ca (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Database Version

1.3.5


Description

Contains all the information about a given product that can't reasonably be translated into multiple languages. All of the contained information is consistent across all installed languages.


Table Details

Primary Key

products_id

Indexed Fields

products_date_added
products_status
products_date_available
products_ordered
products_model
products_price_sorter
master_categories_id
products_sort_order
manufacturers_id


Columns

products_id Primary Key

A unique, auto incremented value, to identify each product.
Type: int(11)
Null: No
Default:
Extra: auto_increment


products_type

The product type used for this product.
The following product types are included by default:
  • 1: Product - General
  • 2: Product - Music
  • 3: Document - General
  • 4: Document - Product
  • 5: Product - Free Shipping
Type: int(11)
Null: No
Default: 1


products_quantity

The quantity of a given product that you currently have in stock.
Type: float
Null: No
Default: 0


products_model Index

An identifier for the product. Will be shown in the Admin as well as the Catalog (assuming you have it turned on).
Type: varchar(32)
Null: Yes
Default: NULL
Idea.png Hint!
This field is not required to be unique at this time, however, it is advisable to make sure it is unique as it may be used by customers or addon modules to uniquely identify the product.
Idea.png Hint!
If you don't want your competition having an easier time of finding your suppliers, don't use your suppliers item number in this field.


products_image

The path to the default small image file for the product.
Type: varchar(64)
Null: Yes
Default: NULL
Idea.png Hint!
The image path must be relative to and under the images directory.
Example: sony/image.gif will mean images/sony/image.gif. http://my-site.com/my-image.gif will not work as expected.


products_price

The base price, without any taxes included, in the default currency, of the product.
Type: decimal(15,4)
Null: No
Default: 0.0000


products_virtual

Is this product virtual? Can be set to 0 (no) or 1 (yes).
Type: tinyint(1)
Null: No
Default: 0


products_date_added Index

The date and time this product was first added.
Type: datetime
Null: No
Default: 0001-01-01 00:00:00


products_last_modified

The date and time this product was last modified.
Type: datetime
Null: Yes
Default: NULL
Info.png Information!
If a given product has never been modified this field's value will be NULL.


products_date_available Index

The first date that this product will become available for purchase.
Type: datetime
Null: Yes
Default: NULL
Idea.png Hint!
Simply changing this will probably not have the desired effect. The product will still appear as normal except that a note with this date will be shown on the product's listing page. If you want to disable this product, you need to change products_status to 0, or, if you want to display the product as out of stock you need to set products_quantity to 0.


products_weight

The weight of the product in the default units for the store.
Type: float
Null: No
Default: 0


products_status Index

The status of the product. Can be set to 0 (disabled) or 1 (enabled).
Type: tinyint(1)
Null: No
Default: 0


products_tax_class_id

The tax class this product falls under. The default installation includes Taxable Goods (1). If set to 0, as it is by default, no tax class will be used.
Type: int(11)
Null: No
Default: 0
Info.png Information!
This value is pulled from the tax_class_id column in the tax_class table.


manufacturers_id Index

Cross-reference link to the manufacturers table.
Type: int(11)
Null: Yes
Default: NULL


products_ordered Index

The number of units of this product that have been ordered from your shop.
Type: float
Null: No
Default: 0
Idea.png Hint!
You can reset all of the products ordered to 0 through Admin > Tools > Store Manager > Reset ALL Products Ordered


products_quantity_order_min

The minimum number of units of this product that can be ordered on one order.
Type: float
Null: No
Default: 1
Idea.png Hint!
This number must be divisible by products_quantity_order_units. For example, if this is 6, then products_quantity_order_units must be either 1, 2, 3 or 6


products_quantity_order_units

Number of units of this product the customer needs to add to cart if they want this product. The customer can only order an amount that can be divided by this number. If this is set to 6, customers can only order 6, 12, 18, 24 etc. units of this product.
Type: float
Null: No
Default: 1


products_priced_by_attribute

Used to indicate whether it's the products attributes that determine the final price of the product or not. Can be set to 0 (no) or 1 (yes).
Type: tinyint(1)
Null: No
Default: 0


product_is_free

Is the product free of charge to the customer? Can be set to 0 (no) or 1 (yes).
Type: tinyint(1)
Null: No
Default: 0
Info.png Information!
Products marked as Product is Free can still display all pricing information but will be marked as Free on the Product's Page and in the Shopping Cart. Attributes can add to the price thus making the product not free any more depending on which attributes are chosen.


product_is_call

The customer needs to contact you to get a final price on the product. Can be set to 0 (no) or 1 (yes).
Type: tinyint(1)
Null: No
Default: 0
Info.png Information!
Call for Price products cannot be purchased online.
Info.png Information!
Call for Price products can still have all the pricing display features of a regular Product


products_quantity_mixed

Can the same product with different attributes be combined to meet the minimum order for that product? Can be set to 0 (no) or 1 (yes).
Type: tinyint(1)
Null: No
Default: 0


product_is_always_free_shipping

Does the product always qualify for free shipping (the Free Shipping module must be enabled first)? Can be set to 0 (no) or 1 (yes).
Type: tinyint(1)
Null: No
Default: 0
Info.png Information!
If a mixed shopping cart of Always Free Shipping and regular shipping products is checked out the shipping is only calculated using the item, weight or price shipping components of the regular products.
Idea.png Hint!
If all items in the shopping cart are Always Free Shipping products you must have the Free Shipping module turned on in order for the customer to be able to checkout.


products_qty_box_status

Show the quantity box for the product to allow the customer to add more than one of a given product to their shopping cart from the Product Information page? Can be set to 0 (disabled) or 1 (enabled).
Type: tinyint(1)
Null: No
Default: 1
Idea.png Hint!
This is useful on virtual products or products where the purchasable quantity is limited to one.


products_quantity_order_max

The maximum quantity of a give product that can be ordered on one order. 0 = no limit.
Type: float
Null: No
Default: 0


products_sort_order Index

The sort order of this product. 0 = top.
Type: int(11)
Null: No
Default: 0


products_discount_type

What type of discount does the product have? Can be set to 0 (none), 1 (percentage discount), 2 (actual price) or 3 (amount off price).
Type: tinyint(1)
Null: No
Default: 0
Info.png Information!
Always set to 0 if there is no discount (no related discount record exists in the products_discount_quantity table).


products_discount_type_from

Which price is the product discount taken from? Can be set to 0 (discount from price) or 1 (discount from special).

Type: tinyint(1)
Null: No
Default: 0
Info.png Information!
Always set to 0 if there is no discount (no related discount record exists in the products_discount_quantity table).


products_price_sorter Index

Final product price after calculating any discounts and/or specials.
Type: decimal(15,4)
Null: No
Default: 0.0000
Idea.png Hint!
Use function zen_update_products_price_sorter((int)$products_id) to calculate. This function needs to be run after master_categories_id has been set.
Info.png Information!
This is the bottom line price and the display price of the product. It is used for sorting purposes as trying to calculate and sort on the fly with all the pricing features is next to impossible. It requires the master_categories_id.
Warning.png Warning!
Most import programs or mass upgrade programs on price may forget to update the products_price_sorter or set the master_categories_id.
Idea.png Hint!
The master_categories_id must be set before the products_price_sorter can be computed.
Idea.png Hint!
If the master_categories_id does not exist, you can backup your database and try to update the master_categories_id and then the products_price_sorter via Admin > Tools > Store Manager > Update ALL Products Price Sorter.
Warning.png Warning!
The update of the master_categories_id comes from the products_to_categories table. It assumes the first categories_id found is the master_categories_id Usually this is correct, but not always.


master_categories_id

The master category of the product. Discounts and specials are calculated based on this id.
Type: int(11)
Null: No
Default: 0
Info.png Information!
This category must also be added for this product in the products_to_categories table. Get this ID from the categories or the categories_description tables.


products_mixed_discount_quantity

Can the same product with different attributes be combined to qualify for quantity discounts? Can be set to 0 (no) or 1 (yes).
Type: tinyint(1)
Null: No
Default: 1


metatags_title_status

Is the title meta tag enabled? Can be set to 0 (no) or 1 (yes).
Type: tinyint(1)
Null: No
Default: 0


metatags_products_name_status

Is the products name in the title meta tag enabled? Can be set to 0 (no) or 1 (yes).
Type: tinyint(1)
Null: No
Default: 0


metatags_model_status

Is the model in the title meta tag enabled? Can be set to 0 (no) or 1 (yes).
Type: tinyint(1)
Null: No
Default: 0


metatags_price_status

Is the price in the title meta tag enabled? Can be set to 0 (no) or 1 (yes).
Type: tinyint(1)
Null: No
Default: 0


metatags_title_tagline_status

Is the tagline in the title meta tag enabled? Can be set to 0 (no) or 1 (yes).
Type: tinyint(1)
Null: No
Default: 0


Default Entries (assuming demo data installed)

TODO!