2

Whats the intended use for column customer_note that i find in a lot of tables. Ex qoute, quote_address, sales_invoice, sales_order.

I'm going to add a comment field for customers on checkout, and this seem like an ok field to use instead of adding more fileds to the tables.

I can't find any use in CE but i guess it's used in EE?

2

It's not used by CE or EE. It is likely kept for legacy reasons.

Many order comment extensions do use that customer_note field for storage, so your use case would not be out of the ordinary.

A better place would be the order comments/history, as stored in sales_order_status_history. You could use this in place of or in addition to the customer_note field. Status history records can be set to display on the order page and even included in emails under certain circumstances, so that might avoid extra work. You just need to save it on the order to start. See \Magento\Sales\Model\Order::addStatusHistory().

| improve this answer | |
  • 1
    I am going with the customer_note field since it seems to be hazzle free (no risk of beeing overwritten by any standard module). And its included everywhere its needed and already transfered from qoute to order without any extra work. Another thing i discovered is that customer_note is copied to sales_order_status_history. – TNordkvist Feb 24 '16 at 7:41
3

This field is used!

customer_note

This table field is used when a quote is created in the admin. If a comment is provided in the form field "Order Comments", then this comment will be saved in quote.customer_note. The value of this field will also be copied to the sales_order and sales_invoice tables.

customer_note_notify

This table field is also used when a quote is created in the admin. If you check the form checkbox "Append Comments" (this depends on the checkbox "Email Order Confirmation"), then this boolean will be saved in quote.customer_note_notify. The value of this field will also be copied to the sales_order and sales_invoice tables.

N.B.: Using this field in the frontend seems not to conflict with the default Magento 2 usage in de admin. As a matter of fact, it seems well setup to use it this way.

| improve this answer | |
1

As you can understand exact answer can give only magento core architect. I can share only my opinion.

Looks like magento don't use this field somehow. Most probably it was added on projecting stage and never used in magento (or used in old versions). In my practice I faced with such fields in other tables and used them for my own necessity.

In other words if you don't know add your own or use existing - I think better use this.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.