Zencart 之lightinthebox模板,产品排序修改

此模板默认目录列表页的排序是按products_id,现在想改为按更新时间排。

感谢Radnows,感谢Jack,感谢MTV,CCTV ^_^ 问题圆满解决!
附完整步聚:

1.默认default:的 sql改为order by p.products_date_added DESC ,原来case5改为$product_sort = ” order by p.products_ordered DESC”; {文件地址:\includes\index_filters\default_filter.php}
2.修改product_listing.php的array(‘Bestselling’,'Item Name’,'Price(Low to high)’,'Price(High to low)’,'New Arrival’); 为
$nsort = array(‘New Arrival’,'Item Name’,'Price(Low to high)’,'Price(High to low)’,'Bestselling’); {文件地址:\includes\modules\product_listing.php}
3.改代码:{文件地址:\includes\index_filters\default_filter.php}
// We show them all
$listing_sql = “select ” . $select_column_list . ” p.products_id, p.products_type,p.products_status,p.products_price,p.products_price_retail,p.products_price_sample,p.product_is_wholesale,p.product_wholesale_min,p.products_quantity, p.products_quantity_order_min, p.master_categories_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, pd.products_description, IF(s.status = 1, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status =1, s.specials_new_products_price, p.products_price) as final_price, p.products_sort_order, p.product_is_call, p.product_is_always_free_shipping, p.products_qty_box_status
from ” . TABLE_PRODUCTS_DESCRIPTION . ” pd, ” .
TABLE_PRODUCTS . ” p left join ” . TABLE_MANUFACTURERS . ” m on p.manufacturers_id = m.manufacturers_id, ” .
TABLE_PRODUCTS_TO_CATEGORIES . ” p2c left join ” . TABLE_SPECIALS . ” s on p2c.products_id = s.products_id
where p.products_status = 1
and p.products_id = p2c.products_id
and pd.products_id = p2c.products_id
and pd.language_id = ‘” . (int)$_SESSION['languages_id'].”‘”. $displayOrder. $priceOrder.”
and ” . $product_in_categories_sql;
}
}
————————————–>
// We show them all

if ($_GET['productsort'] ==”) {
$sort = ‘ order by p.products_date_added DESC’;
}else{
$sort = ”;
}
$listing_sql = “select ” . $select_column_list . ” p.products_id, p.products_type,p.products_status,p.products_price,p.products_price_retail,p.products_price_sample,p.product_is_wholesale,p.product_wholesale_min,p.products_quantity, p.products_quantity_order_min, p.master_categories_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, pd.products_description, IF(s.status = 1, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status =1, s.specials_new_products_price, p.products_price) as final_price, p.products_sort_order, p.product_is_call, p.product_is_always_free_shipping, p.products_qty_box_status
from ” . TABLE_PRODUCTS_DESCRIPTION . ” pd, ” .
TABLE_PRODUCTS . ” p left join ” . TABLE_MANUFACTURERS . ” m on p.manufacturers_id = m.manufacturers_id, ” .
TABLE_PRODUCTS_TO_CATEGORIES . ” p2c left join ” . TABLE_SPECIALS . ” s on p2c.products_id = s.products_id
where p.products_status = 1
and p.products_id = p2c.products_id
and pd.products_id = p2c.products_id
and pd.language_id = ‘” . (int)$_SESSION['languages_id'].”‘”. $displayOrder. $priceOrder.”
and ” . $product_in_categories_sql . $sort;
}
}

Incoming search terms:

  • Zen Cart lightinthebox
  • zencart 产品排序
  • zen cart 产品按更新日期排列
  • zen cart 产品排序
  • lightinthebox Sorted By: new arrival
  • zencart 排序功能
  • ZENCART 排序
  • ZenCart 产品列表排序
  • zen cart 目录产品按时间排序
  • lightinthebox产品评论修改

Related posts:

  1. Zencart 调用WordPress最新文章
 

12 Comments

  1. 按你这个,改来改去都不行,有现成的文件给我替换一下吗?谢谢发到我邮箱454582823#qq.com

  2. 改好了,但打开商品详细页面后上面那些商品索引(一行可以左右移动)的顺序比较乱,那个如何改?

  3. 这个看了不是很明白,能够明白点吗?改了还是不行。

  4. I had got a dream to begin my own business, however I did not earn enough amount of cash to do that. Thank heaven my colleague recommended to take the loan. Hence I received the short term loan and realized my desire.

  5. You ought not to give up striving to get high grades and we can support you with that offering you to order A level coursework. With our help you your progress will be amazing. Thus, do not doubt to contact us.

  6. I get know that it is more simple to purchase the essay thesis or buy dissertation just about this topic, than to complete by own efforts.

  7. Following along is a beginning. Keeping together is progress. Working along is luck. Don’t ravage your existence, call to us and with you, we’ll grow a fresh crew for writing essays online

  8. If you are willing to be assisted by experts, you should buy essays cheap and be satisfied with positive marks.

  9. Numbers of students have never utilized custom academic papers writing corporations to buy essays at. Therefore, they opined that all custom papers writing firms supposed to be scam. Nonetheless, those statements are not close to real situations.

  10. The hard working scholars can read your issue just about this post and purchase the dissertation form in the thesis service.

  11. Wow, this categorically cleared some things up. One essay i am having point with is a definition for an “who we are” The teacher says that we will have to jab deep into ourselves and detect what we really are. But I think it would be more selectto use buy thesis.

  12. To find the famous written essays service should be a right way out for high school students, who are embarrassed because of the research papers performing.

发表评论

注意: 评论者允许使用'@user空格'的方式将自己的评论通知另外评论者。例如, ABC是本文的评论者之一,则使用'@ABC '(不包括单引号)将会自动将您的评论发送给ABC。使用'@all ',将会将评论发送给之前所有其它评论者。请务必注意user必须和评论者名相匹配(大小写一致)。