支払いモジュールを作成するには、基本的にCheck/Money Orderメソッドと同じですが、ラジオボタンをクリックして選択すると、下に表示されます。基本的なカスタムMagento支払いモジュールを利用できない
動作するモジュールを作成しましたが、その情報が下に表示されません。有効にすると、空白のエラーページが表示されます(メッセージは表示されません)。
私は私のモジュールフォルダ内の以下のファイルがあります。
- ブロック/フォーム/ Bacs.php
- ブロック/情報/ Bacs.php
- など/ config.xmlが
- など/ system.xml
- モデル/メソッド/ Bacs.php
とフロントエンドワイズ私は、次のファイルがあります。
- 支払い/情報/ bacs.phtml
- 支払い/フォーム/ BACSを.phtml
私の問題は私のブロックphpファイルにあると思います彼らに私のモデルファイルから、モジュールが機能します。ここで私は問題があると思うファイルの概要です:
モデル/メソッド/ Bacs.php
class Creare_Bacs_Model_Method_Bacs extends Mage_Payment_Model_Method_Abstract
{
protected $_code = 'bacs';
protected $_formBlockType = 'bacs/form_bacs';
protected $_infoBlockType = 'bacs/info_bacs';
public function assignData($data)
{
$details = array();
if ($this->getInstructions()) {
$details['instructions'] = $this->getInstructions();
}
if (!empty($details)) {
$this->getInfoInstance()->setAdditionalData(serialize($details));
}
return $this;
}
public function getInstructions()
{
return $this->getConfigData('instructions');
}
}
ブロック/情報/ Bacs.php
class Creare_Bacs_Block_Info_Bacs extends Mage_Payment_Block_Info
{
protected $_instructions;
protected function _construct()
{
parent::_construct();
$this->setTemplate('payment/info/bacs.phtml');
}
public function getInstructions()
{
if (is_null($this->_instructions)) {
$this->_convertAdditionalData();
}
return $this->_instructions;
}
protected function _convertAdditionalData()
{
$details = @unserialize($this->getInfo()->getAdditionalData());
if (is_array($details)) {
$this->_instructions = isset($details['instructions']) ? (string) $details['instructions'] : '';
} else {
$this->_instructions = '';
}
return $this;
}
}
ブロック/フォーム/ Bacs.php
class Creare_Bacs_Block_Form_Bacs extends Mage_Payment_Block_Form
{
protected function _construct()
{
parent::_construct();
$this->setTemplate('payment/form/bacs.phtml');
}
}
本当に
<instructions translate="label">
<label>Instructions</label>
<frontend_type>textarea</frontend_type>
<sort_order>2</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</instructions>
ない私が間違って何をやったかを確認してください。私は下の絵の指示のテキストエリアを引き出したこれを持って私のSystem.Xmlのファイル内
。私はこの最初の投稿が長すぎるようには望んでいないので、それ以上のファイルが必要かどうか私に知らせてください。問題は私が提供したブロックファイル内にあると確信しています。
上記のファイルを作成する際にエラーが発生した場合は、誰でも教えてください。
あなたのconfig.xmlのペーストにも –