Adding New Product_types - error 404
hello
im trying to add a new product type to zen 1.3.9a
for now i only testing admin side and dident done nothing with catalog side.
the things i have done till now :
copy admin\includes\languages\english\product_music.php to admin\includes\languages\english\product_mobile.php
copy admin\includes\modules\product_music
to admin\includes\modules\product_mobile
Code:
INSERT INTO product_types (type_name, type_handler, type_master_type, allow_add_to_cart) VALUES
("Product - Mobile Phone", "product_mobile", 1, "y");
Code:
INSERT INTO `product_type_layout` (`configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `product_type_id`, `set_function`) VALUES
('Show Model Number', 'SHOW_PRODUCT_MOBILE_INFO_MODEL', '1', 'Display Model Number on Product Info 0= off 1= on', 6, 'zen_cfg_select_drop_down(array(array(''id''=>''1'', ''text''=>''True''), array(''id''=>''0'', ''text''=>''False'')), ');
when try to add new product to "product - mobile phone"
i get an error 404 Object not found! .
http://localhost/demo/admin/product_...on=new_product
can someone help me solve this ?
Re: Adding New Product_types
Did you make a file:
/admin/product_mobile.php
each Product Type has its own main file ...
Re: Adding New Product_types
@Ajeh
thank you man u the king :bigups:
Re: Adding New Product_types
all almost done but i have few problems in catalog side its not showing the information
in file \includes\templates\template_default\templates\tpl_product_mobile_info_display
the information will show only if i change this:
$flag_show_product_mobile_info_network == 1
to
$flag_show_product_mobile_info_network = 1
in table product_type_layout
i have the key:
('Show Mobile Network', 'SHOW_PRODUCT_MOBILE_INFO_NETWORK', '1', 'Display Mobile Network on Product Info 0= off 1= on', 6, 6, NULL, '0000-00-00 00:00:00', NULL, 'zen_cfg_select_drop_down(array(array(''id''=>''1'',''text''=>''True''),array('' id''=>''0'',''text''=>''False''))')
my guess the problem is in file:
includes\modules\pages\product_mobile_info\main_template_vars
$$flag_show_product_mobile_info_network = zen_get_show_product_switch($_GET['products_id'], 'mobile_network');
where the mobile_network is it should be same as one of the define files or some other file or var or something?
can someone help me figure it up?
Re: Adding New Product_types
ok i answer myself
i got one extra $ in
$$flag_show_product_mobile_info_network
and yes the mobile_network is the var from :
main_template_vars_product_type
Product Type Info Page Layout options
when im trying to to edit the Product Type Info Page Layout options
for the mobile - product type i cant edit the options there is no dropdown box
and i get error in myDEBUG-adm
[18-May-2010 11:12:15] PHP Parse error: parse error in C:\xampp\htdocs\demo\admin\product_types.php(248) : eval()'d code on line 1
[18-May-2010 11:12:15] PHP Stack trace:
[18-May-2010 11:12:15] PHP 1. {main}() C:\xampp\htdocs\demo\admin\product_types.php:0
when trying to edit the music product type there is no error
any idea whats wrong ?
Re: Adding New Product_types
Unfortunately there's nowhere near enough information in these error messages to be able to debug your code.
A wild guess would be that you haven't set the standard configuration values for your product type (look at the other product types to see what they are). But that's a complete shot in the dark.
Product types can be extremely complex and there's really no substitute for stepping interactively though each stage of the code checking that appropriate values that are being generated each time.
Re: Product Type Info Page Layout options
Quote:
Originally Posted by
davico
when im trying to to edit the Product Type Info Page Layout options
for the mobile - product type i cant edit the options there is no dropdown box
and i get error in myDEBUG-adm
Maybe something in your sql statement not right.... for product layout you need 11 tabs.... I only see 10. I'm guessing you know that the type_id well be 6.. not sure why your using NULL for one date and '0000-00-00 00:00:00' for the other.... wouldn't NULL, NULL work or now(), now()
Quote:
('Show Mobile Network', 'SHOW_PRODUCT_MOBILE_INFO_NETWORK', '1', 'Display Mobile Network on Product Info 0= off 1= on', 6, 6, NULL, '0000-00-00 00:00:00', NULL, 'zen_cfg_select_drop_down(array(array(''id''=>''1'',''text''=>''True''),array('' id''=>''0'',''text''=>''False''))')
This is how I would do it... assuming product_mobile is your product type...
Code:
SET @t4=0;
SELECT (@t4:=type_id) as t4
FROM product_types
WHERE type_handler= 'product_mobile';
INSERT INTO product_type_layout VALUES('', 'Show Mobile Network', 'SHOW_PRODUCT_MOBILE_INFO_NETWORK', '1', 'Display Mobile Network on Product Info 0= off 1= on', @t4, 6, now(), now(), NULL, 'zen_cfg_select_drop_down(array(array(''id''=>''1'', ''text''=>''True''), array(''id''=>''0'', ''text''=>''False''))');
Once you clean up the sql problem, then it's just a mater of using in admin\includes\modules\product_mobile\collect_info.php
Basically, if the sql statement is correct and no errors exist in MySQL database, the switch should work without cussing errors even if it's not called for anywhere else in your code.
Product type book was a big help to me working with product type auction
Re: Adding New Product_types
thanks for your replay
collect_info working fine i can add update and preview products
my problem is i think in file product_types.php when getting to action=layout_edit
[SCR]http://img401.imageshack.us/img401/165/productype.jpg[/SCR]
if ill click update it will change the value to 0
Re: Adding New Product_types
forget about the older post i just gave up and started doing this product type again from the begging i followed up the music type-->music genre and its working perfect.
but i need it to be with multi language support for the genre name.
every time i try to do its not working
can u please tell me what are the right lines for this.