- 浏览: 150074 次
- 性别:
- 来自: 宁波
文章分类
最新评论
-
cxxllove:
请教一个问题,一个43K的图片上传后,图片仍然被压缩到17K, ...
magento 1.4-- 再论如何改善前台图片质量 -
anderson916:
可以访问我的网站: http://www.magento-ch ...
magento -- 给Magento提速之缓存上的探索
Magento后台属性组合管理里的各个属性显示的是属性的code,也就是说,即便给每个属性加上了中文的标签(label),这里显示的依然是大片的英文,对一个不懂技术的后台管理者来说,这样多的英文时他们不愿意看到的,所以要想办法变一下。
打开\app\code\local\Mage\Adminhtml\Block\Catalog\Product\Attribute\Set\Main.php文件,找到几个用来显示的代码,替换成如下所示
public function getGroupTreeJson() { $items = array(); $setId = $this->_getSetId(); /* @var $groups Mage_Eav_Model_Mysql4_Entity_Attribute_Group_Collection */ $groups = Mage::getModel('eav/entity_attribute_group') ->getResourceCollection() ->setAttributeSetFilter($setId) ->load(); $configurable = Mage::getResourceModel('catalog/product_type_configurable_attribute') ->getUsedAttributes($setId); /* @var $node Mage_Eav_Model_Entity_Attribute_Group */ foreach ($groups as $node) { $item = array(); //Alex $item['text'] = $this->__($node->getAttributeGroupName()); $item['id'] = $node->getAttributeGroupId(); $item['cls'] = 'folder'; $item['allowDrop'] = true; $item['allowDrag'] = true; $nodeChildren = Mage::getResourceModel('catalog/product_attribute_collection') ->setAttributeGroupFilter($node->getId()) ->addVisibleFilter() ->checkConfigurableProducts() ->load(); if ($nodeChildren->getSize() > 0) { $item['children'] = array(); foreach ($nodeChildren->getItems() as $child) { /* @var $child Mage_Eav_Model_Entity_Attribute */ $attr = array( //Alex 'text' => $this->__($child->getFrontendLabel()), 'id' => $child->getAttributeId(), 'cls' => (!$child->getIsUserDefined()) ? 'system-leaf' : 'leaf', 'allowDrop' => false, 'allowDrag' => true, 'leaf' => true, 'is_user_defined' => $child->getIsUserDefined(), 'is_configurable' => (int)in_array($child->getAttributeId(), $configurable), 'entity_id' => $child->getEntityAttributeId() ); $item['children'][] = $attr; } } $items[] = $item; } return Mage::helper('core')->jsonEncode($items); } public function getAttributeTreeJson() { $items = array(); $setId = $this->_getSetId(); $collection = Mage::getResourceModel('catalog/product_attribute_collection') ->setAttributeSetFilter($setId) ->load(); $attributesIds = array('0'); /* @var $item Mage_Eav_Model_Entity_Attribute */ foreach ($collection->getItems() as $item) { $attributesIds[] = $item->getAttributeId(); } $attributes = Mage::getResourceModel('catalog/product_attribute_collection') ->setAttributesExcludeFilter($attributesIds) ->addVisibleFilter() ->load(); foreach ($attributes as $child) { $attr = array( //Alex 'text' => $this->__($child->getFrontendLabel()), 'id' => $child->getAttributeId(), 'cls' => 'leaf', 'allowDrop' => false, 'allowDrag' => true, 'leaf' => true, 'is_user_defined' => $child->getIsUserDefined(), 'is_configurable' => false, 'entity_id' => $child->getEntityId() ); $items[] = $attr; } if (count($items) == 0) { $items[] = array( 'text' => Mage::helper('catalog')->__('Empty'), 'id' => 'empty', 'cls' => 'folder', 'allowDrop' => false, 'allowDrag' => false, ); } return Mage::helper('core')->jsonEncode($items); }
$child->getFrontendLabel()即获取该属性的标签值,而不是原来的code值
修改后效果如下
发表评论
-
magento -- 推荐插件 -- 购物车预览 --Cart items preview on mouseover
2011-04-24 11:47 2092名称: Cart items preview on m ... -
Magento安全设置 (转载)
2011-03-23 17:34 2653在现今的网络中,没有 ... -
magento插件手动下载
2011-03-13 20:03 1490http://freegento.com/ddl-magent ... -
magento开始办官方培训班了,课程价格真给力啊
2011-03-08 09:05 1767早上打开Magento官方站,发现顶栏多了一条东西,点进去 ... -
magento -- Magento1.5初探三
2011-02-12 22:18 1722接上文……………… PS:写 ... -
推荐两个Magento做的中文网站 GAP和佰草集
2010-11-18 22:23 978Magento这两年发展很快 ... -
magento 1.4 -- 推荐插件 -- 不错的图片放大查看插件 -- IG LightBox
2010-11-21 23:21 1026挺长时间没推荐插件了,虽然经常在看Magento官网,还是 ... -
magento -- 修改所有商品的价格为原来的1.2倍示例
2010-11-24 20:03 1538运行一遍如下代码可以使全站所有商品的价格变成原来的1.2倍 ... -
magento -- 设置满多少免运费
2010-11-25 17:17 1501第一步,到后台配置System->Configura ... -
Magento在CMS Page中增加用户信息变量
2010-11-30 14:31 767Magento的cms页面和static block页面中可 ... -
magento -- 给Magento提速之缓存上的探索
2010-12-07 20:54 2133依然在为Magento提速做努力,除了自带的缓存和编译,之前 ... -
magento -- 后台产品列表页默认只显示可见性为“Catalog, Search”的产品
2010-12-15 12:33 1381最近有客户提到,后台产品管理列表页面,管理产品很不方便,原 ... -
magento -- 推荐插件 -- 页面布局分析插件 -- Layout Analyzer
2010-12-24 15:41 1176名称: Layout Analyzer Extensi ... -
magento -- 推荐插件 -- 按字母过滤列表页产品 --alphabates
2010-12-29 21:43 1067名称: alphabates Extension Ke ... -
magento -- 关于更新订单状态的API接口函数
2010-12-30 17:10 1898做Magento和其他系统的对接时需要调用Magento的A ... -
有用的Magento Collection函数
2011-01-07 09:22 863There are different importan ... -
magento -- 用Magento的方式读写XML
2011-01-10 14:06 1342I will be using Varien_Simplexm ... -
自己写的magento产品详细页添加下一件,上一件产品链接
2011-01-13 22:11 1885网上商城在产品详细页放上一件和下一件产品的链接在不少地方看到 ... -
magento -- 按某个属性排序上的一个尝试
2011-01-20 00:42 2019Magento的属性可以用来放在产品列表页给产品进行排序,要 ... -
magento -- Magento1.5初探一
2011-01-30 12:34 1516Magento的新一代版本1.5已经出到RC了,也就是说离正 ...
相关推荐
深入理解Magento-第九章 – 修改、扩展、重写Magento代码 深入理解Magento-第十章 – 数据操作&数据收集器 在Magento教程中用到的模块 Configviewer Layoutviewer Helloworld with Custom System Config 其他...
第一章Magento 销售 1.订单管理-----------------------------------------------------Magento-2.1订单管理 2.发票---------------------------------------------------------- Magento-2.2订单管理 3.配送-------...
magento-ce-2.4.0_sample_data-2020-07-26-02-51-57.tar.gz Include sample data
magento-1.8.0.0.tar.gz
magento-ce-2.4.0-2020-07-24-11-15-38.tar.gz 不带sample data
以详细的操作实例说明了magento的使用、配置、开发相关的实际应用。
magento-1.9.1.1-2015-04-30-12-49-08 源代码包
Magento-Redismanager, 在 Magento,用于Redis的超级用户控制 Redis 管理Redis服务的实用程序特性系统> 配置>的自动或者手动配置高级> Redis管理在负载均衡环境中缓存服务不同的理想情况直接从magento面板管理员管理...
magento-1.6.2.0 magento-1.6.2.0 magento-1.6.2.0
magento -redis 安装包
因为国外网速太慢了,所以下载后分享给需要的人。magento-ce-2.4.2-p1-2021-04-22-10-49-09
Magento-中文开发教程(技术重点2
magento-演示数据1.6.1.0
magento-1.6.1.0最新英文版
magento-1.7.0.7z,安装包
最新的magento-1.7.0.2汉化包,汉化率达到98%上,绝对适合你
Magento-CE-2.3.4_sample_data-2020-01-22-11-11-58.tar.gz源自官网
magento-stock-movements, Magento扩展,节省产品库存 节省你的Magento产品的库存 特性将库存移动保存在产品修改页面的新标签中安装 Magento 1.5. x, 1.6. x, 1.7. x, 1.8. x, 1.9.x使用 modgit 安装:$ cd/pat
在Magento 2站点内安装要在您的Magento 2项目中使用,可以使用: composer require --dev magento/magento-coding-standard 出于安全考虑,以这种方式安装时,无法自动添加phpcs的Magento标准。 您可以通过将以下...
Ajax-Magento-ajax-add-to-cart.zip,[模块magento 1]magento ajax添加到购物车-ajoter vos produits au panier en ajax/感谢ajax将您的产品添加到购物车,ajax代表异步javascript和xml。它是多种web技术的集合,包括...