Magento付款信息块 [英] Magento Payment Info Block

查看:118
本文介绍了Magento付款信息块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了新的付款方式(网关).在此网关中,我将信息发送到银行以进行信用付款,并使用其他一些付款方式,例如姓名/人的年龄/人的利润/信用期限/...

I have created new payment method (gateway). In this gateway I sending information to bank for credit payment and I use some additional payment options like Name/Person Age/Person Profit/Credit Term/...

通过此字段,我可以计算信用期限,并将所有这些数据发送到银行.

By this fields I calculate Credit Term and send all of this data to bank.

我想在付款方式"信息块(默认主题的右侧栏)中显示此信息,但我不想将此字段保存到数据库中(因此稍后在管理区域中,我将获得类似standart Check/的信息.汇票付款和仅付款方式名称将是另一个)

I would like to show this information in Payment Method info block (right sidebar in default theme), but I would not like to save this fields to database (so in admin area later I will have information like it was standart Check/Money Order payment and just payment method name would be another)

我无法在付款方式"信息块中显示此字段,因为它仅显示存储在数据库中的字段以及我发现的唯一方式-将数据存储在核心/会话中,然后在信息块中取回该数据

I can't show this fields in Payment Method info block, because it shows only fields stored in database and only way that I found - store this data in core/session and then in info block retrieve this data back

我在付款模式"中做了类似的事情:

I doing something like this in Payment Model:

class OS_LacPayCS_Model_Payment extends Mage_Payment_Model_Method_Abstract
{
...
public function assignData($data)
{
    parent::assignData($data);
    $session = Mage::getSingleton('core/session');
    $session->setData('payment_additional', $data);
    return $this;
}
...
}

然后得到它

class OS_LacPayCS_Block_Payment_Info extends Mage_Payment_Block_Info
{
...
public function getPaymentInfo()
{
    $session = Mage::getSingleton('core/session');
    return $session->getData('payment_additional');
}
...
}

还有另一种获取此数据的方法吗?

Is there another way to get this data?

我还希望在结帐时在订单查看"选项卡中添加一些其他行,如何添加这些行而不重写查看模板并阻止?

And also I wish to add some additional rows in Order Review Tab on checkout, how can I add them w/o rewriting review template and block?

感谢

推荐答案

Magento付款api定义了extra_information字段,该字段保存为序列化数组到db,可用于存储可能需要显示的数据.您可以通过assignData($ data)方法在此处设置数据

Magento payment api defines additional_information field that is saved as serialized array to db and that you can use for storing the data you might need to display. You can set data to there by assignData($data) method

这篇关于Magento付款信息块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆