cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Adding an attribute to AbstractOrderModel or OrderModel

former_member630291
Participant
0 Likes
371

Hi Experts,

I've a requirement to add a boolean attribute for every orders. isEmailSent. By default, the value of this attribute would be false. A cronjob will fetch the orders from the database whose isEmailSent value is false. A business process will send an email to the customers. Once, the email is sent, the order will be saved into the database with isEmailSent to true.

I'm confused whether to add this attribute to AbstractOrderModel or OrderModel.

Can you please highlight the differences if I add it to either of the model?

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Likes

You add an attribute to AbstractOrderModel if you need it on Cart & Order both, since your requirement is to fetch the attribute's value from an already placed order. It doesn't make sense to have this attribute on Cart. So just put it in OrderModel and you should be fine.

former_member630291
Participant
0 Likes

Thanks. I found the answer in the code. :)

Answers (0)