Just tested and this does work. I knew there was a better way of doing it, but with limited knowledge, I did the best I could! Thanks for sorting it out properly! :)
If the code above works (and I haven't tested it to know if it resolved the issues it was supposed to resolve) I believe that the code below is the better way of going about this.. I haven't tested this and I'll need someone to grade my homework and let me know if I got this right.. It should avoid anyone having to hard code in table names and language IDs. (which the posted code does and is not recommended) I've included the approximate line numbers to make finding things easier..
in YOUR_ADMIN_FOLDER/edit_orders.php
Around line 2267 find:
Replace with:PHP Code:
// ############################################################################
// Get List of All Products
// ############################################################################
$result = $db -> Execute("SELECT products_name, p.products_id, categories_name, ptc.categories_id FROM " . TABLE_PRODUCTS . " p LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd ON pd.products_id=p.products_id LEFT JOIN " . TABLE_PRODUCTS_TO_CATEGORIES . " ptc ON ptc.products_id=p.products_id LEFT JOIN " . TABLE_CATEGORIES_DESCRIPTION . " cd ON cd.categories_id=ptc.categories_id ORDER BY categories_name");
Around line 2371 find:PHP Code:
// ############################################################################
// Get List of All Products
// ############################################################################
$result = $db -> Execute("SELECT products_name, p.products_id, categories_name, ptc.categories_id FROM " . TABLE_PRODUCTS . " p LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd ON pd.products_id=p.products_id LEFT JOIN " . TABLE_PRODUCTS_TO_CATEGORIES . " ptc ON ptc.products_id=p.products_id LEFT JOIN " . TABLE_CATEGORIES_DESCRIPTION . " cd ON cd.categories_id=ptc.categories_id where pd.language_id = '" . (int)$_SESSION['languages_id'] . "' ORDER BY categories_name");
Replace with:PHP Code:
// Get Options for Products
$result = $db -> Execute("SELECT * FROM " . TABLE_PRODUCTS_ATTRIBUTES . " pa LEFT JOIN " . TABLE_PRODUCTS_OPTIONS . " po ON po.products_options_id=pa.options_id LEFT JOIN " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov ON pov.products_options_values_id=pa.options_values_id WHERE products_id='$add_product_products_id'");
PHP Code:
// Get Options for Products
$result = $db -> Execute("SELECT * FROM " . TABLE_PRODUCTS_ATTRIBUTES . " pa LEFT JOIN " . TABLE_PRODUCTS_OPTIONS . " po ON po.products_options_id=pa.options_id LEFT JOIN " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov ON pov.products_options_values_id=pa.options_values_id WHERE products_id='$add_product_products_id' AND pov.language_id = '" . (int)$_SESSION['languages_id'] . "' AND po.language_id = '" . (int)$_SESSION['languages_id'] . "'");
Bookmarks