Magento-自动设置基础,小尺寸和上传缩略图 [英] Magento - Auto set base, small and thumbnail on upload

查看:136
本文介绍了Magento-自动设置基础,小尺寸和上传缩略图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

早晨

我们从字面上搜索了Stackoverflow和Google,以找到此解决方案,但仍然没有正确的答案.

We have literally searched all over Stackoverflow and Google to find this solutions but still don't have the right answer.

我们正在尝试在first uploaded image, so when uploading multiple images the first image will always have all three options checked上自动设置Base, Small and Thumbnail选项.

We're trying to auto-set the Base, Small and Thumbnail options on the first uploaded image, so when uploading multiple images the first image will always have all three options checked.

如果有人尝试并成功找到了这个答案和建议,谢谢.

If anyone has tried and succeeded with find this answer and advice, Thank you.

推荐答案

这非常容易.示例的此处.在handleUploadComplete末尾的root/js/mage/adminhtml/product.js中替换大约120行代码

It is very easy. Example's here. Replace in root/js/mage/adminhtml/product.js in the end of handleUploadComplete around 120 row code

    this.container.setHasChanges();
    this.updateImages();
},
updateImages : function() {

使用

    this.container.setHasChanges();
    this.updateImages();
    $$('tr#media_gallery_content-image-1 td.cell-image.a-center input')[0].setAttribute('checked','checked');
    $$('tr#media_gallery_content-image-1 td.cell-small_image.a-center input')[0].setAttribute('checked','checked');
    $$('tr#media_gallery_content-image-1 td.cell-thumbnail.a-center input')[0].setAttribute('checked','checked');
},
updateImages : function() {

上传后享受自动选择第一张图片

And enjoy autoselect first image after upload

这篇关于Magento-自动设置基础,小尺寸和上传缩略图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆