Magento后台产品多图管理模块文件:app/design/adminhtml/default/default/template/catalog/product/helper/gallery.phtml
找到
<thead>
<tr class="headings">
<th><?php echo Mage::helper('catalog')->__('Image') ?></th>
<th><?php echo Mage::helper('catalog')->__('Label') ?></th>
<th><?php echo Mage::helper('catalog')->__('Sort Order') ?></th>
<?php foreach ($_block->getImageTypes() as $typeId=>$type): ?>
<th><?php echo $type['label'] ?></th>
<?php endforeach; ?>
<th><?php echo Mage::helper('catalog')->__('Exclude') ?></th>
<th class="last"><?php echo Mage::helper('catalog')->__('Remove') ?> | <em onclick="checkAll()">全选</em> | <em onclick="uncheckAll()">全不选</em></th>
</tr>
</thead>
js部分
<script>
function uncheckAll() {
var a = window.document.getElementsByTagName("input");
for (var i = 0; i < a.length; i++) {
if (a[i].type == "checkbox" && a[i].disabled == false) {
a[i].checked = true;
a[i].click();
}
}
}
function checkAll() {
var a = window.document.getElementsByTagName("input");
for (var i = 0; i < a.length; i++) {
if (a[i].type == "checkbox" && a[i].disabled == false) {
a[i].checked = false;
a[i].click();
}
}
}
</script>

本文介绍Magento后台产品图片管理模块的实现细节,包括如何通过gallery.phtml文件配置产品图片的显示方式,如图片标签、排序及排除选项等,并提供用于全选和全不选图片的JavaScript代码。
799

被折叠的 条评论
为什么被折叠?



