alexcn Posted July 27, 2009 Share Posted July 27, 2009 (edited) I am wondering if I have missed something in updating the categories.php file as the configuration for the extra fields appear, you can see the values in the product info page, and when you enter values they appear in the product preview display: however the values dont appear to have been stored in the database (product extra fields table is empty) and consequently they dont appear in the catalog view. Does anyone have any experience on this? trying to work out whether the update section of the categories.php file doesnt file. Thanks everyone :) Edited July 27, 2009 by alexcn Quote Link to comment Share on other sites More sharing options...
alexcn Posted July 27, 2009 Author Share Posted July 27, 2009 Have edited the database.php function to write all of the SQL queries to a file and found that the UPDATE extra fields query doesnt even run, therefore I am guessing some kind of form flag has not been set. Quote Link to comment Share on other sites More sharing options...
alexcn Posted July 27, 2009 Author Share Posted July 27, 2009 Ah ha, careless mistake, I added the following code after the tep_db_perform(TABLE_CATEGORIES_DESCRIPTION section instead of after the tep_db_perform(TABLE_PRODUCTS_DESCRIPTION section: // START: Extra Fields Contribution $extra_fields_query = tep_db_query("SELECT * FROM " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " WHERE products_id = " . (int)$products_id); while ($products_extra_fields = tep_db_fetch_array($extra_fields_query)) { $extra_product_entry[$products_extra_fields['products_extra_fields_id']] = $products_extra_fields['products_extra_fields_value']; } if ($HTTP_POST_VARS['extra_field']) { // Check to see if there are any need to update extra fields. foreach ($HTTP_POST_VARS['extra_field'] as $key=>$val) { if (isset($extra_product_entry[$key])) { // an entry exists if ($val == '') tep_db_query("DELETE FROM " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " where products_id = " . (int)$products_id . " AND products_extra_fields_id = " . (int)$key); else tep_db_query("UPDATE " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " SET products_extra_fields_value = '" . tep_db_input($val) . "' WHERE products_id = " . (int)$products_id . " AND products_extra_fields_id = " . (int)$key); } else { // an entry does not exist if ($val != '') tep_db_query("INSERT INTO " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " (products_id, products_extra_fields_id, products_extra_fields_value) VALUES ('" . (int)$products_id . "', '" . (int)$key . "', '" . tep_db_input($val) . "')"); } } } // END: Extra Fields Contribution Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.