
Originally Posted by
abcisme
I'm having this exact same problem, but with French. When adding a product to an order, some of the products are showing in English and some are in French. My default admin language is English. Is there any way to force Edit Orders to use the English language only?
Not sure if this is the correct code to modify, but can it be modified to somehow specify to select only products with a specific language_id?
PHP Code:
// ############################################################################
// Get List of All Products
// ############################################################################
//$result = zen_db_query("SELECT products_name, p.products_id, x.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 LEFT JOIN " . TABLE_CATEGORIES_DESCRIPTION . " x ON x.categories_id=ptc.categories_id ORDER BY categories_id");
$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");
#hile($row = zen_db_fetch_array($result)) {
while (!$result -> EOF){
extract($result->fields,EXTR_PREFIX_ALL,"db");
$ProductList[$db_categories_id][$db_products_id] = $db_products_name;
$CategoryList[$db_categories_id] = $db_categories_name;
$LastCategory = $db_categories_name;
$result -> MoveNext();
}
// ksort($ProductList);
$LastOptionTag = "";
$ProductSelectOptions = "<option value='0'>Don't Add New Product" . $LastOptionTag . "\n";
$ProductSelectOptions .= "<option value='0'> " . $LastOptionTag . "\n";
foreach($ProductList as $Category => $Products)
{
$ProductSelectOptions .= "<option value='0'>$Category" . $LastOptionTag . "\n";
$ProductSelectOptions .= "<option value='0'>---------------------------" . $LastOptionTag . "\n";
asort($Products);
foreach($Products as $Product_ID => $Product_Name)
{
$ProductSelectOptions .= "<option value='$Product_ID'> $Product_Name" . $LastOptionTag . "\n";
}
if($Category != $LastCategory)
{
$ProductSelectOptions .= "<option value='0'> " . $LastOptionTag . "\n";
$ProductSelectOptions .= "<option value='0'> " . $LastOptionTag . "\n";
}
}
// ############################################################################
// Add Products Steps
// ############################################################################
Bookmarks