Where do I find the product class in osCommerce? I would like to modify the product class to suit my needs.
I checked the classes folder at includes/classes and found the shipping class, shopping cart class, etc. but couldn’t find the product class.
These are the variables I would like to modify in the product class.
$products_price
$product_info['products_image']
$products_options
$products_options_name
$product_info
All these variables are used in pages that display products like oscommerce/product_info.php, oscommerce/product_review.php etc.
There’s no Product class in osccomerce.
in
product_info.phpall the variables are setted by a query in theproduct_info.php(line 75 more or less):If you need to add something to a product, just add it to the
productstable in mysql and modify all the php is oscommerce where you want to use it.For example: You need to add an ISBN field to all your products because you have an online library and you need it.
1.- Edit your products table to add the new field:
2.- Go to all pages in catalog that shows products and you want to show the new field and edit the products sql
(just before the from I have add p.products_isbn)
And now you have
$products_info["products_isbn"]accessible to use it.3.- if you want to add the fields into the products lists (categories view, search results, specials, upcoming products, newest products,…) you have to add it into the product listing
catalog/includes/modules/product_listing.php(the most easy way to do it is track the products_name fromcatalog/index.phpan dupe for the new field)4.- if you want to show in a box (like “other clients also buy” or the right or left columns) you have to go to
catalog/include/boxes/and add it too.5.- if you want to edit the new field in administration you have to edit
catalog/admin/categories.phpand add the new ( the easy way here is to trackproducts_modeland dupe for your new field)I’m sure I’m leaving more changes, because these are the minimal changes for showing the new field, if the new field has any functionality like discounts you have to edit the order class, the checkout process,….
Yes, it’s a mess