<?php
/**
* Created by .
* User: jerryxu
* Date: 2019/5/5
* Time: 3:48 PM
*/
namespace McSizeModelPluginQuote;
use McSizeTraitsCommon;
/**
* Fixme Plugin Quote_Item_Custom_Field To Sales_Order_Item_Custom_Field
* Class McSizeToOrderItem
* @package McSizeModelPluginQuote
*/
class McSizeToOrderItem
{
/**
*
*/
use Common;
/** Fixme texting Debug
* @var int
* @return 0/1
*/
private $log = 1;
/**Fixme Overrde Method
* @param MagentoQuoteModelQuoteItemToOrderItem $subject
* @param Closure $proceed
* @param MagentoQuoteModelQuoteItemAbstractItem $item
* @param array $additional
* @return Item
*/
public function aroundConvert(
MagentoQuoteModelQuoteItemToOrderItem $subject,
Closure $proceed,
MagentoQuoteModelQuoteItemAbstractItem $item,
$additional = []
) {
/** @var $orderItem Item */
$orderItem = $proceed($item, $additional);
$orderItem->setSizeId($item->getSizeId());//Fixme Quote Item Custom Size_id To Sales Order Item Custom Size_id
$orderItem->setSizeType($item->setSizeType());//Fixme Quote Item Custom Size_type To Sales Order Item Custom Size_type
return $orderItem;
}
/** Fixme texting Debug
* @param MagentoQuoteModelQuoteItemToOrderItem $subject
* @param $data
* @return array
*/
public function beforeConvert(MagentoQuoteModelQuoteItemToOrderItem $subject, $data)
{
/**
* @var McSizeHelperData $helper
*/
if($this->log){
$helper = $this->mc_get_obj('McSizeHelperData');
$helper->logger(__(__METHOD__));
}
}
}