Magento meganavigation 模块不显示缺货商品
我使用的主题包括大型导航,并在导航上有一个滑出菜单,其中显示要添加到购物车的类别中的产品的快速视图。
此功能似乎不起作用,因此我们希望阻止大型导航完全显示缺货商品。我已经找到了这段代码: app/code/local/Jextn/Meganavigation/Block/Meganavigation.php
public function cateProducts($cateId) {
$products = Mage::getModel('catalog/product')->getCollection()
->addCategoryFilter(Mage::getModel('catalog/category')->load($cateId))
->setOrder('created_at', 'asc')
->addAttributeToFilter('visibility', 4)
->getFirstItem()
->load();
return $products;
}
我认为我们可以使用 addAttributeToFilter 调用来执行此操作,但我没有运气。有人可以帮忙或给我一些指示吗?
该系统是 Magento 版本。 1.4.1.1
I am using a theme which includes meganavigation and has a slide out menu on the navigation where it shows a quick view of products in a category to add to the cart.
This function doesn't seem to work, so we would like to stop meganavigation from showing out of stock items altogether. I have tracked down this code:
app/code/local/Jextn/Meganavigation/Block/Meganavigation.php
public function cateProducts($cateId) {
$products = Mage::getModel('catalog/product')->getCollection()
->addCategoryFilter(Mage::getModel('catalog/category')->load($cateId))
->setOrder('created_at', 'asc')
->addAttributeToFilter('visibility', 4)
->getFirstItem()
->load();
return $products;
}
I think we can use the addAttributeToFilter call to do this, but am having no luck. Can anyone help or send me some pointers please?
The system is on Magento ver. 1.4.1.1
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
试试这个:
来源
Try this:
source