【问题标题】:Change payment method each time the customer check out in magento 1.7每次客户在 magento 1.7 中结账时更改付款方式
【发布时间】:2013-09-20 11:52:59
【问题描述】:

我使用的是 magento 1.7,我有 3 种付款方式,所以我想在客户结帐期间在 3 种付款方式中随机显示一种付款方式。等待宝贵的建议。感谢阅读。

【问题讨论】:

  • 您好,您需要设置一个支付方式随机显示的方式吗?
  • 是的,但是所有 3 种付款方式都应该以随机顺序出现,即每次客户结帐时,他都需要查看不同的付款方式。感谢您的回复
  • 只是随机顺序,没有任何显示/隐藏或任何正确的东西?
  • 是的,帮我解决这个问题

标签: magento magento-1.7 payment


【解决方案1】:

看看@Disable payment options-only cash on delivery for particular product-magentoCash On Delivery activated Admin Only ( Not Frontend enabled ) - 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;
    }
}

【讨论】:

  • 这是什么意思(未启用前端)- Magento?
  • 前端 = 客户购买的网站(后端 = 管理员为客户下订单)
猜你喜欢
  • 2021-11-11
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-08-04
  • 1970-01-01
  • 2017-02-08
  • 2012-03-01
  • 2015-08-07
相关资源
最近更新 更多