ʍǝɥ*_*ʇɐɯ 10
完整的工作解决方案:
复制js/mage/adminhtml/grid.js到js/colors/adminhtml/grid.js
制作文件666和文件夹(js/colors&js/colors/adminhtml)777.
编辑它并在第208行(包含}.bind(this)行之前)添加:
colorize();
Run Code Online (Sandbox Code Playgroud)
在文件末尾添加:
function colorize () {
$$('td').each(function(macguffin) {
if(macguffin.innerHTML.strip()=="Processing") macguffin.parentNode.setStyle({backgroundColor: 'Orange' });
if(macguffin.innerHTML.strip()=="Pending") macguffin.parentNode.setStyle({backgroundColor: 'Gold', color:'Black' });
if(macguffin.innerHTML.strip()=="Payment Review") macguffin.parentNode.setStyle({backgroundColor: 'LightPink' });
if((macguffin.innerHTML.strip()=="On Hold")||(macguffin.innerHTML.strip()=="Payment Review")) macguffin.parentNode.setStyle({backgroundColor: 'HotPink' });
if(macguffin.innerHTML.strip()=="Suspected Fraud") macguffin.parentNode.setStyle({backgroundColor: 'Red' });
if((macguffin.innerHTML.strip()=="Closed")||(macguffin.innerHTML.strip()=="Canceled")||(macguffin.innerHTML.strip()=="Cancelled")) macguffin.parentNode.setStyle({backgroundColor: 'LightBlue', fontStyle: 'italic' });
if(macguffin.innerHTML.strip()=="Complete") macguffin.parentNode.setStyle({backgroundColor: 'Green' });
});
}
document.observe("dom:loaded", colorize);
Run Code Online (Sandbox Code Playgroud)
现在创建或编辑admin local.xml文件 app/design/adminhtml/default/default/layout/local.xml
编辑它包括:
<?xml version="1.0"?>
<layout version="0.1.0">
<default>
<reference name="head">
<action method="removeItem"><type>js</type><name>mage/adminhtml/grid.js</name></action>
<action method="addItem"><type>js</type><name>colors/adminhtml/grid.js</name></action>
</reference>
</default>
</layout>
Run Code Online (Sandbox Code Playgroud)
订单网格现在将呈现鲜艳的颜色,您应该能够清楚地看到需要注意的订单.
colorize()可以编辑该功能以适合您的订单状态和首选配色方案.