Problem: Lookup of fields in products or products_description by products_id in the Admin
Solution: change the function file:
/admin/includes/functions/general.php
from approximately lines 3120 to 3138 where it reads:
To read:Code://// // return any field from products or products_description table // Example: zen_products_lookup('3', 'products_date_added'); // function zen_products_lookup($product_id, $what_field = 'products_name', $language = $_SESSION['languages_id']) { function zen_products_lookup($product_id, $what_field = 'products_name', $language = '') { global $db; if (empty($language)) $language = $_SESSION['languages_id']; $product_lookup = $db->Execute("select " . $what_field . " as lookup_field from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id ='" . $product_id . "' and pd.language_id = '" . $language . "'"); $return_field = $product_lookup->fields['lookup_field']; return $return_field; }
Thanks for catching the forgotten update, torvista ...Code://// // return any field from products or products_description table // Example: zen_products_lookup('3', 'products_date_added'); // function zen_products_lookup($product_id, $what_field = 'products_name', $language = $_SESSION['languages_id']) { function zen_products_lookup($product_id, $what_field = 'products_name', $language = '') { global $db; if (empty($language)) $language = $_SESSION['languages_id']; $product_lookup = $db->Execute("select " . $what_field . " as lookup_field from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id ='" . $product_id . "' and pd.products_id = p.products_id and pd.language_id = '" . $language . "'"); $return_field = $product_lookup->fields['lookup_field']; return $return_field; }






Bookmarks