Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2004
    Location
    Deal, Kent, UK
    Posts
    332
    Plugin Contributions
    0

    Default Add time to a product type

    Hi

    I'm trying to add a time field to a product type. I've got as far as the field showing up on the input field and displaying H:M:S correctly if I add it to the product in phpmyadmin but when I try and update via the admin input screen then it doesn't work (it justs inserts a single digit in the seconds) so I'm guessing that in includes/modules/product_xxx/update_product.php I don't have the right code. Can anyone point me in the right direction please.

    Thanks...

  2. #2
    Join Date
    Nov 2004
    Location
    Deal, Kent, UK
    Posts
    332
    Plugin Contributions
    0

    Default Re: Add time to a product type

    Sorry - supplied information was a bit sketchy!

    New field called products_time is added to products_description table.

    In admin/includes/modules/product_xxx/product_update.php I have:

    Code:
    $sql_data_array = array('products_name' => zen_db_prepare_input($_POST['products_name'][$language_id]),
                                  'products_description' => zen_db_prepare_input($_POST['products_description'][$language_id]),
                              'products_time' => zen_db_prepare_input($_POST['products_time'][$language_id]),
                                  'products_url' => zen_db_prepare_input($_POST['products_url'][$language_id]));
    
          if ($action == 'insert_product') {
            $insert_sql_data = array('products_id' => $products_id,
                                     'language_id' => $language_id);
    
            $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
    
            zen_db_perform(TABLE_PRODUCTS_DESCRIPTION, $sql_data_array);
          } elseif ($action == 'update_product') {
            zen_db_perform(TABLE_PRODUCTS_DESCRIPTION, $sql_data_array, 'update', "products_id = '" . (int)$products_id . "' and language_id = '" . (int)$language_id . "'");
          }
        }
    
        // add meta tags
    I assume this is incorrect and / or in the wrong place. Help gratefully received!

 

 

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. Auction Product Type: Can't add a product of the type.
    By sw0rdz in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 5 Sep 2009, 02:11 AM
  3. add product type or just add a field to existing
    By Minnie Mouse in forum Setting Up Categories, Products, Attributes
    Replies: 6
    Last Post: 1 Sep 2008, 05:01 PM
  4. Add a Product Type
    By pasher in forum General Questions
    Replies: 2
    Last Post: 27 Jun 2007, 09:37 PM
  5. 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