点击数:10902015-07-18 10:27:21 来源: 外贸网站建设,深圳外贸网站建设,深圳网站建设,外贸商城网站制作-亿恩科技
使用zen cart的easypopulate批量导入产品后碰到一个问题,就是导入的size选项顺序乱了套。有可能是因为导入的时候没有为size选项指定 order的值。但是即使指定order可以排序也很麻烦。如果能够按照导入时数据文件中的顺序为顺序就方便很多。也就是说直接按照size选项的ID来 排序。为了实现这个,需要对includes/modules/attributes.php进行修改
...
...
//change the $order_by variable
$order_by = ' order by pov.products_options_values_id';
while (!$products_options_names->EOF) {
$products_options_array = array();
/*
pa.options_values_price, pa.price_prefix,
pa.products_options_sort_order, pa.product_attribute_is_free,
pa.products_attributes_weight, pa.products_attributes_weight_prefix,
pa.attributes_default, pa.attributes_discounted, pa.attributes_image
*/
$sql = "select pov.products_options_values_id,
pov.products_options_values_name,
pa.*
from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov
where pa.products_id = '" . (int)$_GET['products_id'] . "'
and pa.options_id = '" . (int)$products_options_names->fields['products_options_id'] . "'
and pa.options_values_id = pov.products_options_values_id
and pov.language_id = '" . (int)$_SESSION['languages_id'] . "' " .
$order_by;
$products_options = $db->Execute($sql);