How to add a method to the class orderItem?

Who knows how to add a method to the class OrderItem. The file is located here: /classes/modules/emarket/classes/orders/orderItem.php
I want to add together with the goods a parameter.
Create two methods:
/**
 * Get the value of the automobile, which is added to the order
 * @param Integer $auto the new value of the car in order
*/
 public function getAuto() {
 return $this->auto;
}

/**
 * To change the value of the car in order
 * @param Integer $auto the new value of the car in order
*/
 public function setAuto($auto) {
 $this->auto = (int) $auto;
 }

Also in methods, add the values:
/**
 * Apply changes
*/
 public function commit() {
 $object = $this->object;

 $object->item_price = $this->price;
 $object->item_total_original_price = $this->totalOriginalPrice;
 $object->item_total_price = $this->totalActualPrice;
 $object->item_amount = $this->amount;
 $object->item_auto = $this->auto;
 $object->item_discount_id = ($this->discount ? $this->discount->getId() : false);
 $object->item_link = $this->itemElement;

parent::commit();
 } 
/**
 * The class constructor. Indirectly called via orderItem::get() and orderItem::create()
 * @param umiObject $object the object name (to work with it, we inherit umiObjectProxy)
*/
 protected function __construct(umiObject $object) {
parent::__construct($object);

 $this->price = (float) $object->item_price;
 $this->totalOriginalPrice = (float) $object->item_total_original_price;
 $this->totalActualPrice = (float) $object->item_total_price;
 $this->amount = (float) $object->item_amount;
 $this->auto = (int) $object->item_auto;
 $this->discount = itemDiscount::get($object->item_discount_id);
 $this->itemElement = $object->item_link;
 }

All at the same time when I add a product to the cart to give the property avto. I get it and write it down. When adding a second item then the first this property becomes 0, and the second is desired. This can be seen in the picture, also when I turn the basket the parameter which should be all of your goods, but he always somehow equal to 0.
7985e7a9d70b47578045658f06360bbf.jpg
Also attach a link to two files where there was an edit
emarket download
May have added methods, give advice how can what I missed
July 8th 19 at 12:19
2 answers
July 8th 19 at 12:21
Solution
Attached to orderItem.php methods can be overwritten when you upgrade the system, so better not to do source edits, if upgrading the system then you will need.

To solve Your problem I would suggest to find in the admin guide "in the Name in order" and add the auto field to all operations with this field.
Agree with the answer and complement that does not need to display additional fields in the output macro recycle bin, it is possible to obtain by means of the templating engine, but if it is really necessary then can be solved using UMap or through cathomen macro. - Arne.Altenwerth63 commented on July 8th 19 at 12:24
Where it is in the directory "Name order", I have no such item. I was also thinking to implement but not found "Name order", through the base of the found data type is id = 43, and in the admin, if id see that is 41 and 44 under it immediately goes. Maybe where this item is disabled and needs to be enabled? All that is in the guide attached to the answer below - Cora_Lang commented on July 8th 19 at 12:27
By : references and data types have the ability to search, and search on the phrase "Name". - Arne.Altenwerth63 commented on July 8th 19 at 12:30
Guys thank you all, heartily earned all - Cora_Lang commented on July 8th 19 at 12:33
July 8th 19 at 12:23
Reference:
50fc37e9380c40d68b2b368b33e19e6e.png6da6ef7f419241ae846576bf2a4c91bb.png

Find more questions by tags UMI.CMSPHP