magento-1.9 - Magento 1 如何即时设置定期付款初始费用?
问题描述
我需要在结账时设置定期付款的初始费用。这样我就可以向客户收取下订单的时间。
有谁知道如何或指出我的方向?谢谢
解决方案
首先,我需要明确指出,定期付款是针对默认 Magento 附带的贝宝网关进行的。我的解决方案是扭曲一些方法submitRecurringProfile驻留在Mage_Paypal_Model_Pro.php。所以我用MyCompany_ModuleName_Model_Paypal_Pro.php覆盖它,这样我就可以对submitRecurringProfile进行更改而不会弄乱核心文件。
public function submitRecurringProfile(Mage_Payment_Model_Recurring_Profile $profile,
Mage_Payment_Model_Info $paymentInfo
) {
$profile->setData('init_amount', 100);
parent::submitRecurringProfile($profile, $paymentInfo);
}
启用about功能后,初始费用将设置为100。
推荐阅读
- php - Laravel Route Model Binding 在不同模型使用相同结构时发生冲突
- c++ - 我需要 std::conditional 但有两个以上的选择
- php - 如何在 PHP 中使用 WSDL Web 服务?
- vue.js - 在页面/组件加载时打开模式对话框
- css - 如何在 FOLDER 中包含所有全局样式?
- javascript - 为什么 date.getHours()%12 给你 1-12 格式的时间?
- graph - 使用最大标准偏差减少的最小生成树聚类
- python - 从网上下载表格
- python - 如何用列名中的非标准字符替换 PySpark 中所有列的值?
- django - 显示从外键关系到自序列化程序的信息