Magento: How to save data to order_payment and quote_payment

前端 未结 1 1267
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-28 01:46

I\'m trying to have a custom credit card payment attribute save to two different tables but I\'m not sure how to do this.

The normal credit card information saves to two

相关标签:
1条回答
  • 2021-01-28 02:09

    Did you configure Magento to convert the new attribute from quote to order? If you check the config.xml from the Mage_Sales module and search for sales_convert_quote_payment. You see something as follows:

           <sales_convert_quote_payment>
                <method><to_order_payment>*</to_order_payment></method>
                <additional_data><to_order_payment>*</to_order_payment></additional_data>
                <additional_information><to_order_payment>*</to_order_payment></additional_information>
                <po_number><to_order_payment>*</to_order_payment></po_number>
                <cc_type><to_order_payment>*</to_order_payment></cc_type>
                <cc_number_enc><to_order_payment>*</to_order_payment></cc_number_enc>
                <cc_last4><to_order_payment>*</to_order_payment></cc_last4>
                <cc_owner><to_order_payment>*</to_order_payment></cc_owner>
                <cc_exp_month><to_order_payment>*</to_order_payment></cc_exp_month>
                <cc_exp_year><to_order_payment>*</to_order_payment></cc_exp_year>
    
                <cc_number><to_order_payment>*</to_order_payment></cc_number>
                <cc_cid><to_order_payment>*</to_order_payment></cc_cid>
    
                <cc_ss_issue><to_order_payment>*</to_order_payment></cc_ss_issue>
                <cc_ss_start_month><to_order_payment>*</to_order_payment></cc_ss_start_month>
                <cc_ss_start_year><to_order_payment>*</to_order_payment></cc_ss_start_year>
            </sales_convert_quote_payment>
    

    Magento uses these fieldsets to transport data from entity to entity. In this case from the quote_payment to the order_payment.

    Since all config XML is merged into one big heap of XML, you can add additional nodes from your own modules config.xml. Something like:

    <global>
        <fieldsets>
            <sales_convert_quote_payment>
                <your_attribute><to_order_payment>*</to_order_payment></your_attribute>
            </sales_convert_quote_payment>
        </fieldsets>
    </global>
    

    Hope this helps you get underway.

    0 讨论(0)
提交回复
热议问题