我一直试图按降序排列价格排序相关产品(最便宜的顶部和昂贵的底部)到目前为止没有任何运气,也许有人可以指导我如何做到这一点?Magento按价格排序相关产品
0
A
回答
0
看到此文件的应用程序\代码\核心\法师\目录\型号\ Product.php,并检查该功能线814
public function getRelatedProductCollection()
{
$collection = $this->getLinkInstance()->useRelatedLinks()
->getProductCollection()
->setIsStrongMode();
$collection->setProduct($this);
return $collection;
}
您需要修改通过扩展这个模型类此功能,所以首先要创建一个模块并在您的功能中写入此功能。并添加订单到收藏。
$collection->setOrder('price', 'DESC');
public function getRelatedProductCollection()
{
$collection = $this->getLinkInstance()->useRelatedLinks()
->getProductCollection()
->setIsStrongMode();
$collection->setProduct($this);
$collection->setOrder('price', 'DESC');
return $collection;
}
您需要扩展这个模块Mage_Catalog_Model_Product并修改该功能
+0
感谢它工作:) – user3540304 2014-10-06 06:45:12
0
转到/应用/代码/核心/法师/目录/型号/路径和Product.php
添加下面的代码public function getRelatedProductCollection()
{
$collection = $this->getLinkInstance()->useRelatedLinks()
->getProductCollection()
->setIsStrongMode();
$collection->setProduct($this);
$collection->setOrder('price', 'DESC');
return $collection;
}
您也可以将此用于体重。只需写'重量'来代替'价格'。 升序只需写'ASC'代替'DESC'。
相关问题
- 1. Magento:按价格排序捆绑产品
- 2. 如何按产品价格排序Magento产品列表?
- 3. Magento - 按产品编号排序产品
- 4. Magento ver。 1.9.1.0:按数量和价格排序产品
- 5. Magento负面产品价格
- 6. Magento更新产品价格
- 7. Magento团队价格与配置产品相关的简单产品
- 8. Magento - 更新主要产品价格以包含所选相关产品?
- 9. 如何获得我的相关产品的价格在Magento
- 10. 按产品排序产品
- 11. 销售与相关价格的产品
- 12. 在Magento中按名称排序产品
- 13. Magento:按属性排序产品位置
- 14. Magento产品排序产品分类
- 15. Magento相关产品选项
- 16. Magento相关产品Sidebar
- 17. Magento:1.7 - 相同的产品有不同的价格基于magento
- 18. Magento的:相关产品转移到相关产品
- 19. Magento按产品类型排序产品列表
- 20. 排序新产品magento
- 21. Magento:排序产品集合
- 22. 按价格过滤产品
- 23. 排序的相关产品不工作在Magento 1.6
- 24. woocommerce购物车页面显示产品按产品价格排序
- 25. Magento的产品取属性需要排序按降序排序
- 26. 我需要按价格排序,然后按相同价格按时间排序多维相关数组
- 27. 显示相关产品,从网格中排除当前产品
- 28. Magento得到的价格特色产品
- 29. Magento Bundle产品缺少价格字段
- 30. Magento可配置产品价格
到目前为止你有什么代码... – Ashley 2014-10-03 14:44:28