私はmagento 1.7を使用しています私は3つの支払い方法を持っているので、顧客のチェックアウト中に3つの支払い方法の中からランダムに1つの支払い方法を表示したい.貴重な提案を待っています.読んでくれてありがとう.
1 に答える
0
@支払いオプションを無効にする-特定の製品の代金引換のみ-magentoまたは代金引換がアクティブ化された管理者のみ(フロントエンドが有効になっていない)-Magento?
class MagePal_PaymentFilterByProduct_ActivePaymentMethod
{
//get all active (enable) payment method
public function toOptionArray()
{
$payments = Mage::getSingleton('payment/config')->getActiveMethods();
//Get current customer id
//remove method below after check if customer place order before or first order
foreach ($payments as $paymentCode=>$paymentModel) {
if($paymentModel->canUseCheckout() == 1){
$paymentTitle = Mage::getStoreConfig('payment/'.$paymentCode.'/title');
$methods[$paymentCode] = array(
'label' => $paymentTitle,
'value' => $paymentCode,
);
}
}
return $methods;
}
}
于 2013-09-20T15:48:32.993 に答える