在“相关产品”上添加缩略图在 Magento 的后端
当我在后端添加新产品时,系统会要求我选择“相关产品”、“向上销售”和“交叉销售”。我希望能够在后端看到缩略图,这样我就可以快速选择它们,而不是尝试按名称/sku 选择它们。
When I add a new product at the backend, I am asked to choose the "related products", "Up-sells" and "Cross-sells". I would like to be able to see the thumbnail images here at the backend, so I can choose them quickly, rather than trying to choose them by name/sku.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
adminhtml 网格的渲染器图像不存在。你必须重写这个。
编辑文件
app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Related.php
附近第 140 行,在此代码下:
粘贴此代码:
编辑文件
app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column.php
第 271 行,添加此代码以覆盖渲染器:
并在附近的第 348 行添加(对于过滤器):
现在您必须创建文件
app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/ Image.php
(如果不存在)使用以下内容代码:(您可以将
width=60px
替换为您想要的任何宽度或添加高度)现在您必须创建文件
app/ code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Image.php
(如果不存在)包含以下内容代码:不要忘记刷新缓存。
现在您必须在相关网格中看到图像列。
您可以对
app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Upsell.php
和app/code/core/Mage/Adminhtml 执行相同的操作/Block/Catalog/Product/Edit/Tab/Crosssell.php
Renderer image does not exist for adminhtml grid. You have to override this.
Edit file
app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Related.php
nearby line 140, under this code:
Paste this code:
Edit file
app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column.php
line 271, add this code to override the renderer:
and nearby line 348 add (for the filter):
Now you must create file
app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Image.php
(if not exists) with this content code:(You can replace
width=60px
by any width you want or add height)Now you must create file
app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Image.php
(if not exists) with this content code:Dont forget to refresh cache.
Now you must see an image column in the related grid.
You can do the same thing for
app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Upsell.php
andapp/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Crosssell.php
您可能可以使用另一个显示产品图像的字段来覆盖在管理的该区域中显示产品的网格控制器。
You could probably override a the grid controller that displays the products in that area of the admin with another field that shows you the image of the product.