总和上次的ZEN-CART添加一个新字段,这次根据新添加的字段,为一件商品添加两外两种价钱,如:英文和日文。添加好了以后,在 index.php页面添加这样一个字段“$_SESSION[price_language]=’语言标识’;”在需要判断的地方修改SQL语句
$products_query = “select p.products_id, p.master_categories_id, p.products_status, pd.products_name, p.products_model, p.products_image,
p.products_price”.$_SESSION['price_language'].”, p.products_weight, p.products_tax_class_id,
p.products_quantity_order_min, p.products_quantity_order_units,
p.product_is_free, p.products_priced_by_attribute,
p.products_discount_type, p.products_discount_type_from
from ” . TABLE_PRODUCTS . ” p, ” . TABLE_PRODUCTS_DESCRIPTION . ” pd
where p.products_id = ‘” . (int)$products_id . “‘
and pd.products_id = p.products_id
and pd.language_id = ‘” . (int)$_SESSION['languages_id'] . “‘”;
if ($products = $db->Execute($products_query)) {
$prid = $products->fields['products_id'];
$products_price = $products->fields['products_price'.$_SESSION['price_language']];
主要是修改p.products_price”.$_SESSION['price_language'].”,然后将这个字段输出。OK了!