任何人都可以告诉我如何创建两个商业帐户?其实,我想要这样的功能,如果我的购物车总额超过100美元比我想将其传递给我的第一个商家帐户,否则要通过第二个商家的电子邮件。我知道,它是可行的。当页面重定向到PayPal时,我必须根据购物车总数传递不同的电子邮件。我想创建一个可以提供两个商家电子邮件的分开的模块,因此这两个输入的电子邮件都可以基于购物车total.TIA,任何帮助?在PayPal标准中创建两个商业帐户
回答
创建的system.xml并粘贴
<config>
<sections>
<paypal>
<groups>
<account translate="label">
<label>Merchant Account</label>
<fieldset_css>paypal-config</fieldset_css>
<frontend_type>text</frontend_type>
<sort_order>0</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<fields>
<business_account2 translate="label comment tooltip">
<label>Email Associated with PayPal Merchant Account more than 5 amount</label>
<comment><![CDATA[<a href="http://www.magentocommerce.com/paypal">Start accepting payments via PayPal!</a>]]></comment>
<tooltip>Don't have a PayPal account? Simply enter your email address.</tooltip>
<config_path>paypal/general/business_account2</config_path>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<sort_order>10</sort_order>
<frontend_class>validate-email</frontend_class>
</business_account2>
</fields>
</account>
</groups>
</paypal>
</sections>
</config>
而创建config.xml和粘贴
<config>
<modules>
<My_CustomPaypal>
<version>1.0.0</version>
<depends>
<!-- no dependencies -->
</depends>
</My_CustomPaypal>
</modules>
<global>
<models>
<paypal>
<rewrite>
<standard>My_CustomPaypal_Model_Standard</standard>
</rewrite>
</paypal>
</models>
<resources />
<extraconfig />
<blocks />
</global>
</config>
然后重写standard.php和声明getStandardCheckoutFormFields()
方法,其中,具有把逻辑写在上面评论。你一定会得到私人方法_getAggregatedCartSummary()
的错误,所以重新定义,因为它在核心范围内是公开的。并完成。
@sixlettervariables thx man! – Kamal 2011-04-11 07:39:35
关于使用两个Authorize.net帐户,请看this recent answer。 Paypal的概念是一样的。在模型Mage_Paypal_Model_Standard
,有一个叫getConfig
方法:
/**
* Config instance getter
* @return Mage_Paypal_Model_Config
*/
public function getConfig()
{
if (null === $this->_config) {
$params = array($this->_code);
if ($store = $this->getStore()) {
$params[] = is_object($store) ? $store->getId() : $store;
}
$this->_config = Mage::getModel('paypal/config', $params);
}
return $this->_config;
}
这看起来像一个覆盖你最好的选择。此时您应该可以拨打:
$this->getCheckout()->getQuote();
以获取您的报价对象。用它来决定加载哪些Paypal信息。将该PayPal信息保存在备用路径下的数据库中(如paypal/config_alt
),并根据需要返回。
希望有帮助!
thx joseph,我很感激你,但实际上我想提供两个电子邮件地址,以便管理员可以输入两个电子邮件,通过更改system.xml它可能。现在看一下standard.php中的getStandardCheckoutFormFields()使用$ api = Mage :: getModel('paypal/api_standard') - > setConfigObject($ this-> getConfig());这样可以得到api_standard,这里使用config。现在在这个函数中调用getStandardCheckoutRequest(),从这里开始,business_account 2不会被完全返回。第二封电子邮件以path ='paypal/general/business_account2'的形式存储在core_config_data中。 – Kamal 2011-03-08 06:01:39
getStandardCheckoutFormFields()这个函数在block/redirect.php中用于向paypal提供变量。现在我想覆盖定义getStandardCheckoutFormFields()的模型,并根据我的要求返回变量业务。 – Kamal 2011-03-08 06:06:39
我想要包括所有东西的最终总数,我认为我必须使用Mage :: getSingleton('checkout/session') - > getQuote() - > getGrandTotal();对吧? – Kamal 2011-03-08 06:09:25
最后,我的system.xml添加标签后作为
<business_account2 translate="label comment tooltip">
<label>Email Associated with PayPal Merchant Account more than 100 amount</label>
<comment><![CDATA[<a href="http://www.magentocommerce.com/paypal">Start accepting payments via PayPal!</a>]]></comment>
<tooltip>Don't have a PayPal account? Simply enter your email address.</tooltip>
<config_path>paypal/general/business_account2</config_path>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<sort_order>10</sort_order>
<frontend_class>validate-email</frontend_class>
</business_account2>
创建此并保存配置后,您可以在core_config_data表中看到,有作为“贝宝设定在最后的路径/一般/ business_account2' 。现在改变getStandardCheckoutFormFields()作为
$business2 = Mage::getStoreConfig('paypal/general/business_account2');
$grandTotal = $order->getGrandTotal();
if($grandTotal >= 100) {
unset($result['business']);
$result['business'] = $business2;
}
在付款后$result = $api->getStandardCheckoutRequest();
/型号/ Standard.php,我已在核心文件中的这些变化,但是大家都知道我要创建这个使用本地folder.I希望这可以帮助你。
谢谢你,约瑟夫。 – Kamal 2011-03-09 05:20:51
- 1. 将Paypal标准付款划分为两个单独的帐户
- 2. 启动Paypal商户帐户
- 3. Paypal API创建沙箱个人和企业帐户
- 4. 创建PayPal沙箱商家/卖家帐户
- 5. paypal沙箱帐户创建失败
- 6. 无法创建PayPal沙盒帐户
- 7. 创建的SANbox的PayPal帐户亲
- 8. paypal sandbox商人帐户错误
- 9. 标准帐户(Vista)中的文件创建失败
- 10. PayPal付款标准访客结帐
- 11. Paypal Rest API - 使用PayPal帐户付款资源创建付款
- 12. 如何在PayPal开发者帐户中创建重复计费?
- 13. Paypal定期结算 - 专业?标准?
- 14. 无法在美国境外创建PayPal沙箱帐户
- 15. 购买错误 - 商家不是在一个企业帐户
- 16. 我无法在开发人员帐户中创建一个PayPal测试应用程序帐户Rest Api
- 17. 商业用途的Drupal编码标准?
- 18. 切换到多个商家帐户与Activemerchant宝石PayPal Express结帐
- 19. 在沙盒帐户上禁用PayPal数字商品
- 20. 如何让用户只在Acumatica中查看和创建其商业帐户和联系人
- 21. 如何在SQL Server 2008标准中创建SQL代理作业?
- 22. PayPal快速结帐不工作中华创业加载
- 23. 使用外壳脚本和标准输入创建多个帐户
- 24. 在Parse上创建一个帐户
- 25. 在两个Google Play帐户中使用一个admob帐户?
- 26. 在ActiveMerchant中更改PayPal帐户
- 27. 如何在帐户中启用“PayPal Pro”?
- 28. Paypal-Express没有强制paypal帐户创建(德国卖家,德国买家)
- 29. Paypal标准选项没有出现在结帐页面
- 30. PayPal使用Payflow创建定期付款与贝宝帐户
您应该检查贝宝条款与条件,如果他们实际上允许您有多个企业帐户。 – nfechner 2011-03-07 14:19:36
其实我有两个发送箱商家帐户,我已经使用这两个不同的帐户检出,金额从买家帐户中扣除。但是现在我想根据购物车总数来使用它们。我只能在admin-> config中输入paypal设置中的一个电子邮件地址,我想要获得两个电子邮件地址,并且想要在redirect.php.block thblock中更改thx – Kamal 2011-03-07 14:52:54