問(wèn)題描述
我在 magento 1.7.0.2 中使用的是貨到付款方式.
I am using Cash On Delivery Payment method in magento 1.7.0.2.
我只需要針對(duì)某些郵政編碼/個(gè)人識(shí)別碼使用此付款選項(xiàng).
I need this payment option only for certain zip codes/pin codes.
有人可以幫忙嗎?
推薦答案
在COD中你有一個(gè)功能
in COD you have a function
public function isAvailable($quote = null)
在最后一行之前return $checkResult->isAvailable;
你放置一個(gè) if 條件 if($checkResult->isAvailable)
調(diào)用
you place an if condition if($checkResult->isAvailable)
call
$this->isZipCodeallowedForCod($zipCode,$quote)
并在此函數(shù)中應(yīng)用邏輯從報(bào)價(jià)對(duì)象獲取帳單地址郵政編碼,并檢查允許的郵政編碼列表和設(shè)置標(biāo)志.
and in this function apply logic to get billing address zip code from quote object and checking with list of zipcodes allowed and setting flag.
注意:修改時(shí)不要修改核心代碼,使用重寫(xiě)或覆蓋Magento的概念.
Note : When modifying this do not modify core code use rewrite or override concept of Magento.
這篇關(guān)于如何將 magento 中的默認(rèn) COD 限制為僅某些郵政編碼?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!