Zen Cart Logo
Forums / Setting Up Categories, Products, Attributes / New Product Type -- The Easy Way

New Product Type -- The Easy Way

Locked

Views: 5,274

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
17 Aug 2006, 6:46 PM
#1
minnie_mouse avatar

minnie_mouse

Zen Follower

Join Date:
Jun 2005
Posts:
119
Plugin Contributions:
0

New Product Type -- The Easy Way

Simple way to add a new product type that is basically the same as the basic product type but just needed a few more information fields for your product. In this model you dont need to create new database tables. just add fields to existing products_description table. (i found this easier to do since i dont know MySQL.

Your are creating a new product_type called product_bodycare

figure out field names:
products_ingredients, products_skintype, for example.
add these to the database products_description table. copy how the field product_description is done.

  1. copy generic product file or product_music file to create these files:

./admin/product_bodycare.php
./admin/includes/languages/english/product_bodycare.php
./admin/includes/modules/product_bodycare
./admin/includes/functions/extra_functions/product_bodycare_functions.php
./includes/languages/english/product_bodycare_info.php
./includes/modules/pages/product_bodycare_info

./includes/templates/MYTEMPLATE/templates/tpl_product_bodycare_info_display.php (this page should be modified to show the new product info)

<! -- you may not need these

./admin/includes/languages/english/extra_definitions/product_bodycare.php
./admin/includes/boxes/extra_boxes/product_bodycare_extras_dhtml.php
./includes/languages/english/extra_definitions/product_bodycare.php
-->

  1. open all the files and search 'products_description'. add/copy into these files the new references to the new fields. ie if you see a variable declaration for $product_description. copy and create one for $products_ingredients, etc..

upload all changed files.

in the database enter this string int the SQL dialog.

INSERT INTO zen_product_types VALUES (7, 'Product - Bodycare', 'product_bodycare', '1', 'Y', '', now(), now());

change the zen_ prefix to zc_ or remove depending on your datatable prefixes. be careful of the default value of 7 according to the moku book product type. it worked fine for me.

(this inserts a new product type into the database. you can now select this product type when making a new product.)

i hope this is helpful. I wrote this up as notes to myself for the next time i need to do it. my thanks to pigdestroyer and moku for the thread about adding product types and the book type download.

16 May 2008, 3:13 PM
#2
dtolpin avatar

dtolpin

New Zenner

Join Date:
Aug 2007
Location:
Tavares, FL USA
Posts:
5
Plugin Contributions:
0

Re: New Product Type -- The Easy Way

I noticed no replies to this post. Is the information accurate? Are there any changes for version 1.3.8?

7 Jun 2008, 4:59 PM
#3
knighs2 avatar

knighs2

New Zenner

Join Date:
May 2007
Posts:
42
Plugin Contributions:
0

Re: New Product Type -- The Easy Way

I would also be interested in anyones comments if they have tried it. I will try it myself as soon as i get a chance.

3 Jul 2008, 6:29 PM
#4
lori avatar

lori

New Zenner

Join Date:
Jun 2008
Location:
Winnipeg Manitoba
Posts:
4
Plugin Contributions:
0

Re: New Product Type -- The Easy Way

It should work. I just created a new product type in a very similar fashion. The only difference was the entry into the PRODUCT_TYPES database table. I used the example in the Zen Cart Wiki article.
http://www.zen-cart.com/wiki/index.php/Product_Types
I had to change the blank value for "allow_add_to_cart" to '0' though.
Now that I have created it, the real fun begins.