Magento:防止显示没有图像的产品
我们刚刚完成了批量导入。我们有很多产品没有显示图片,我们需要防止这种情况发生。不应有图像或显示,但我们无法在 CSV 中将它们设置为“在任何地方都不可见”。
因此,如果 images = 0 则不会在任何地方显示。
非常感谢任何帮助。提前致谢。
We've just done a mass import. We have allot of products showing up without images and we need to prevent that. There not supposed to have images or show but we can't set them to "Not visible anywhere" in the CSV.
So if images = 0 don't show anywhere.
Any help is greatly appreciated. Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以修改类别集合,以便它仅加载具有图像的产品。如果您使用平面表(推荐),向集合 Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection 添加过滤方法应该不是很困难。
一种更脏但更简单的方法是在产品列表模板(app/design/frontend/templates/catalog/product/list.phtml)中不显示没有图像的产品。图像助手用于显示产品图像。每当默认图像即将显示时,您都可以继续下一个产品。但请记住,无论如何都会加载没有图像的产品,这确实很脏。
You can modify the category collection so that it only loads Products that have images. If you use flat tables (recommended), it should not be very difficult to add a filter method to the collection Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection.
A more dirty but easier way would be to just not display the products without images in the product listing template (app/design/frontend/templates/catalog/product/list.phtml). The image helper is used there to display the product images. Whenever the default image is about to be shown, you could continue to the next product. But remember, that the products without images are loaded anyway, which is really dirty.
当“图像”列为空时,尝试将“单独不可见”放入 CSV 的“可见性”列中。
Try putting "Not Visible Individually" in the "Visibility" column of your CSV whenever the "image" column is empty.