I am wondering which of the best ways to add some information to payment in magento (1.4.1.1).
Let's say I want to add information called "payment_duedate", which would be the date the client was supposed to pay their bill.
Actually there is a field in sales_flat_order_payment called "additional_information" that contains serialized data set by the setAdditionalInformation method ($ arg1, $ arg2); available in the sales / payment model. So I could save the date:
$payment->setAdditionalInformation('payment_duedate',$myDate); $payment->save();
But you can also add a payment attribute that would have an effect to create a new column named "payment_duedate" in "sales_flat_order_payment" and then save my date by doing:
$payment->setPaymentDuedate($myDate); $payment->save();
The main differences:
- with the "additional_information method", the data is serialized and therefore cannot be easily queried.
- with the setPaymentDuedate () "method, the data is requested and a new field is created in the table
So, in your opinion, which of the two methods is the best?
Thanks, Hugues.
liquidity
source share