嗨,好吧,我面臨的問題似乎很簡單,但現在變成了一場真正的噩夢。Magento新車屬性
有人問我一個屬性(即點)添加到所有的產品(這是使用的管理控制檯進行非常簡單),並有總作爲規則可以在設定的車屬性!?
我相當肯定,車屬性定義:
class Mage_SalesRule_Model_Rule_Condition_Address extends Mage_Rule_Model_Condition_Abstract
{
public function loadAttributeOptions()
{
$attributes = array(
'base_subtotal' => Mage::helper('salesrule')->__('Subtotal'),
'total_qty' => Mage::helper('salesrule')->__('Total Items Quantity'),
'weight' => Mage::helper('salesrule')->__('Total Weight'),
'payment_method' => Mage::helper('salesrule')->__('Payment Method'),
'shipping_method' => Mage::helper('salesrule')->__('Shipping Method'),
'postcode' => Mage::helper('salesrule')->__('Shipping Postcode'),
'region' => Mage::helper('salesrule')->__('Shipping Region'),
'region_id' => Mage::helper('salesrule')->__('Shipping State/Province'),
'country_id' => Mage::helper('salesrule')->__('Shipping Country'),
);
$this->setAttributeOption($attributes);
return $this;
}
<...>
所以,如果我重寫這一模式,將項目添加到該數組我會得到規則定義中的管理面板中顯示的屬性。似乎除了total_qty和payment_method之外,所有這些屬性在sales_flat_quote_address表中都有一個匹配的列!
現在的問題是我應該做的有我的新的屬性來計算和規則處理評估?我應該在此表格中添加一列,並在購物車更改時更新其值?
如何做到這將是很有價值的感謝任何見解。