Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2007
    Location
    Cambridge, MA
    Posts
    59
    Plugin Contributions
    0

    Default Problems adding new Product Detail field

    Hi All-

    I've successfully added a new field ("Record Producer") to the PRODUCTS_MUSIC_EXTRA table in the database (it's generally non-repeating information so I have not created an addition separate table for this info).

    I've successfully added a blank text field to the Product Admin page, and I can see that the new data is indeed being added to the database correctly from the Admin product page.

    I also tried to add to the correct fields in the PRODUCT_TYPE_LAYOUT table, so that the "Record Producer" would appear as an Admin option. So far, I cannot get it to appear however.

    (I used the following SQL command:)
    Code:
    INSERT INTO zen_product_type_layout (configuration_title, configuration_key, configuration_value, configuration_description, product_type_id, sort_order, set_function, date_added) VALUES ('Show Music Producer', 'SHOW_PRODUCT_MUSIC_INFO_PRODUCER', '1', 'Display Music Producer on Product Info 0= off 1= on', '7', '4', 'zen_cfg_select_drop_down(array(array(\'id\'=>\'1\', \'text\'=>\'True\'), array(\'id\'=>\'0\', \'text\'=>\'False\')), ', now());
    I also cannot get the data to appear in the Product Detail list on [my template] / tpl_product_music_info_display.php.

    Should I assume that the reason I'm not able to is that the Record Producer option is not appearing in the Product Layout Admin page? Or have I screwed up my code in tpl_product_music_info_display.php?

    (That code is:)

    Code:
    <!--bof Product details list  -->
    <?php if ( (
    		($flag_show_product_info_model == 1 and $products_model != '') 
    	or ($flag_show_product_info_weight == 1 and $products_weight !=0) 
    	or ($flag_show_product_info_quantity == 1) 
    	or ($flag_show_product_info_manufacturer == 1 and !empty($manufacturers_name)) 
    	or ($flag_show_product_music_info_artist == 1)
    	or ($flag_show_product_music_info_record_company == 1)
    	or ($flag_show_product_music_info_producer == 1)
    	) ) { ?>
    
    <ul id="productDetailsList" class="floatingBox back">
      <?php echo (($flag_show_product_info_model == 1 and $products_model !='') ? '<li>' . '<span class="aa">' . TEXT_PRODUCT_MODEL . '</span>' . $products_model . '</li>' . "\n" : ''); ?>
      <?php echo (($flag_show_product_info_weight == 1 and $products_weight !=0) ? '<li>' . '<span class="aa">' . TEXT_PRODUCT_WEIGHT .  '</span>' . $products_weight . TEXT_PRODUCT_WEIGHT_UNIT . '</li>' . "\n" : ''); ?>
      <?php echo (($flag_show_product_info_quantity == 1) ? '<li>' . '<span class="aa">' . $products_quantity . '</span>' . TEXT_PRODUCT_QUANTITY . '</li>'  : '') . "\n"; ?>
      <?php echo (($flag_show_product_info_manufacturer == 1 and !empty($manufacturers_name)) ? '<li>' . '<span class="aa">' . TEXT_PRODUCT_MANUFACTURER . '</span>' . $manufacturers_name . '</li>' . "\n" : ''); ?>
      <?php echo (($flag_show_product_music_info_artist == 1 and !empty($products_artist_name)) ? '<li>' . '<span class="aa">' . TEXT_PRODUCT_ARTIST . '</span>' . $products_artist_name . '</li>' . "\n" : ''); ?>
      <?php echo (($flag_show_product_music_info_genre == 1 and !empty($products_music_genre_name)) ? '<li>' . '<span class="aa">' . TEXT_PRODUCT_MUSIC_GENRE . '</span>' . $products_music_genre_name . '</li>' . "\n" : ''); ?>
      <?php echo (($flag_show_product_music_info_record_company == 1 and !empty($products_record_company_name)) ? '<li>' . '<span class="aa">' . TEXT_PRODUCT_RECORD_COMPANY . '</span>' . $products_record_company_name . '</li>' . "\n" : ''); ?>
      <?php echo (($flag_show_product_music_info_producer == 1 and !empty($products_producer_name)) ? '<li>' . '<span class="aa">' . TEXT_PRODUCT_PRODUCER . '</span>' . $products_producer_name . '</li>' . "\n" : ''); ?>
    </ul>
    <?php
      }
    ?>
    <!--eof Product details list -->
    Thanks in advance for your help!

    http://www.zen-cart.com/forum/images/smilies/huh.gif

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Problems adding new Product Detail field

    Did you build in the file:
    /includes/modules/pages/product_music_info/main_template_var.php

    PHP Code:
      $flag_show_product_music_info_producer zen_get_show_product_switch($_GET['products_id'], 'record_producer'); 
    Note: make sure you did not really call your field RECORD PRODUCER

    It needs to be lowercase without spaces ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Mar 2007
    Location
    Cambridge, MA
    Posts
    59
    Plugin Contributions
    0

    Default Re: Problems adding new Product Detail field

    I had changed /includes/modules/pages/product_music_info/main_template_var.php, yes. (And /includes/modules/pages/product_music_info/main_template_vars_product_type.php as well)

    (The field name is simply producer)

 

 

Similar Threads

  1. New Custom detail field needs to req'd
    By kiwi1066 in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 17 Mar 2009, 11:04 PM
  2. Adding a new field to a product
    By David Bo in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 19 Feb 2007, 06:23 PM

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