Results 1 to 10 of 10
  1. #1
    Join Date
    Jun 2009
    Posts
    86
    Plugin Contributions
    0

    Default Add a new product type in 1.5, or not...

    I have a need to add products that have many fields, attributes are not the answer because the customer will not be able to choose, just a ton of new fields.
    I have searched and searched for a way to add a new product type, however everything I have found in posts are pre 1.5. and not working as intended.

    So my question is what is the best way to add a new product type in 1.5, is it worth it, is there a better alternative.
    Thanks in advance
    Jeff

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Add a new product type in 1.5, or not...

    The product-type concepts are the same in v1.5

    What EXACTLY do you mean by "not working as intended"? That's a rather vague explanation of your problem ;)
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Jun 2009
    Posts
    86
    Plugin Contributions
    0

    Default Re: Add a new product type in 1.5, or not...

    Sorry, I meant to tell you lol,
    here goes, I used the product_music as the template and copied every file i could find and renamed product_forklift following this post.
    http://www.zen-cart.com/showthread.p...l-Product-Type

    ./admin/product_music.php
    ./admin/includes/languages/english/product_music.php
    ./admin/includes/languages/english/extra_definitions/product_music.php
    ./admin/includes/boxes/extra_boxes/product_music_extras_dhtml.php
    ./admin/includes/modules/product_music
    ./admin/includes/functions/extra_functions/product_music_functions.php
    ./includes/languages/english/product_music_info.php
    ./includes/languages/english/extra_definitions/product_music.php
    ./includes/modules/pages/product_music_info
    ./includes/templates/template_default/templates/tpl_product_music_info_display.php
    ./includes/templates/custom_template/templates/tpl_product_music_info_display.php

    frontend loads ok, however backend gives me a blank page.

    I have traced it to forklift_type_database_names.php, which I edited after the initial 500 error crashes to this:
    define('TABLE_FORKLIFT', DB_PREFIX . 'forklift')

    if i rename the file, the backend comes up ok.
    I am in the process of revamping the collect_info.php the match field names for the new product, not sure if this may solve the blank page issue, 49 fields is a lot lol.

    even though the a post talks a lot about it, i'm still a little confused on how it will work, i found an old article that explained product types in detail, while it was written for an older version, it wasn't too helpful, i think you posted it with the article above.

    My vision is to have a product named forklift, with many many (49) fields, i need to be able to save ALL of the fields at one time and associated with a particular forklift.

  4. #4
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Add a new product type in 1.5, or not...

    Is your define() statement missing a closing semicolon?
    What's the actual PHP error message?
    Quote Originally Posted by jeffiec View Post
    backend gives me a blank page.
    http://www.zen-cart.com/content.php?124-blank-page
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Jun 2009
    Posts
    86
    Plugin Contributions
    0

    Default Re: Add a new product type in 1.5, or not...

    if (!defined('IS_ADMIN_FLAG')) {
    die('Illegal Access');
    }
    define('TABLE_FORKLIFT', DB_PREFIX . 'forklift');

    no errors, just the white page, renaming the file seems to at least get the page back.

    And wouldn't you know, I cleaned the white spaces after the end php tag and it comes up lol. Prolly shoulda done that before I posted.

    I will let you know how the rest goes, I have the tedious job of going through all the files in the product_forklift folder to make the logic work.

    Your aide is invaluable, no amount of money could ever repay the knowledge that you share with us, I am glad to be of acquaintance

    PS. You were kind of giving me direction on another post http://www.zen-cart.com/showthread.p...36#post1186536, where should i put the business logic? is there a tutorial or post i can reference?

  6. #6
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Add a new product type in 1.5, or not...

    Quote Originally Posted by jeffiec View Post
    And wouldn't you know, I cleaned the white spaces after the end php tag and it comes up lol. Prolly shoulda done that before I posted.
    Lol ... I know how that goes.
    In fact, why not just remove the ending PHP tag. Explained here: http://www.zen-cart.com/content.php?...nd-of-the-file
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  7. #7
    Join Date
    Jun 2009
    Posts
    86
    Plugin Contributions
    0

    Default Re: Add a new product type in 1.5, or not...

    Ok, first problem:
    File:admin/includes/modules/product_forklift/update_product.php

    PHP Code:
    //// INSERT PRODUCT-TYPE-SPECIFIC *INSERTS* HERE //////

          
    $tmp_value zen_db_prepare_input($_POST['forklift_id']);

          
    $forklift_id = (!zen_not_null($tmp_value) || $tmp_value=='' || $tmp_value == 0) ? $tmp_value;

          
    $sql_data_array = array('forklift_id' => (int)$products_id,
                                  
    'forklift_make' => zen_db_prepare_input($_POST['forklift_make'][$language_id]), 
                                  
    'forklift_model' => zen_db_prepare_input($_POST['forklift_model'][$language_id]), 
                                  
    'forklift_cpac' => zen_db_prepare_input($_POST['forklift_cpac'][$language_id]),
                                  
    'forklift_mast' => zen_db_prepare_input($_POST['forklift_mast'][$language_id]),
                                  
    'forklift_mast_type' => zen_db_prepare_input($_POST['products_name'][$language_id]),
                                  
    'forklift_attach' => zen_db_prepare_input($_POST['forklift_attach'][$language_id]),
                                  
    'forklift_trans' => zen_db_prepare_input($_POST['forklift_trans'][$language_id]),
                                  
    'forklift_fuel' => zen_db_prepare_input($_POST['forklift_fuel'][$language_id]),
                                  
    'forklift_tires' => zen_db_prepare_input($_POST['forklift_tires'][$language_id]),
                                  
    'forklift_stock' => zen_db_prepare_input($_POST['forklift_stock'][$language_id]),
                                  
    'forklift_year' => zen_db_prepare_input($_POST['forklift_year'][$language_id]),
                                  
    'forklift_po' => zen_db_prepare_input($_POST['forklift_po'][$language_id]), 
                                  
    'forklift_tnailfile' => zen_db_prepare_input($_POST['forklift_tnailfile'][$language_id]),
                                  
    'forklift_tnailpic2' => zen_db_prepare_input($_POST['forklift_tnailpic2'][$language_id]),
                                  
    'forklift_tnailpic3' => zen_db_prepare_input($_POST['forklift_tnailpic3'][$language_id]),
                                  
    'forklift_tnailpic4' => zen_db_prepare_input($_POST['forklift_tnailpic4'][$language_id]),
                                  
    'forklift_tnailpic5' => zen_db_prepare_input($_POST['forklift_tnailpic5'][$language_id]),
                                  
    'forklift_tnailpic6' => zen_db_prepare_input($_POST['forklift_tnailpic6'][$language_id]),
                                  
    'forklift_tnailpic7' => zen_db_prepare_input($_POST['forklift_tnailpic7'][$language_id]),
                                  
    'forklift_tnailpic8' => zen_db_prepare_input($_POST['forklift_tnailpic8'][$language_id]),
                                  
    'forklift_offer' => zen_db_prepare_input($_POST['forklift_offer'][$language_id]),
                                  
    'forklift_leng_fork_face' => zen_db_prepare_input($_POST['forklift_leng_fork_face'][$language_id]),
                                  
    'forklift_overall_width' => zen_db_prepare_input($_POST['forklift_overall_width'][$language_id]),
                                  
    'forklift_height' => zen_db_prepare_input($_POST['forklift_height'][$language_id]),
                                  
    'forklift_wheelbase' => zen_db_prepare_input($_POST['forklift_wheelbase'][$language_id]),
                                  
    'forklift_ground_clear' => zen_db_prepare_input($_POST['forklift_ground_clear'][$language_id]),
                                  
    'forklift_height_top_gaurd' => zen_db_prepare_input($_POST['forklift_height_top_gaurd'][$language_id]),
                                  
    'forklift_max_fork_height' => zen_db_prepare_input($_POST['forklift_max_fork_height'][$language_id]),
                                  
    'forklift_mast_tip_forward' => zen_db_prepare_input($_POST['forklift_mast_tip_forward'][$language_id]),
                                  
    'forklift_mast_tip_year' => zen_db_prepare_input($_POST['forklift_mast_tip_year'][$language_id]),
                                  
    'forklift_emake' => zen_db_prepare_input($_POST['forklift_emake'][$language_id]),
                                  
    'forklift_emodel' => zen_db_prepare_input($_POST['forklift_emodel'][$language_id]),
                                  
    'forklift_power' => zen_db_prepare_input($_POST['forklift_power'][$language_id]),
                                  
    'forklift_torque' => zen_db_prepare_input($_POST['forklift_torque'][$language_id]),
                                  
    'forklift_power_measured' => zen_db_prepare_input($_POST['forklift_power_measured'][$language_id]),
                                  
    'forklift_op_weight' => zen_db_prepare_input($_POST['forklift_op_weight'][$language_id]),
                                  
    'forklift_num_f_tires' => zen_db_prepare_input($_POST['forklift_num_f_tires'][$language_id]),
                                  
    'forklift_num_r_tires' => zen_db_prepare_input($_POST['forklift_num_r_tires'][$language_id]),
                                  
    'forklift_max_speed' => zen_db_prepare_input($_POST['forklift_max_speed'][$language_id]),
                                  
    'forklift_turn_rad' => zen_db_prepare_input($_POST['forklift_turn_rad'][$language_id]),
                                  
    'forklift_load_center' => zen_db_prepare_input($_POST['forklift_load_center'][$language_id]),
                                  
    'forklift_m_fork_speed' => zen_db_prepare_input($_POST['forklift_m_fork_speed'][$language_id]),
                                  
    'forklift_lift_speed' => zen_db_prepare_input($_POST['forklift_lift_speed'][$language_id]),
                                  
    'forklift_lower_speed' => zen_db_prepare_input($_POST['forklift_lower_speed'][$language_id]),
                                  
    'forklift_r_angle_stack' => zen_db_prepare_input($_POST['forklift_r_angle_stack'][$language_id])) ;



          
    zen_db_perform(TABLE_FORKLIFT$sql_data_array);



          
    ////    *END OF PRODUCT-TYPE-SPECIFIC INSERTS* //////// 
    After clicking Preview, then Insert, I get this error,
    WARNING: An Error occurred, please refresh the page and try again.
    Thinking either I cant use the product_id in this:
    'forklift_id' => (int)$products_id,
    or this tag is malformed by the [$language_id] tag:
    'forklift_make' => zen_db_prepare_input($_POST['forklift_make'][$language_id]),

    Just not too sure what ties the extra data to a particular product.

    Jeff

  8. #8
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Add a new product type in 1.5, or not...

    Quote Originally Posted by jeffiec View Post
    After clicking Preview, then Insert, I get this error,
    WARNING: An Error occurred, please refresh the page and try again.
    You'll need to find the exact error. See: http://www.zen-cart.com/content.php?...-and-try-again
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  9. #9
    Join Date
    Jun 2009
    Posts
    86
    Plugin Contributions
    0

    Default Re: Add a new product type in 1.5, or not...

    Bah!!!
    After several misspelling errors, both in the arrays and in the table, it is working!
    I knew the logs were somewhere, i just couldnt find them lol.

    Just to clarify though, the preview file is going to have to be adjusted too huh?

    Thanks again

  10. #10
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Add a new product type in 1.5, or not...

    Quote Originally Posted by jeffiec View Post
    Just to clarify though, the preview file is going to have to be adjusted too huh?
    A definite maybe, depending on what all you've added to your custom product type.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 

Similar Threads

  1. Add a new Product Type?
    By Cindy2010 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 6 May 2010, 11:07 PM
  2. add new product type help please
    By mpjbay in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 27 Jun 2009, 01:13 AM
  3. Can I add new product type filter to New Products drop down sort?
    By rwoody in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 17 Dec 2008, 08:42 PM
  4. Error can not add product wrong product type
    By cshart in forum General Questions
    Replies: 14
    Last Post: 8 Oct 2006, 08:20 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR