我想定製PayPal中的返回按鈕,並且我發現我必須在請求中使用按鈕的文本設置參數CBT,但是我找不到如何在Magento(版本1.4.11)中進行。在Magento中設置PayPal CBT參數
你能幫助我嗎? 感謝
我想定製PayPal中的返回按鈕,並且我發現我必須在請求中使用按鈕的文本設置參數CBT,但是我找不到如何在Magento(版本1.4.11)中進行。在Magento中設置PayPal CBT參數
你能幫助我嗎? 感謝
我獨自在這個文件中發現了答案
應用程序/代碼/核心/法師/貝寶/座/標準/ Redirect.php
這個循環之後:
foreach ($standard->getStandardCheckoutFormFields() as $field=>$value) {
$form->addField($field, 'hidden', array('name'=>$field, 'value'=>$value));
}
我添加這一行:
$form->addField("cbt", "hidden", array('name'=>'cbt', 'value' => 'YOUR MESSAGE'));
希望這有助於
要在您的貝寶標準添加自定義字段遵循以下步驟:
注:覆蓋在本地下面提到的文件,然後做的更改。提到的核心文件是路徑位置僅
1)打開應用程序/代碼/核心/法師/貝寶/型號/原料藥/ Standard.php下保護$ _globalMap「notify_url」後加上你的領域
'cbt' => 'cbt',
在同一個文件下保護$ _commonRequestFields後添加 'notify_url'
'cbt'
2)打開應用程序/代碼/核心/法師/貝寶/型號/ Standard.php和下公共函數getStandardCheckoutFormFields()添加
$api->setOrderId($orderIncrementId)
->setCurrencyCode($order->getBaseCurrencyCode())
//->setPaymentAction()
->setOrder($order)
->setNotifyUrl(Mage::getUrl('paypal/ipn/'))
->setReturnUrl(Mage::getUrl('paypal/standard/success'))
->setCbt('your_cbt_value') // set your value here
->setCancelUrl(Mage::getUrl('paypal/standard/cancel'));
這將導致以下形式代碼
<input id="cbt" name="cbt" value="your_cbt_value" type="hidden"/>
不要忘記這是一個核心的Magento變化,因此可能會被任何Magento更新覆蓋。 – Robert