magento 网格中的自定义排序列表
我有像下面这样的 magento 网格排序选项
- 最佳价值
- 价格
- 名称
我想像下面这样修改它
- 我的口哨清单
- 价格:从高到低
- 价格:从低到高
- 设计师:Az
- 设计师:ZA
设计师,价格是属性,所以可以添加它列表,但如何使其升序和降序排序。
如何按“我的愿望清单”对产品进行排序?
我尝试过此操作
$this->getOrderUrl('mywishlist', 'asc')
,但不起作用。
$tbl_wishlist_item = Mage::getSingleton('core/resource')->getTableName('wishlist_item');
$tbl_wishlist = Mage::getSingleton('core/resource')->getTableName('wishlist');
$tbl_catindex = Mage::getSingleton('core/resource')->getTableName('catalog_category_product_index');
$tbl_price_index = Mage::getSingleton('core/resource')->getTableName('catalog_product_index_price');
$collection = Mage::getResourceModel('catalog/product_collection');
$collection->getSelect()
->join(array('t2' => $tbl_wishlist_item),'e.entity_id = t2.product_id','*')
->join(array('t3' => $tbl_wishlist),'t2.wishlist_id = t3.wishlist_id','*')
->join(array('t4' => $tbl_catindex),'e.entity_id = t4.product_id','*')
->where('t4.category_id = 3 AND t3.customer_id='.$customer_id);
我尝试了这个集合,它对产品的正确数量进行了排序。但是没有显示任何产品对象,例如名称、图像、价格等。问题是什么。
I am having magento grid sort option like bellow
- Best Value
- Price
- Name
I want to modify it like bellow
- My whislist
- Price: High to Low
- Price:Low to High
- Designer:A-z
- Designer:Z-A
Designer,Price are attributes so can add it list but how to make it ascending and descending sorting.
How can i sort product by "My Wishlist" ?
I tried this
$this->getOrderUrl('mywishlist', 'asc')
But not working.
$tbl_wishlist_item = Mage::getSingleton('core/resource')->getTableName('wishlist_item');
$tbl_wishlist = Mage::getSingleton('core/resource')->getTableName('wishlist');
$tbl_catindex = Mage::getSingleton('core/resource')->getTableName('catalog_category_product_index');
$tbl_price_index = Mage::getSingleton('core/resource')->getTableName('catalog_product_index_price');
$collection = Mage::getResourceModel('catalog/product_collection');
$collection->getSelect()
->join(array('t2' => $tbl_wishlist_item),'e.entity_id = t2.product_id','*')
->join(array('t3' => $tbl_wishlist),'t2.wishlist_id = t3.wishlist_id','*')
->join(array('t4' => $tbl_catindex),'e.entity_id = t4.product_id','*')
->where('t4.category_id = 3 AND t3.customer_id='.$customer_id);
I tried this collection it sorts the correct number of product.But does n't show any products objects like name,image,price and etc. What is the problem.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论