Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2008
    Posts
    3
    Plugin Contributions
    2

    Default 1.3.8 to 1.5.1 -- extra manufacturing fields and category fields not saving...

    We are updating a heavily modified version of zencart 1.3.8 to 1.5.1. We have managed to get all the modules and plugins working again, with the exception of a few extra fields in the manufacturers_info table and categories_description table...

    We have edited the following of the 1.5.1 manufacturers page:

    PHP Code:
    $manufacturers_url_array $_POST['manufacturers_url'];
              
    $language_id $languages[$i]['id'];
              
    $sql_data_array = array('manufacturers_url' => zen_db_prepare_input($manufacturers_url_array),
                                          
    'manufacturers_description'    =>    zen_db_prepare_input($_POST['manufacturers_description']),
                                          
    'manufacturers_products_description'    =>    zen_db_prepare_input($_POST['manufacturers_products_description'])
                                        );
              if (
    $action == 'insert') {
               
    $insert_sql_data = array('manufacturers_id' => $manufacturers_id,
                                         
    'languages_id' => $language_id);
                
    $sql_data_array array_merge($sql_data_array$insert_sql_data);
                
    zen_db_perform(TABLE_MANUFACTURERS_INFO$sql_data_array);
              } elseif (
    $action == 'save') {
                
    zen_db_perform(TABLE_MANUFACTURERS_INFO$sql_data_array'update'"manufacturers_id = '" . (int)$manufacturers_id "' and languages_id = '" . (int)$language_id "'");
              } 
    The original fields are saving correctly, and the data from the DB is being put into the new field text area's correctly, but we cannot change the new fields at all. We have changed a few area's to get this working, so if you need another snippet of code let me know. The information is being passed from the form via POST correctly (with the above var names etc)

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

    Default Re: 1.3.8 to 1.5.1 -- extra manufacturing fields and category fields not saving...

    The code snippet you posted is originally inside a loop for multiple languages, but you didn't include the loop part in your snippet.

    In the case of languages, there are sub-elements added for each language, even if you've only got 1 language on the site.

    So, you're missing some code:
    Code:
              $sql_data_array = array('manufacturers_url' => zen_db_prepare_input($manufacturers_url_array[$language_id]));
    And, your subsequent custom fields have no [$language_id] element selected either, thus suggesting that you might be hacking out multiple-language support in some but not all places. ie ... you're probably also not accommodating that properly later in the file where it loops thru languages to output the input fields.
    .

    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. Extra Fields oin category listing page?
    By stsung in forum Setting Up Categories, Products, Attributes
    Replies: 19
    Last Post: 4 Oct 2011, 09:58 PM
  2. Create Account - modify existing fields or add extra fields?
    By sopretty in forum General Questions
    Replies: 4
    Last Post: 30 Jul 2010, 08:26 PM
  3. Extra fields not sortable???
    By janekbar5 in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 1 Mar 2008, 11:44 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