Zen Cart Logo
Forums / General Questions / Clone Product Type

Clone Product Type

Locked

Views: 1,409

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
18 Jul 2007, 11:00 AM
#1
pasher avatar

pasher

New Zenner

Join Date:
Dec 2005
Posts:
64
Plugin Contributions:
0

Clone Product Type

I really need a ' Definitive/Idiots Guide to Cloning a Product Type'.
I've found and read everything here on the forums, and the wiki etc. and even raised threads before but had little useful response. The wiki was the most promising but that seems to have vital bits missing, or vague references of what needs to be done.
All I want to achieve is different layouts for different categories - ie. some categories, show the stock level, others don't show it etc.
All my products are currently 'General' - Type 1.
I'm happy and confident copying and editing files, and to edit/manipulate the database. I just need to know exactly which files and tables.
tia
Pa

18 Jul 2007, 2:48 PM
#2
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,627
Plugin Contributions:
0

Re: Clone Product Type

Did you have a look at the Book Type Product that is in the Downloads section? It has all the files and instructions you should need.

18 Jul 2007, 6:06 PM
#3
pasher avatar

pasher

New Zenner

Join Date:
Dec 2005
Posts:
64
Plugin Contributions:
0

Re: Clone Product Type

Kim:

Did you have a look at the Book Type Product that is in the Downloads section? It has all the files and instructions you should need.

Yes - instructions and files relevent to the book product type, none that seem relevent to want I want to do !!!

Tomorrow, I'll post exactly what I've done (I'm at home now), and what errors I'm getting.
Pa

19 Jul 2007, 8:45 AM
#4
pasher avatar

pasher

New Zenner

Join Date:
Dec 2005
Posts:
64
Plugin Contributions:
0

Re: Clone Product Type

OK - Here's what I've done in order to clone the 'Products - General' based on the document at http://www.zen-cart.com/wiki/index.php/Product_Types

  1. Added a row to the product_types table -
    (NULL, 'Product1', 'product1', '1', 'Y', , '0001-01-01 00:00:00', '0001-01-01 00:00:00'). This has the type_id = 6.

  2. In the product_type_layout table, I duplicated all the 'product_type_id = 1' rows (Products - General), changed all their product_type_id fields to 6, then changed all the instances of 'PRODUCT' in their configuration_key fields to 'PRODUCT1'.

  3. Copied the following files and folders (with contents) changing product to product1 in the file and folder names -
    /admin/product.php
    /includes/modules/pages/product_info/.
    /includes/languages/english/product_info.php
    /includes/languages/english/['my_template']/product_info.php
    /admin/includes/modules/product/.
    /includes/templates/template_default/templates/tpl_product_info_display.php
    /includes/templates/['my_template']/templates/tpl_product_info_display.php
    /admin/includes/languages/english/product.php

The new product_type appears in ACP->Catalok->Product Types OK, but when I 'Edit Layout->Edit, the following error appears, and there are no tick-boxes on the right in order to change the values.

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/quarncou/public_html/qeshoptest/qeshopmanager/product_types.php(248) : eval()'d code on line 1

Help/advise urgently required - this has been driving me nuts for days, if not weeks!!

Thanks
Pa

19 Jul 2007, 3:01 PM
#5
pasher avatar

pasher

New Zenner

Join Date:
Dec 2005
Posts:
64
Plugin Contributions:
0

Re: Clone Product Type

OK - Got this working now.
There was nothing wrong with the 'product1' files created etc. It was the way I added the extra rows to the product_type_layout table !!!
Whenever I have lots of edits to a db table to do, I export it as a delimited file (using | as the delimiter), bring it into excel, edit, save, then empty the table and import the delimited file back. This normally works fine, but in this instance, something must have been entered in the cells to cause the error, even though I couldn't see anything wrong.
Eventially, I exported the table as a SQL file, edited that to add the extra rows, then imported it back, and all was well.
Cheers
Pa

27 Jul 2007, 12:21 PM
#6
pasher avatar

pasher

New Zenner

Join Date:
Dec 2005
Posts:
64
Plugin Contributions:
0

Re: Clone Product Type

Just noticed an issue with this cloned Product Type.

When down to a product page for a product of the 'original' type, looking at the source, its <title> tag is as follows -

<title>UC-101 PCI 1 PORT RS232 + 1 PORT RS232 [UC101] - £76.50 : Quarndon Electronics</title>

which is good.

When down to a product page for a product of the 'cloned' type, looking at the source, its <title> tag is as follows -

<title>Quarndon Electronics</title>

which is not so good as it doesn't include the product name and price.

Any clues where to look to fix this?

tia
Pa