Item.php 55 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Sales\Model\Order;
  7. use Magento\Framework\Api\AttributeValueFactory;
  8. use Magento\Sales\Api\Data\OrderItemInterface;
  9. use Magento\Sales\Model\AbstractModel;
  10. /**
  11. * Order Item Model
  12. *
  13. * @api
  14. * @method int getGiftMessageId()
  15. * @method \Magento\Sales\Model\Order\Item setGiftMessageId(int $value)
  16. * @method int getGiftMessageAvailable()
  17. * @method \Magento\Sales\Model\Order\Item setGiftMessageAvailable(int $value)
  18. * @SuppressWarnings(PHPMD.ExcessivePublicCount)
  19. * @SuppressWarnings(PHPMD.ExcessiveClassComplexity)
  20. * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
  21. * @since 100.0.2
  22. */
  23. class Item extends AbstractModel implements OrderItemInterface
  24. {
  25. const STATUS_PENDING = 1;
  26. // No items shipped, invoiced, canceled, refunded nor backordered
  27. const STATUS_SHIPPED = 2;
  28. // When qty ordered - [qty canceled + qty returned] = qty shipped
  29. const STATUS_INVOICED = 9;
  30. // When qty ordered - [qty canceled + qty returned] = qty invoiced
  31. const STATUS_BACKORDERED = 3;
  32. // When qty ordered - [qty canceled + qty returned] = qty backordered
  33. const STATUS_CANCELED = 5;
  34. // When qty ordered = qty canceled
  35. const STATUS_PARTIAL = 6;
  36. // If [qty shipped or(max of two) qty invoiced + qty canceled + qty returned]
  37. // < qty ordered
  38. const STATUS_MIXED = 7;
  39. // All other combinations
  40. const STATUS_REFUNDED = 8;
  41. // When qty ordered = qty refunded
  42. const STATUS_RETURNED = 4;
  43. // When qty ordered = qty returned // not used at the moment
  44. // When qty ordered = qty returned // not used at the moment
  45. protected $_eventPrefix = 'sales_order_item';
  46. /**
  47. * @var string
  48. */
  49. protected $_eventObject = 'item';
  50. /**
  51. * @var array
  52. */
  53. protected static $_statuses = null;
  54. /**
  55. * Order instance
  56. *
  57. * @var \Magento\Sales\Model\Order
  58. */
  59. protected $_order = null;
  60. /**
  61. * @var array
  62. */
  63. protected $_children = [];
  64. /**
  65. * @var \Magento\Sales\Model\OrderFactory
  66. */
  67. protected $_orderFactory;
  68. /**
  69. * @var \Magento\Catalog\Api\ProductRepositoryInterface
  70. */
  71. protected $productRepository;
  72. /**
  73. * @var \Magento\Store\Model\StoreManagerInterface
  74. */
  75. protected $_storeManager;
  76. /**
  77. * Serializer interface instance.
  78. *
  79. * @var \Magento\Framework\Serialize\Serializer\Json
  80. */
  81. private $serializer;
  82. /**
  83. * Initialize dependencies.
  84. *
  85. * @param \Magento\Framework\Model\Context $context
  86. * @param \Magento\Framework\Registry $registry
  87. * @param \Magento\Framework\Api\ExtensionAttributesFactory $extensionFactory
  88. * @param AttributeValueFactory $customAttributeFactory
  89. * @param \Magento\Sales\Model\OrderFactory $orderFactory
  90. * @param \Magento\Store\Model\StoreManagerInterface $storeManager
  91. * @param \Magento\Catalog\Api\ProductRepositoryInterface $productRepository
  92. * @param \Magento\Framework\Model\ResourceModel\AbstractResource $resource
  93. * @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection
  94. * @param array $data
  95. * @param \Magento\Framework\Serialize\Serializer\Json|null $serializer
  96. * @SuppressWarnings(PHPMD.ExcessiveParameterList)
  97. */
  98. public function __construct(
  99. \Magento\Framework\Model\Context $context,
  100. \Magento\Framework\Registry $registry,
  101. \Magento\Framework\Api\ExtensionAttributesFactory $extensionFactory,
  102. AttributeValueFactory $customAttributeFactory,
  103. \Magento\Sales\Model\OrderFactory $orderFactory,
  104. \Magento\Store\Model\StoreManagerInterface $storeManager,
  105. \Magento\Catalog\Api\ProductRepositoryInterface $productRepository,
  106. \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
  107. \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
  108. array $data = [],
  109. \Magento\Framework\Serialize\Serializer\Json $serializer = null
  110. ) {
  111. parent::__construct(
  112. $context,
  113. $registry,
  114. $extensionFactory,
  115. $customAttributeFactory,
  116. $resource,
  117. $resourceCollection,
  118. $data
  119. );
  120. $this->serializer = $serializer ?: \Magento\Framework\App\ObjectManager::getInstance()
  121. ->get(\Magento\Framework\Serialize\Serializer\Json::class);
  122. $this->_orderFactory = $orderFactory;
  123. $this->_storeManager = $storeManager;
  124. $this->productRepository = $productRepository;
  125. }
  126. /**
  127. * Init resource model
  128. *
  129. * @return void
  130. */
  131. protected function _construct()
  132. {
  133. $this->_init(\Magento\Sales\Model\ResourceModel\Order\Item::class);
  134. }
  135. /**
  136. * Set parent item
  137. *
  138. * @param Item $item
  139. * @return $this
  140. */
  141. public function setParentItem($item)
  142. {
  143. if ($item) {
  144. $this->setData(OrderItemInterface::PARENT_ITEM, $item);
  145. $item->setHasChildren(true);
  146. $item->addChildItem($this);
  147. }
  148. return $this;
  149. }
  150. /**
  151. * Get parent item
  152. *
  153. * @return OrderItemInterface|null
  154. */
  155. public function getParentItem()
  156. {
  157. return $this->getData(OrderItemInterface::PARENT_ITEM);
  158. }
  159. /**
  160. * Check item invoice availability
  161. *
  162. * @return bool
  163. */
  164. public function canInvoice()
  165. {
  166. return $this->getQtyToInvoice() > 0;
  167. }
  168. /**
  169. * Check item ship availability
  170. *
  171. * @return bool
  172. */
  173. public function canShip()
  174. {
  175. return $this->getQtyToShip() > 0;
  176. }
  177. /**
  178. * Check item refund availability
  179. *
  180. * @return bool
  181. */
  182. public function canRefund()
  183. {
  184. return $this->getQtyToRefund() > 0;
  185. }
  186. /**
  187. * Retrieve item qty available for ship
  188. *
  189. * @return float|integer
  190. */
  191. public function getQtyToShip()
  192. {
  193. if ($this->isDummy(true)) {
  194. return 0;
  195. }
  196. return $this->getSimpleQtyToShip();
  197. }
  198. /**
  199. * Retrieve item qty available for ship
  200. *
  201. * @return float|integer
  202. */
  203. public function getSimpleQtyToShip()
  204. {
  205. $qty = $this->getQtyOrdered() - $this->getQtyShipped() - $this->getQtyRefunded() - $this->getQtyCanceled();
  206. return max(round($qty, 8), 0);
  207. }
  208. /**
  209. * Retrieve item qty available for invoice
  210. *
  211. * @return float|integer
  212. */
  213. public function getQtyToInvoice()
  214. {
  215. if ($this->isDummy()) {
  216. return 0;
  217. }
  218. $qty = $this->getQtyOrdered() - $this->getQtyInvoiced() - $this->getQtyCanceled();
  219. return max(round($qty, 8), 0);
  220. }
  221. /**
  222. * Retrieve item qty available for refund
  223. *
  224. * @return float|integer
  225. */
  226. public function getQtyToRefund()
  227. {
  228. if ($this->isDummy()) {
  229. return 0;
  230. }
  231. return max($this->getQtyInvoiced() - $this->getQtyRefunded(), 0);
  232. }
  233. /**
  234. * Retrieve item qty available for cancel
  235. *
  236. * @return float|integer
  237. */
  238. public function getQtyToCancel()
  239. {
  240. $qtyToCancel = min($this->getQtyToInvoice(), $this->getQtyToShip());
  241. return max($qtyToCancel, 0);
  242. }
  243. /**
  244. * Declare order
  245. *
  246. * @param \Magento\Sales\Model\Order $order
  247. * @return $this
  248. */
  249. public function setOrder(\Magento\Sales\Model\Order $order)
  250. {
  251. $this->_order = $order;
  252. $this->setOrderId($order->getId());
  253. return $this;
  254. }
  255. /**
  256. * Retrieve order model object
  257. *
  258. * @return \Magento\Sales\Model\Order
  259. */
  260. public function getOrder()
  261. {
  262. if ($this->_order === null && ($orderId = $this->getOrderId())) {
  263. $order = $this->_orderFactory->create();
  264. $order->load($orderId);
  265. $this->setOrder($order);
  266. }
  267. return $this->_order;
  268. }
  269. /**
  270. * Retrieve item status identifier
  271. *
  272. * @return int
  273. * @SuppressWarnings(PHPMD.CyclomaticComplexity)
  274. * @SuppressWarnings(PHPMD.NPathComplexity)
  275. */
  276. public function getStatusId()
  277. {
  278. $backordered = (double)$this->getQtyBackordered();
  279. if (!$backordered && $this->getHasChildren()) {
  280. $backordered = (double)$this->_getQtyChildrenBackordered();
  281. }
  282. $canceled = (double)$this->getQtyCanceled();
  283. $invoiced = (double)$this->getQtyInvoiced();
  284. $ordered = (double)$this->getQtyOrdered();
  285. $refunded = (double)$this->getQtyRefunded();
  286. $shipped = (double)$this->getQtyShipped();
  287. $actuallyOrdered = $ordered - $canceled - $refunded;
  288. if (!$invoiced && !$shipped && !$refunded && !$canceled && !$backordered) {
  289. return self::STATUS_PENDING;
  290. }
  291. if ($shipped && $invoiced && $actuallyOrdered == $shipped) {
  292. return self::STATUS_SHIPPED;
  293. }
  294. if ($invoiced && !$shipped && $actuallyOrdered == $invoiced) {
  295. return self::STATUS_INVOICED;
  296. }
  297. if ($backordered && $actuallyOrdered == $backordered) {
  298. return self::STATUS_BACKORDERED;
  299. }
  300. if ($refunded && $ordered == $refunded) {
  301. return self::STATUS_REFUNDED;
  302. }
  303. if ($canceled && $ordered == $canceled) {
  304. return self::STATUS_CANCELED;
  305. }
  306. if (max($shipped, $invoiced) < $actuallyOrdered) {
  307. return self::STATUS_PARTIAL;
  308. }
  309. return self::STATUS_MIXED;
  310. }
  311. /**
  312. * Retrieve backordered qty of children items
  313. *
  314. * @return float|null
  315. */
  316. protected function _getQtyChildrenBackordered()
  317. {
  318. $backordered = null;
  319. foreach ($this->_children as $childItem) {
  320. $backordered += (double)$childItem->getQtyBackordered();
  321. }
  322. return $backordered;
  323. }
  324. /**
  325. * Retrieve status
  326. *
  327. * @return string
  328. */
  329. public function getStatus()
  330. {
  331. return $this->getStatusName($this->getStatusId());
  332. }
  333. /**
  334. * Retrieve status name
  335. *
  336. * @param string $statusId
  337. * @return \Magento\Framework\Phrase
  338. */
  339. public static function getStatusName($statusId)
  340. {
  341. if (self::$_statuses === null) {
  342. self::getStatuses();
  343. }
  344. if (isset(self::$_statuses[$statusId])) {
  345. return self::$_statuses[$statusId];
  346. }
  347. return __('Unknown Status');
  348. }
  349. /**
  350. * Cancel order item
  351. *
  352. * @return $this
  353. */
  354. public function cancel()
  355. {
  356. if ($this->getStatusId() !== self::STATUS_CANCELED) {
  357. $this->_eventManager->dispatch('sales_order_item_cancel', ['item' => $this]);
  358. $this->setQtyCanceled($this->getQtyToCancel());
  359. $this->setTaxCanceled(
  360. $this->getTaxCanceled() + $this->getBaseTaxAmount() * $this->getQtyCanceled() / $this->getQtyOrdered()
  361. );
  362. $this->setDiscountTaxCompensationCanceled(
  363. $this->getDiscountTaxCompensationCanceled() +
  364. $this->getDiscountTaxCompensationAmount() * $this->getQtyCanceled() / $this->getQtyOrdered()
  365. );
  366. }
  367. return $this;
  368. }
  369. /**
  370. * Retrieve order item statuses array
  371. *
  372. * @return array
  373. */
  374. public static function getStatuses()
  375. {
  376. if (self::$_statuses === null) {
  377. self::$_statuses = [
  378. self::STATUS_PENDING => __('Ordered'),
  379. self::STATUS_SHIPPED => __('Shipped'),
  380. self::STATUS_INVOICED => __('Invoiced'),
  381. self::STATUS_BACKORDERED => __('Backordered'),
  382. self::STATUS_RETURNED => __('Returned'),
  383. self::STATUS_REFUNDED => __('Refunded'),
  384. self::STATUS_CANCELED => __('Canceled'),
  385. self::STATUS_PARTIAL => __('Partial'),
  386. self::STATUS_MIXED => __('Mixed'),
  387. ];
  388. }
  389. return self::$_statuses;
  390. }
  391. /**
  392. * Redeclare getter for back compatibility
  393. *
  394. * @return float|null
  395. */
  396. public function getOriginalPrice()
  397. {
  398. $price = $this->getData(OrderItemInterface::ORIGINAL_PRICE);
  399. if ($price === null) {
  400. return $this->getPrice();
  401. }
  402. return $price;
  403. }
  404. /**
  405. * Set product options
  406. *
  407. * @param array $options
  408. * @return $this
  409. */
  410. public function setProductOptions(array $options = null)
  411. {
  412. $this->setData('product_options', $options);
  413. return $this;
  414. }
  415. /**
  416. * Get product options array
  417. *
  418. * @return array
  419. */
  420. public function getProductOptions()
  421. {
  422. $data = $this->_getData('product_options');
  423. if (is_string($data)) {
  424. $data = $this->serializer->unserialize($data);
  425. }
  426. return $data;
  427. }
  428. /**
  429. * Get product options array by code.
  430. *
  431. * If code is null return all options
  432. *
  433. * @param string $code
  434. * @return array
  435. */
  436. public function getProductOptionByCode($code = null)
  437. {
  438. $options = $this->getProductOptions();
  439. if ($code === null) {
  440. return $options;
  441. }
  442. if (isset($options[$code])) {
  443. return $options[$code];
  444. }
  445. return null;
  446. }
  447. /**
  448. * Return real product type of item or NULL if item is not composite
  449. *
  450. * @return string | null
  451. */
  452. public function getRealProductType()
  453. {
  454. $productType = $this->getProductOptionByCode('real_product_type');
  455. if ($productType) {
  456. return $productType;
  457. }
  458. return null;
  459. }
  460. /**
  461. * Adds child item to this item
  462. *
  463. * @param Item $item
  464. * @return void
  465. */
  466. public function addChildItem($item)
  467. {
  468. if ($item instanceof \Magento\Sales\Model\Order\Item) {
  469. $this->_children[] = $item;
  470. } elseif (is_array($item)) {
  471. $this->_children = array_merge($this->_children, $item);
  472. }
  473. }
  474. /**
  475. * Return children items of this item
  476. *
  477. * @return array
  478. */
  479. public function getChildrenItems()
  480. {
  481. return $this->_children;
  482. }
  483. /**
  484. * Return checking of what calculation type was for this product
  485. *
  486. * @return bool
  487. */
  488. public function isChildrenCalculated()
  489. {
  490. $parentItem = $this->getParentItem();
  491. if ($parentItem) {
  492. $options = $parentItem->getProductOptions();
  493. } else {
  494. $options = $this->getProductOptions();
  495. }
  496. if (isset(
  497. $options['product_calculations']
  498. ) && $options['product_calculations'] == \Magento\Catalog\Model\Product\Type\AbstractType::CALCULATE_CHILD
  499. ) {
  500. return true;
  501. }
  502. return false;
  503. }
  504. /**
  505. * Check if discount has to be applied to parent item
  506. *
  507. * @return bool
  508. * @SuppressWarnings(PHPMD.BooleanGetMethodName)
  509. */
  510. public function getForceApplyDiscountToParentItem()
  511. {
  512. if ($this->getParentItem()) {
  513. $product = $this->getParentItem()->getProduct();
  514. } else {
  515. $product = $this->getProduct();
  516. }
  517. return $product->getTypeInstance()->getForceApplyDiscountToParentItem();
  518. }
  519. /**
  520. * Return checking of what shipment type was for this product
  521. *
  522. * @return bool
  523. */
  524. public function isShipSeparately()
  525. {
  526. $parentItem = $this->getParentItem();
  527. if ($parentItem) {
  528. $options = $parentItem->getProductOptions();
  529. } else {
  530. $options = $this->getProductOptions();
  531. }
  532. if (isset(
  533. $options['shipment_type']
  534. ) && $options['shipment_type'] == \Magento\Catalog\Model\Product\Type\AbstractType::SHIPMENT_SEPARATELY
  535. ) {
  536. return true;
  537. }
  538. return false;
  539. }
  540. /**
  541. * This is Dummy item or not.
  542. *
  543. * If $shipment is true then we checking this for shipping situation if not, we checking this for calculation.
  544. *
  545. * @param bool $shipment
  546. * @return bool
  547. * @SuppressWarnings(PHPMD.CyclomaticComplexity)
  548. */
  549. public function isDummy($shipment = false)
  550. {
  551. if ($shipment) {
  552. if ($this->getHasChildren() && $this->isShipSeparately()) {
  553. return true;
  554. }
  555. if ($this->getHasChildren() && !$this->isShipSeparately()) {
  556. return false;
  557. }
  558. if ($this->getParentItem() && $this->isShipSeparately()) {
  559. return false;
  560. }
  561. if ($this->getParentItem() && !$this->isShipSeparately()) {
  562. return true;
  563. }
  564. } else {
  565. if ($this->getHasChildren() && $this->isChildrenCalculated()) {
  566. return true;
  567. }
  568. if ($this->getHasChildren() && !$this->isChildrenCalculated()) {
  569. return false;
  570. }
  571. if ($this->getParentItem() && $this->isChildrenCalculated()) {
  572. return false;
  573. }
  574. if ($this->getParentItem() && !$this->isChildrenCalculated()) {
  575. return true;
  576. }
  577. }
  578. return false;
  579. }
  580. /**
  581. * Return formatted buy request.
  582. *
  583. * This object is holding request received from product view page with keys and options for configured product.
  584. *
  585. * @return \Magento\Framework\DataObject
  586. */
  587. public function getBuyRequest()
  588. {
  589. $option = $this->getProductOptionByCode('info_buyRequest');
  590. if (!$option) {
  591. $option = [];
  592. }
  593. $buyRequest = new \Magento\Framework\DataObject($option);
  594. $buyRequest->setQty($this->getQtyOrdered() * 1);
  595. return $buyRequest;
  596. }
  597. /**
  598. * Retrieve product
  599. *
  600. * @return \Magento\Catalog\Model\Product|null
  601. */
  602. public function getProduct()
  603. {
  604. if (!$this->hasData('product')) {
  605. try {
  606. $product = $this->productRepository->getById($this->getProductId());
  607. } catch (\Magento\Framework\Exception\NoSuchEntityException $noEntityException) {
  608. $product = null;
  609. }
  610. $this->setProduct($product);
  611. }
  612. return $this->getData('product');
  613. }
  614. /**
  615. * Retrieve store model instance
  616. *
  617. * @return \Magento\Store\Model\Store
  618. */
  619. public function getStore()
  620. {
  621. $storeId = $this->getStoreId();
  622. if ($storeId) {
  623. return $this->_storeManager->getStore($storeId);
  624. }
  625. return $this->_storeManager->getStore();
  626. }
  627. //@codeCoverageIgnoreStart
  628. /**
  629. * Return additional_data
  630. *
  631. * @return string|null
  632. */
  633. public function getAdditionalData()
  634. {
  635. return $this->getData(OrderItemInterface::ADDITIONAL_DATA);
  636. }
  637. /**
  638. * Return amount_refunded
  639. *
  640. * @return float|null
  641. */
  642. public function getAmountRefunded()
  643. {
  644. return $this->getData(OrderItemInterface::AMOUNT_REFUNDED);
  645. }
  646. /**
  647. * Return applied_rule_ids
  648. *
  649. * Rules are comma separated if there are more than one.
  650. *
  651. * @return string|null
  652. */
  653. public function getAppliedRuleIds()
  654. {
  655. return $this->getData(OrderItemInterface::APPLIED_RULE_IDS);
  656. }
  657. /**
  658. * Return base_amount_refunded
  659. *
  660. * @return float|null
  661. */
  662. public function getBaseAmountRefunded()
  663. {
  664. return $this->getData(OrderItemInterface::BASE_AMOUNT_REFUNDED);
  665. }
  666. /**
  667. * Return base_cost
  668. *
  669. * @return float|null
  670. */
  671. public function getBaseCost()
  672. {
  673. return $this->getData(OrderItemInterface::BASE_COST);
  674. }
  675. /**
  676. * Return base_discount_amount
  677. *
  678. * @return float|null
  679. */
  680. public function getBaseDiscountAmount()
  681. {
  682. return $this->getData(OrderItemInterface::BASE_DISCOUNT_AMOUNT);
  683. }
  684. /**
  685. * Return base_discount_invoiced
  686. *
  687. * @return float|null
  688. */
  689. public function getBaseDiscountInvoiced()
  690. {
  691. return $this->getData(OrderItemInterface::BASE_DISCOUNT_INVOICED);
  692. }
  693. /**
  694. * Return base_discount_refunded
  695. *
  696. * @return float|null
  697. */
  698. public function getBaseDiscountRefunded()
  699. {
  700. return $this->getData(OrderItemInterface::BASE_DISCOUNT_REFUNDED);
  701. }
  702. /**
  703. * Return base_discount_tax_compensation_amount
  704. *
  705. * @return float|null
  706. */
  707. public function getBaseDiscountTaxCompensationAmount()
  708. {
  709. return $this->getData(OrderItemInterface::BASE_DISCOUNT_TAX_COMPENSATION_AMOUNT);
  710. }
  711. /**
  712. * Return base_discount_tax_compensation_invoiced
  713. *
  714. * @return float|null
  715. */
  716. public function getBaseDiscountTaxCompensationInvoiced()
  717. {
  718. return $this->getData(OrderItemInterface::BASE_DISCOUNT_TAX_COMPENSATION_INVOICED);
  719. }
  720. /**
  721. * Return base_discount_tax_compensation_refunded
  722. *
  723. * @return float|null
  724. */
  725. public function getBaseDiscountTaxCompensationRefunded()
  726. {
  727. return $this->getData(OrderItemInterface::BASE_DISCOUNT_TAX_COMPENSATION_REFUNDED);
  728. }
  729. /**
  730. * Return base_original_price
  731. *
  732. * @return float|null
  733. */
  734. public function getBaseOriginalPrice()
  735. {
  736. return $this->getData(OrderItemInterface::BASE_ORIGINAL_PRICE);
  737. }
  738. /**
  739. * Return base_price
  740. *
  741. * @return float|null
  742. */
  743. public function getBasePrice()
  744. {
  745. return $this->getData(OrderItemInterface::BASE_PRICE);
  746. }
  747. /**
  748. * Return base_price_incl_tax
  749. *
  750. * @return float|null
  751. */
  752. public function getBasePriceInclTax()
  753. {
  754. return $this->getData(OrderItemInterface::BASE_PRICE_INCL_TAX);
  755. }
  756. /**
  757. * Return base_row_invoiced
  758. *
  759. * @return float|null
  760. */
  761. public function getBaseRowInvoiced()
  762. {
  763. return $this->getData(OrderItemInterface::BASE_ROW_INVOICED);
  764. }
  765. /**
  766. * Return base_row_total
  767. *
  768. * @return float|null
  769. */
  770. public function getBaseRowTotal()
  771. {
  772. return $this->getData(OrderItemInterface::BASE_ROW_TOTAL);
  773. }
  774. /**
  775. * Return base_row_total_incl_tax
  776. *
  777. * @return float|null
  778. */
  779. public function getBaseRowTotalInclTax()
  780. {
  781. return $this->getData(OrderItemInterface::BASE_ROW_TOTAL_INCL_TAX);
  782. }
  783. /**
  784. * Return base_tax_amount
  785. *
  786. * @return float|null
  787. */
  788. public function getBaseTaxAmount()
  789. {
  790. return $this->getData(OrderItemInterface::BASE_TAX_AMOUNT);
  791. }
  792. /**
  793. * Return base_tax_before_discount
  794. *
  795. * @return float|null
  796. */
  797. public function getBaseTaxBeforeDiscount()
  798. {
  799. return $this->getData(OrderItemInterface::BASE_TAX_BEFORE_DISCOUNT);
  800. }
  801. /**
  802. * Return base_tax_invoiced
  803. *
  804. * @return float|null
  805. */
  806. public function getBaseTaxInvoiced()
  807. {
  808. return $this->getData(OrderItemInterface::BASE_TAX_INVOICED);
  809. }
  810. /**
  811. * Return base_tax_refunded
  812. *
  813. * @return float|null
  814. */
  815. public function getBaseTaxRefunded()
  816. {
  817. return $this->getData(OrderItemInterface::BASE_TAX_REFUNDED);
  818. }
  819. /**
  820. * Return base_weee_tax_applied_amount
  821. *
  822. * @return float|null
  823. */
  824. public function getBaseWeeeTaxAppliedAmount()
  825. {
  826. return $this->getData(OrderItemInterface::BASE_WEEE_TAX_APPLIED_AMOUNT);
  827. }
  828. /**
  829. * Return base_weee_tax_applied_row_amnt
  830. *
  831. * @return float|null
  832. */
  833. public function getBaseWeeeTaxAppliedRowAmnt()
  834. {
  835. return $this->getData(OrderItemInterface::BASE_WEEE_TAX_APPLIED_ROW_AMNT);
  836. }
  837. /**
  838. * Return base_weee_tax_disposition
  839. *
  840. * @return float|null
  841. */
  842. public function getBaseWeeeTaxDisposition()
  843. {
  844. return $this->getData(OrderItemInterface::BASE_WEEE_TAX_DISPOSITION);
  845. }
  846. /**
  847. * Return base_weee_tax_row_disposition
  848. *
  849. * @return float|null
  850. */
  851. public function getBaseWeeeTaxRowDisposition()
  852. {
  853. return $this->getData(OrderItemInterface::BASE_WEEE_TAX_ROW_DISPOSITION);
  854. }
  855. /**
  856. * Return created_at
  857. *
  858. * @return string|null
  859. */
  860. public function getCreatedAt()
  861. {
  862. return $this->getData(OrderItemInterface::CREATED_AT);
  863. }
  864. /**
  865. * @inheritdoc
  866. */
  867. public function setCreatedAt($createdAt)
  868. {
  869. return $this->setData(OrderItemInterface::CREATED_AT, $createdAt);
  870. }
  871. /**
  872. * Return description
  873. *
  874. * @return string|null
  875. */
  876. public function getDescription()
  877. {
  878. return $this->getData(OrderItemInterface::DESCRIPTION);
  879. }
  880. /**
  881. * Return discount_amount
  882. *
  883. * @return float|null
  884. */
  885. public function getDiscountAmount()
  886. {
  887. return $this->getData(OrderItemInterface::DISCOUNT_AMOUNT);
  888. }
  889. /**
  890. * Return discount_invoiced
  891. *
  892. * @return float|null
  893. */
  894. public function getDiscountInvoiced()
  895. {
  896. return $this->getData(OrderItemInterface::DISCOUNT_INVOICED);
  897. }
  898. /**
  899. * Return discount_percent
  900. *
  901. * @return float|null
  902. */
  903. public function getDiscountPercent()
  904. {
  905. return $this->getData(OrderItemInterface::DISCOUNT_PERCENT);
  906. }
  907. /**
  908. * Return discount_refunded
  909. *
  910. * @return float|null
  911. */
  912. public function getDiscountRefunded()
  913. {
  914. return $this->getData(OrderItemInterface::DISCOUNT_REFUNDED);
  915. }
  916. /**
  917. * Return event_id
  918. *
  919. * @return int|null
  920. */
  921. public function getEventId()
  922. {
  923. return $this->getData(OrderItemInterface::EVENT_ID);
  924. }
  925. /**
  926. * Return ext_order_item_id
  927. *
  928. * @return string|null
  929. */
  930. public function getExtOrderItemId()
  931. {
  932. return $this->getData(OrderItemInterface::EXT_ORDER_ITEM_ID);
  933. }
  934. /**
  935. * Return free_shipping
  936. *
  937. * @return int|null
  938. */
  939. public function getFreeShipping()
  940. {
  941. return $this->getData(OrderItemInterface::FREE_SHIPPING);
  942. }
  943. /**
  944. * Return gw_base_price
  945. *
  946. * @return float|null
  947. */
  948. public function getGwBasePrice()
  949. {
  950. return $this->getData(OrderItemInterface::GW_BASE_PRICE);
  951. }
  952. /**
  953. * Return gw_base_price_invoiced
  954. *
  955. * @return float|null
  956. */
  957. public function getGwBasePriceInvoiced()
  958. {
  959. return $this->getData(OrderItemInterface::GW_BASE_PRICE_INVOICED);
  960. }
  961. /**
  962. * Return gw_base_price_refunded
  963. *
  964. * @return float|null
  965. */
  966. public function getGwBasePriceRefunded()
  967. {
  968. return $this->getData(OrderItemInterface::GW_BASE_PRICE_REFUNDED);
  969. }
  970. /**
  971. * Return gw_base_tax_amount
  972. *
  973. * @return float|null
  974. */
  975. public function getGwBaseTaxAmount()
  976. {
  977. return $this->getData(OrderItemInterface::GW_BASE_TAX_AMOUNT);
  978. }
  979. /**
  980. * Return gw_base_tax_amount_invoiced
  981. *
  982. * @return float|null
  983. */
  984. public function getGwBaseTaxAmountInvoiced()
  985. {
  986. return $this->getData(OrderItemInterface::GW_BASE_TAX_AMOUNT_INVOICED);
  987. }
  988. /**
  989. * Return gw_base_tax_amount_refunded
  990. *
  991. * @return float|null
  992. */
  993. public function getGwBaseTaxAmountRefunded()
  994. {
  995. return $this->getData(OrderItemInterface::GW_BASE_TAX_AMOUNT_REFUNDED);
  996. }
  997. /**
  998. * Return gw_id
  999. *
  1000. * @return int|null
  1001. */
  1002. public function getGwId()
  1003. {
  1004. return $this->getData(OrderItemInterface::GW_ID);
  1005. }
  1006. /**
  1007. * Return gw_price
  1008. *
  1009. * @return float|null
  1010. */
  1011. public function getGwPrice()
  1012. {
  1013. return $this->getData(OrderItemInterface::GW_PRICE);
  1014. }
  1015. /**
  1016. * Return gw_price_invoiced
  1017. *
  1018. * @return float|null
  1019. */
  1020. public function getGwPriceInvoiced()
  1021. {
  1022. return $this->getData(OrderItemInterface::GW_PRICE_INVOICED);
  1023. }
  1024. /**
  1025. * Return gw_price_refunded
  1026. *
  1027. * @return float|null
  1028. */
  1029. public function getGwPriceRefunded()
  1030. {
  1031. return $this->getData(OrderItemInterface::GW_PRICE_REFUNDED);
  1032. }
  1033. /**
  1034. * Return gw_tax_amount
  1035. *
  1036. * @return float|null
  1037. */
  1038. public function getGwTaxAmount()
  1039. {
  1040. return $this->getData(OrderItemInterface::GW_TAX_AMOUNT);
  1041. }
  1042. /**
  1043. * Return gw_tax_amount_invoiced
  1044. *
  1045. * @return float|null
  1046. */
  1047. public function getGwTaxAmountInvoiced()
  1048. {
  1049. return $this->getData(OrderItemInterface::GW_TAX_AMOUNT_INVOICED);
  1050. }
  1051. /**
  1052. * Return gw_tax_amount_refunded
  1053. *
  1054. * @return float|null
  1055. */
  1056. public function getGwTaxAmountRefunded()
  1057. {
  1058. return $this->getData(OrderItemInterface::GW_TAX_AMOUNT_REFUNDED);
  1059. }
  1060. /**
  1061. * Return discount_tax_compensation_amount
  1062. *
  1063. * @return float|null
  1064. */
  1065. public function getDiscountTaxCompensationAmount()
  1066. {
  1067. return $this->getData(OrderItemInterface::DISCOUNT_TAX_COMPENSATION_AMOUNT);
  1068. }
  1069. /**
  1070. * Return discount_tax_compensation_canceled
  1071. *
  1072. * @return float|null
  1073. */
  1074. public function getDiscountTaxCompensationCanceled()
  1075. {
  1076. return $this->getData(OrderItemInterface::DISCOUNT_TAX_COMPENSATION_CANCELED);
  1077. }
  1078. /**
  1079. * Return discount_tax_compensation_invoiced
  1080. *
  1081. * @return float|null
  1082. */
  1083. public function getDiscountTaxCompensationInvoiced()
  1084. {
  1085. return $this->getData(OrderItemInterface::DISCOUNT_TAX_COMPENSATION_INVOICED);
  1086. }
  1087. /**
  1088. * Return discount_tax_compensation_refunded
  1089. *
  1090. * @return float|null
  1091. */
  1092. public function getDiscountTaxCompensationRefunded()
  1093. {
  1094. return $this->getData(OrderItemInterface::DISCOUNT_TAX_COMPENSATION_REFUNDED);
  1095. }
  1096. /**
  1097. * Return is_qty_decimal
  1098. *
  1099. * @return int|null
  1100. */
  1101. public function getIsQtyDecimal()
  1102. {
  1103. return $this->getData(OrderItemInterface::IS_QTY_DECIMAL);
  1104. }
  1105. /**
  1106. * Return is_virtual
  1107. *
  1108. * @return int|null
  1109. */
  1110. public function getIsVirtual()
  1111. {
  1112. return $this->getData(OrderItemInterface::IS_VIRTUAL);
  1113. }
  1114. /**
  1115. * Return item_id
  1116. *
  1117. * @return int|null
  1118. */
  1119. public function getItemId()
  1120. {
  1121. return $this->getData(OrderItemInterface::ITEM_ID);
  1122. }
  1123. /**
  1124. * Return locked_do_invoice
  1125. *
  1126. * @return int|null
  1127. */
  1128. public function getLockedDoInvoice()
  1129. {
  1130. return $this->getData(OrderItemInterface::LOCKED_DO_INVOICE);
  1131. }
  1132. /**
  1133. * Return locked_do_ship
  1134. *
  1135. * @return int|null
  1136. */
  1137. public function getLockedDoShip()
  1138. {
  1139. return $this->getData(OrderItemInterface::LOCKED_DO_SHIP);
  1140. }
  1141. /**
  1142. * Return name
  1143. *
  1144. * @return string|null
  1145. */
  1146. public function getName()
  1147. {
  1148. return $this->getData(OrderItemInterface::NAME);
  1149. }
  1150. /**
  1151. * Return no_discount
  1152. *
  1153. * @return int|null
  1154. */
  1155. public function getNoDiscount()
  1156. {
  1157. return $this->getData(OrderItemInterface::NO_DISCOUNT);
  1158. }
  1159. /**
  1160. * Return order_id
  1161. *
  1162. * @return int|null
  1163. */
  1164. public function getOrderId()
  1165. {
  1166. return $this->getData(OrderItemInterface::ORDER_ID);
  1167. }
  1168. /**
  1169. * Return parent_item_id
  1170. *
  1171. * @return int|null
  1172. */
  1173. public function getParentItemId()
  1174. {
  1175. return $this->getData(OrderItemInterface::PARENT_ITEM_ID);
  1176. }
  1177. /**
  1178. * Return price
  1179. *
  1180. * @return float|null
  1181. */
  1182. public function getPrice()
  1183. {
  1184. return $this->getData(OrderItemInterface::PRICE);
  1185. }
  1186. /**
  1187. * Return price_incl_tax
  1188. *
  1189. * @return float|null
  1190. */
  1191. public function getPriceInclTax()
  1192. {
  1193. return $this->getData(OrderItemInterface::PRICE_INCL_TAX);
  1194. }
  1195. /**
  1196. * Return product_id
  1197. *
  1198. * @return int|null
  1199. */
  1200. public function getProductId()
  1201. {
  1202. return $this->getData(OrderItemInterface::PRODUCT_ID);
  1203. }
  1204. /**
  1205. * Return product_type
  1206. *
  1207. * @return string|null
  1208. */
  1209. public function getProductType()
  1210. {
  1211. return $this->getData(OrderItemInterface::PRODUCT_TYPE);
  1212. }
  1213. /**
  1214. * Return qty_backordered
  1215. *
  1216. * @return float|null
  1217. */
  1218. public function getQtyBackordered()
  1219. {
  1220. return $this->getData(OrderItemInterface::QTY_BACKORDERED);
  1221. }
  1222. /**
  1223. * Return qty_canceled
  1224. *
  1225. * @return float|null
  1226. */
  1227. public function getQtyCanceled()
  1228. {
  1229. return $this->getData(OrderItemInterface::QTY_CANCELED);
  1230. }
  1231. /**
  1232. * Return qty_invoiced
  1233. *
  1234. * @return float|null
  1235. */
  1236. public function getQtyInvoiced()
  1237. {
  1238. return $this->getData(OrderItemInterface::QTY_INVOICED);
  1239. }
  1240. /**
  1241. * Return qty_ordered
  1242. *
  1243. * @return float|null
  1244. */
  1245. public function getQtyOrdered()
  1246. {
  1247. return $this->getData(OrderItemInterface::QTY_ORDERED);
  1248. }
  1249. /**
  1250. * Return qty_refunded
  1251. *
  1252. * @return float|null
  1253. */
  1254. public function getQtyRefunded()
  1255. {
  1256. return $this->getData(OrderItemInterface::QTY_REFUNDED);
  1257. }
  1258. /**
  1259. * Return qty_returned
  1260. *
  1261. * @return float|null
  1262. */
  1263. public function getQtyReturned()
  1264. {
  1265. return $this->getData(OrderItemInterface::QTY_RETURNED);
  1266. }
  1267. /**
  1268. * Return qty_shipped
  1269. *
  1270. * @return float|null
  1271. */
  1272. public function getQtyShipped()
  1273. {
  1274. return $this->getData(OrderItemInterface::QTY_SHIPPED);
  1275. }
  1276. /**
  1277. * Return quote_item_id
  1278. *
  1279. * @return int|null
  1280. */
  1281. public function getQuoteItemId()
  1282. {
  1283. return $this->getData(OrderItemInterface::QUOTE_ITEM_ID);
  1284. }
  1285. /**
  1286. * Return row_invoiced
  1287. *
  1288. * @return float|null
  1289. */
  1290. public function getRowInvoiced()
  1291. {
  1292. return $this->getData(OrderItemInterface::ROW_INVOICED);
  1293. }
  1294. /**
  1295. * Return row_total
  1296. *
  1297. * @return float|null
  1298. */
  1299. public function getRowTotal()
  1300. {
  1301. return $this->getData(OrderItemInterface::ROW_TOTAL);
  1302. }
  1303. /**
  1304. * Return row_total_incl_tax
  1305. *
  1306. * @return float|null
  1307. */
  1308. public function getRowTotalInclTax()
  1309. {
  1310. return $this->getData(OrderItemInterface::ROW_TOTAL_INCL_TAX);
  1311. }
  1312. /**
  1313. * Return row_weight
  1314. *
  1315. * @return float|null
  1316. */
  1317. public function getRowWeight()
  1318. {
  1319. return $this->getData(OrderItemInterface::ROW_WEIGHT);
  1320. }
  1321. /**
  1322. * Return sku
  1323. *
  1324. * @return string
  1325. */
  1326. public function getSku()
  1327. {
  1328. return $this->getData(OrderItemInterface::SKU);
  1329. }
  1330. /**
  1331. * Return store_id
  1332. *
  1333. * @return int|null
  1334. */
  1335. public function getStoreId()
  1336. {
  1337. return $this->getData(OrderItemInterface::STORE_ID);
  1338. }
  1339. /**
  1340. * Return tax_amount
  1341. *
  1342. * @return float|null
  1343. */
  1344. public function getTaxAmount()
  1345. {
  1346. return $this->getData(OrderItemInterface::TAX_AMOUNT);
  1347. }
  1348. /**
  1349. * Return tax_before_discount
  1350. *
  1351. * @return float|null
  1352. */
  1353. public function getTaxBeforeDiscount()
  1354. {
  1355. return $this->getData(OrderItemInterface::TAX_BEFORE_DISCOUNT);
  1356. }
  1357. /**
  1358. * Return tax_canceled
  1359. *
  1360. * @return float|null
  1361. */
  1362. public function getTaxCanceled()
  1363. {
  1364. return $this->getData(OrderItemInterface::TAX_CANCELED);
  1365. }
  1366. /**
  1367. * Return tax_invoiced
  1368. *
  1369. * @return float|null
  1370. */
  1371. public function getTaxInvoiced()
  1372. {
  1373. return $this->getData(OrderItemInterface::TAX_INVOICED);
  1374. }
  1375. /**
  1376. * Return tax_percent
  1377. *
  1378. * @return float|null
  1379. */
  1380. public function getTaxPercent()
  1381. {
  1382. return $this->getData(OrderItemInterface::TAX_PERCENT);
  1383. }
  1384. /**
  1385. * Return tax_refunded
  1386. *
  1387. * @return float|null
  1388. */
  1389. public function getTaxRefunded()
  1390. {
  1391. return $this->getData(OrderItemInterface::TAX_REFUNDED);
  1392. }
  1393. /**
  1394. * Return updated_at
  1395. *
  1396. * @return string|null
  1397. */
  1398. public function getUpdatedAt()
  1399. {
  1400. return $this->getData(OrderItemInterface::UPDATED_AT);
  1401. }
  1402. /**
  1403. * Return weee_tax_applied
  1404. *
  1405. * @return string|null
  1406. */
  1407. public function getWeeeTaxApplied()
  1408. {
  1409. return $this->getData(OrderItemInterface::WEEE_TAX_APPLIED);
  1410. }
  1411. /**
  1412. * Return weee_tax_applied_amount
  1413. *
  1414. * @return float|null
  1415. */
  1416. public function getWeeeTaxAppliedAmount()
  1417. {
  1418. return $this->getData(OrderItemInterface::WEEE_TAX_APPLIED_AMOUNT);
  1419. }
  1420. /**
  1421. * Return weee_tax_applied_row_amount
  1422. *
  1423. * @return float|null
  1424. */
  1425. public function getWeeeTaxAppliedRowAmount()
  1426. {
  1427. return $this->getData(OrderItemInterface::WEEE_TAX_APPLIED_ROW_AMOUNT);
  1428. }
  1429. /**
  1430. * Return weee_tax_disposition
  1431. *
  1432. * @return float|null
  1433. */
  1434. public function getWeeeTaxDisposition()
  1435. {
  1436. return $this->getData(OrderItemInterface::WEEE_TAX_DISPOSITION);
  1437. }
  1438. /**
  1439. * Return weee_tax_row_disposition
  1440. *
  1441. * @return float|null
  1442. */
  1443. public function getWeeeTaxRowDisposition()
  1444. {
  1445. return $this->getData(OrderItemInterface::WEEE_TAX_ROW_DISPOSITION);
  1446. }
  1447. /**
  1448. * Return weight
  1449. *
  1450. * @return float|null
  1451. */
  1452. public function getWeight()
  1453. {
  1454. return $this->getData(OrderItemInterface::WEIGHT);
  1455. }
  1456. /**
  1457. * @inheritdoc
  1458. */
  1459. public function setUpdatedAt($timestamp)
  1460. {
  1461. return $this->setData(OrderItemInterface::UPDATED_AT, $timestamp);
  1462. }
  1463. /**
  1464. * @inheritdoc
  1465. */
  1466. public function setItemId($id)
  1467. {
  1468. return $this->setData(OrderItemInterface::ITEM_ID, $id);
  1469. }
  1470. /**
  1471. * @inheritdoc
  1472. */
  1473. public function setOrderId($id)
  1474. {
  1475. return $this->setData(OrderItemInterface::ORDER_ID, $id);
  1476. }
  1477. /**
  1478. * @inheritdoc
  1479. */
  1480. public function setParentItemId($id)
  1481. {
  1482. return $this->setData(OrderItemInterface::PARENT_ITEM_ID, $id);
  1483. }
  1484. /**
  1485. * @inheritdoc
  1486. */
  1487. public function setQuoteItemId($id)
  1488. {
  1489. return $this->setData(OrderItemInterface::QUOTE_ITEM_ID, $id);
  1490. }
  1491. /**
  1492. * @inheritdoc
  1493. */
  1494. public function setStoreId($id)
  1495. {
  1496. return $this->setData(OrderItemInterface::STORE_ID, $id);
  1497. }
  1498. /**
  1499. * @inheritdoc
  1500. */
  1501. public function setProductId($id)
  1502. {
  1503. return $this->setData(OrderItemInterface::PRODUCT_ID, $id);
  1504. }
  1505. /**
  1506. * @inheritdoc
  1507. */
  1508. public function setProductType($productType)
  1509. {
  1510. return $this->setData(OrderItemInterface::PRODUCT_TYPE, $productType);
  1511. }
  1512. /**
  1513. * @inheritdoc
  1514. */
  1515. public function setWeight($weight)
  1516. {
  1517. return $this->setData(OrderItemInterface::WEIGHT, $weight);
  1518. }
  1519. /**
  1520. * @inheritdoc
  1521. */
  1522. public function setIsVirtual($isVirtual)
  1523. {
  1524. return $this->setData(OrderItemInterface::IS_VIRTUAL, $isVirtual);
  1525. }
  1526. /**
  1527. * @inheritdoc
  1528. */
  1529. public function setSku($sku)
  1530. {
  1531. return $this->setData(OrderItemInterface::SKU, $sku);
  1532. }
  1533. /**
  1534. * @inheritdoc
  1535. */
  1536. public function setName($name)
  1537. {
  1538. return $this->setData(OrderItemInterface::NAME, $name);
  1539. }
  1540. /**
  1541. * @inheritdoc
  1542. */
  1543. public function setDescription($description)
  1544. {
  1545. return $this->setData(OrderItemInterface::DESCRIPTION, $description);
  1546. }
  1547. /**
  1548. * @inheritdoc
  1549. */
  1550. public function setAppliedRuleIds($appliedRuleIds)
  1551. {
  1552. return $this->setData(OrderItemInterface::APPLIED_RULE_IDS, $appliedRuleIds);
  1553. }
  1554. /**
  1555. * @inheritdoc
  1556. */
  1557. public function setAdditionalData($additionalData)
  1558. {
  1559. return $this->setData(OrderItemInterface::ADDITIONAL_DATA, $additionalData);
  1560. }
  1561. /**
  1562. * @inheritdoc
  1563. */
  1564. public function setIsQtyDecimal($isQtyDecimal)
  1565. {
  1566. return $this->setData(OrderItemInterface::IS_QTY_DECIMAL, $isQtyDecimal);
  1567. }
  1568. /**
  1569. * @inheritdoc
  1570. */
  1571. public function setNoDiscount($noDiscount)
  1572. {
  1573. return $this->setData(OrderItemInterface::NO_DISCOUNT, $noDiscount);
  1574. }
  1575. /**
  1576. * @inheritdoc
  1577. */
  1578. public function setQtyBackordered($qtyBackordered)
  1579. {
  1580. return $this->setData(OrderItemInterface::QTY_BACKORDERED, $qtyBackordered);
  1581. }
  1582. /**
  1583. * @inheritdoc
  1584. */
  1585. public function setQtyCanceled($qtyCanceled)
  1586. {
  1587. return $this->setData(OrderItemInterface::QTY_CANCELED, $qtyCanceled);
  1588. }
  1589. /**
  1590. * @inheritdoc
  1591. */
  1592. public function setQtyInvoiced($qtyInvoiced)
  1593. {
  1594. return $this->setData(OrderItemInterface::QTY_INVOICED, $qtyInvoiced);
  1595. }
  1596. /**
  1597. * @inheritdoc
  1598. */
  1599. public function setQtyOrdered($qtyOrdered)
  1600. {
  1601. return $this->setData(OrderItemInterface::QTY_ORDERED, $qtyOrdered);
  1602. }
  1603. /**
  1604. * @inheritdoc
  1605. */
  1606. public function setQtyRefunded($qtyRefunded)
  1607. {
  1608. return $this->setData(OrderItemInterface::QTY_REFUNDED, $qtyRefunded);
  1609. }
  1610. /**
  1611. * @inheritdoc
  1612. */
  1613. public function setQtyShipped($qtyShipped)
  1614. {
  1615. return $this->setData(OrderItemInterface::QTY_SHIPPED, $qtyShipped);
  1616. }
  1617. /**
  1618. * @inheritdoc
  1619. */
  1620. public function setBaseCost($baseCost)
  1621. {
  1622. return $this->setData(OrderItemInterface::BASE_COST, $baseCost);
  1623. }
  1624. /**
  1625. * @inheritdoc
  1626. */
  1627. public function setPrice($price)
  1628. {
  1629. return $this->setData(OrderItemInterface::PRICE, $price);
  1630. }
  1631. /**
  1632. * @inheritdoc
  1633. */
  1634. public function setBasePrice($price)
  1635. {
  1636. return $this->setData(OrderItemInterface::BASE_PRICE, $price);
  1637. }
  1638. /**
  1639. * @inheritdoc
  1640. */
  1641. public function setOriginalPrice($price)
  1642. {
  1643. return $this->setData(OrderItemInterface::ORIGINAL_PRICE, $price);
  1644. }
  1645. /**
  1646. * @inheritdoc
  1647. */
  1648. public function setBaseOriginalPrice($price)
  1649. {
  1650. return $this->setData(OrderItemInterface::BASE_ORIGINAL_PRICE, $price);
  1651. }
  1652. /**
  1653. * @inheritdoc
  1654. */
  1655. public function setTaxPercent($taxPercent)
  1656. {
  1657. return $this->setData(OrderItemInterface::TAX_PERCENT, $taxPercent);
  1658. }
  1659. /**
  1660. * @inheritdoc
  1661. */
  1662. public function setTaxAmount($amount)
  1663. {
  1664. return $this->setData(OrderItemInterface::TAX_AMOUNT, $amount);
  1665. }
  1666. /**
  1667. * @inheritdoc
  1668. */
  1669. public function setBaseTaxAmount($amount)
  1670. {
  1671. return $this->setData(OrderItemInterface::BASE_TAX_AMOUNT, $amount);
  1672. }
  1673. /**
  1674. * @inheritdoc
  1675. */
  1676. public function setTaxInvoiced($taxInvoiced)
  1677. {
  1678. return $this->setData(OrderItemInterface::TAX_INVOICED, $taxInvoiced);
  1679. }
  1680. /**
  1681. * @inheritdoc
  1682. */
  1683. public function setBaseTaxInvoiced($baseTaxInvoiced)
  1684. {
  1685. return $this->setData(OrderItemInterface::BASE_TAX_INVOICED, $baseTaxInvoiced);
  1686. }
  1687. /**
  1688. * @inheritdoc
  1689. */
  1690. public function setDiscountPercent($discountPercent)
  1691. {
  1692. return $this->setData(OrderItemInterface::DISCOUNT_PERCENT, $discountPercent);
  1693. }
  1694. /**
  1695. * @inheritdoc
  1696. */
  1697. public function setDiscountAmount($amount)
  1698. {
  1699. return $this->setData(OrderItemInterface::DISCOUNT_AMOUNT, $amount);
  1700. }
  1701. /**
  1702. * @inheritdoc
  1703. */
  1704. public function setBaseDiscountAmount($amount)
  1705. {
  1706. return $this->setData(OrderItemInterface::BASE_DISCOUNT_AMOUNT, $amount);
  1707. }
  1708. /**
  1709. * @inheritdoc
  1710. */
  1711. public function setDiscountInvoiced($discountInvoiced)
  1712. {
  1713. return $this->setData(OrderItemInterface::DISCOUNT_INVOICED, $discountInvoiced);
  1714. }
  1715. /**
  1716. * @inheritdoc
  1717. */
  1718. public function setBaseDiscountInvoiced($baseDiscountInvoiced)
  1719. {
  1720. return $this->setData(OrderItemInterface::BASE_DISCOUNT_INVOICED, $baseDiscountInvoiced);
  1721. }
  1722. /**
  1723. * @inheritdoc
  1724. */
  1725. public function setAmountRefunded($amountRefunded)
  1726. {
  1727. return $this->setData(OrderItemInterface::AMOUNT_REFUNDED, $amountRefunded);
  1728. }
  1729. /**
  1730. * @inheritdoc
  1731. */
  1732. public function setBaseAmountRefunded($baseAmountRefunded)
  1733. {
  1734. return $this->setData(OrderItemInterface::BASE_AMOUNT_REFUNDED, $baseAmountRefunded);
  1735. }
  1736. /**
  1737. * @inheritdoc
  1738. */
  1739. public function setRowTotal($amount)
  1740. {
  1741. return $this->setData(OrderItemInterface::ROW_TOTAL, $amount);
  1742. }
  1743. /**
  1744. * @inheritdoc
  1745. */
  1746. public function setBaseRowTotal($amount)
  1747. {
  1748. return $this->setData(OrderItemInterface::BASE_ROW_TOTAL, $amount);
  1749. }
  1750. /**
  1751. * @inheritdoc
  1752. */
  1753. public function setRowInvoiced($rowInvoiced)
  1754. {
  1755. return $this->setData(OrderItemInterface::ROW_INVOICED, $rowInvoiced);
  1756. }
  1757. /**
  1758. * @inheritdoc
  1759. */
  1760. public function setBaseRowInvoiced($baseRowInvoiced)
  1761. {
  1762. return $this->setData(OrderItemInterface::BASE_ROW_INVOICED, $baseRowInvoiced);
  1763. }
  1764. /**
  1765. * @inheritdoc
  1766. */
  1767. public function setRowWeight($rowWeight)
  1768. {
  1769. return $this->setData(OrderItemInterface::ROW_WEIGHT, $rowWeight);
  1770. }
  1771. /**
  1772. * @inheritdoc
  1773. */
  1774. public function setBaseTaxBeforeDiscount($baseTaxBeforeDiscount)
  1775. {
  1776. return $this->setData(OrderItemInterface::BASE_TAX_BEFORE_DISCOUNT, $baseTaxBeforeDiscount);
  1777. }
  1778. /**
  1779. * @inheritdoc
  1780. */
  1781. public function setTaxBeforeDiscount($taxBeforeDiscount)
  1782. {
  1783. return $this->setData(OrderItemInterface::TAX_BEFORE_DISCOUNT, $taxBeforeDiscount);
  1784. }
  1785. /**
  1786. * @inheritdoc
  1787. */
  1788. public function setExtOrderItemId($id)
  1789. {
  1790. return $this->setData(OrderItemInterface::EXT_ORDER_ITEM_ID, $id);
  1791. }
  1792. /**
  1793. * @inheritdoc
  1794. */
  1795. public function setLockedDoInvoice($flag)
  1796. {
  1797. return $this->setData(OrderItemInterface::LOCKED_DO_INVOICE, $flag);
  1798. }
  1799. /**
  1800. * @inheritdoc
  1801. */
  1802. public function setLockedDoShip($flag)
  1803. {
  1804. return $this->setData(OrderItemInterface::LOCKED_DO_SHIP, $flag);
  1805. }
  1806. /**
  1807. * @inheritdoc
  1808. */
  1809. public function setPriceInclTax($amount)
  1810. {
  1811. return $this->setData(OrderItemInterface::PRICE_INCL_TAX, $amount);
  1812. }
  1813. /**
  1814. * @inheritdoc
  1815. */
  1816. public function setBasePriceInclTax($amount)
  1817. {
  1818. return $this->setData(OrderItemInterface::BASE_PRICE_INCL_TAX, $amount);
  1819. }
  1820. /**
  1821. * @inheritdoc
  1822. */
  1823. public function setRowTotalInclTax($amount)
  1824. {
  1825. return $this->setData(OrderItemInterface::ROW_TOTAL_INCL_TAX, $amount);
  1826. }
  1827. /**
  1828. * @inheritdoc
  1829. */
  1830. public function setBaseRowTotalInclTax($amount)
  1831. {
  1832. return $this->setData(OrderItemInterface::BASE_ROW_TOTAL_INCL_TAX, $amount);
  1833. }
  1834. /**
  1835. * @inheritdoc
  1836. */
  1837. public function setDiscountTaxCompensationAmount($amount)
  1838. {
  1839. return $this->setData(OrderItemInterface::DISCOUNT_TAX_COMPENSATION_AMOUNT, $amount);
  1840. }
  1841. /**
  1842. * @inheritdoc
  1843. */
  1844. public function setBaseDiscountTaxCompensationAmount($amount)
  1845. {
  1846. return $this->setData(OrderItemInterface::BASE_DISCOUNT_TAX_COMPENSATION_AMOUNT, $amount);
  1847. }
  1848. /**
  1849. * @inheritdoc
  1850. */
  1851. public function setDiscountTaxCompensationInvoiced($discountTaxCompensationInvoiced)
  1852. {
  1853. return $this->setData(OrderItemInterface::DISCOUNT_TAX_COMPENSATION_INVOICED, $discountTaxCompensationInvoiced);
  1854. }
  1855. /**
  1856. * @inheritdoc
  1857. */
  1858. public function setBaseDiscountTaxCompensationInvoiced($baseDiscountTaxCompensationInvoiced)
  1859. {
  1860. return $this->setData(
  1861. OrderItemInterface::BASE_DISCOUNT_TAX_COMPENSATION_INVOICED,
  1862. $baseDiscountTaxCompensationInvoiced
  1863. );
  1864. }
  1865. /**
  1866. * @inheritdoc
  1867. */
  1868. public function setDiscountTaxCompensationRefunded($discountTaxCompensationRefunded)
  1869. {
  1870. return $this->setData(OrderItemInterface::DISCOUNT_TAX_COMPENSATION_REFUNDED, $discountTaxCompensationRefunded);
  1871. }
  1872. /**
  1873. * @inheritdoc
  1874. */
  1875. public function setBaseDiscountTaxCompensationRefunded($baseDiscountTaxCompensationRefunded)
  1876. {
  1877. return $this->setData(
  1878. OrderItemInterface::BASE_DISCOUNT_TAX_COMPENSATION_REFUNDED,
  1879. $baseDiscountTaxCompensationRefunded
  1880. );
  1881. }
  1882. /**
  1883. * @inheritdoc
  1884. */
  1885. public function setTaxCanceled($taxCanceled)
  1886. {
  1887. return $this->setData(OrderItemInterface::TAX_CANCELED, $taxCanceled);
  1888. }
  1889. /**
  1890. * @inheritdoc
  1891. */
  1892. public function setDiscountTaxCompensationCanceled($discountTaxCompensationCanceled)
  1893. {
  1894. return $this->setData(OrderItemInterface::DISCOUNT_TAX_COMPENSATION_CANCELED, $discountTaxCompensationCanceled);
  1895. }
  1896. /**
  1897. * @inheritdoc
  1898. */
  1899. public function setTaxRefunded($taxRefunded)
  1900. {
  1901. return $this->setData(OrderItemInterface::TAX_REFUNDED, $taxRefunded);
  1902. }
  1903. /**
  1904. * @inheritdoc
  1905. */
  1906. public function setBaseTaxRefunded($baseTaxRefunded)
  1907. {
  1908. return $this->setData(OrderItemInterface::BASE_TAX_REFUNDED, $baseTaxRefunded);
  1909. }
  1910. /**
  1911. * @inheritdoc
  1912. */
  1913. public function setDiscountRefunded($discountRefunded)
  1914. {
  1915. return $this->setData(OrderItemInterface::DISCOUNT_REFUNDED, $discountRefunded);
  1916. }
  1917. /**
  1918. * @inheritdoc
  1919. */
  1920. public function setBaseDiscountRefunded($baseDiscountRefunded)
  1921. {
  1922. return $this->setData(OrderItemInterface::BASE_DISCOUNT_REFUNDED, $baseDiscountRefunded);
  1923. }
  1924. /**
  1925. * @inheritdoc
  1926. */
  1927. public function setGwId($id)
  1928. {
  1929. return $this->setData(OrderItemInterface::GW_ID, $id);
  1930. }
  1931. /**
  1932. * @inheritdoc
  1933. */
  1934. public function setGwBasePrice($price)
  1935. {
  1936. return $this->setData(OrderItemInterface::GW_BASE_PRICE, $price);
  1937. }
  1938. /**
  1939. * @inheritdoc
  1940. */
  1941. public function setGwPrice($price)
  1942. {
  1943. return $this->setData(OrderItemInterface::GW_PRICE, $price);
  1944. }
  1945. /**
  1946. * @inheritdoc
  1947. */
  1948. public function setGwBaseTaxAmount($amount)
  1949. {
  1950. return $this->setData(OrderItemInterface::GW_BASE_TAX_AMOUNT, $amount);
  1951. }
  1952. /**
  1953. * @inheritdoc
  1954. */
  1955. public function setGwTaxAmount($amount)
  1956. {
  1957. return $this->setData(OrderItemInterface::GW_TAX_AMOUNT, $amount);
  1958. }
  1959. /**
  1960. * @inheritdoc
  1961. */
  1962. public function setGwBasePriceInvoiced($gwBasePriceInvoiced)
  1963. {
  1964. return $this->setData(OrderItemInterface::GW_BASE_PRICE_INVOICED, $gwBasePriceInvoiced);
  1965. }
  1966. /**
  1967. * @inheritdoc
  1968. */
  1969. public function setGwPriceInvoiced($gwPriceInvoiced)
  1970. {
  1971. return $this->setData(OrderItemInterface::GW_PRICE_INVOICED, $gwPriceInvoiced);
  1972. }
  1973. /**
  1974. * @inheritdoc
  1975. */
  1976. public function setGwBaseTaxAmountInvoiced($gwBaseTaxAmountInvoiced)
  1977. {
  1978. return $this->setData(OrderItemInterface::GW_BASE_TAX_AMOUNT_INVOICED, $gwBaseTaxAmountInvoiced);
  1979. }
  1980. /**
  1981. * @inheritdoc
  1982. */
  1983. public function setGwTaxAmountInvoiced($gwTaxAmountInvoiced)
  1984. {
  1985. return $this->setData(OrderItemInterface::GW_TAX_AMOUNT_INVOICED, $gwTaxAmountInvoiced);
  1986. }
  1987. /**
  1988. * @inheritdoc
  1989. */
  1990. public function setGwBasePriceRefunded($gwBasePriceRefunded)
  1991. {
  1992. return $this->setData(OrderItemInterface::GW_BASE_PRICE_REFUNDED, $gwBasePriceRefunded);
  1993. }
  1994. /**
  1995. * @inheritdoc
  1996. */
  1997. public function setGwPriceRefunded($gwPriceRefunded)
  1998. {
  1999. return $this->setData(OrderItemInterface::GW_PRICE_REFUNDED, $gwPriceRefunded);
  2000. }
  2001. /**
  2002. * @inheritdoc
  2003. */
  2004. public function setGwBaseTaxAmountRefunded($gwBaseTaxAmountRefunded)
  2005. {
  2006. return $this->setData(OrderItemInterface::GW_BASE_TAX_AMOUNT_REFUNDED, $gwBaseTaxAmountRefunded);
  2007. }
  2008. /**
  2009. * @inheritdoc
  2010. */
  2011. public function setGwTaxAmountRefunded($gwTaxAmountRefunded)
  2012. {
  2013. return $this->setData(OrderItemInterface::GW_TAX_AMOUNT_REFUNDED, $gwTaxAmountRefunded);
  2014. }
  2015. /**
  2016. * @inheritdoc
  2017. */
  2018. public function setFreeShipping($freeShipping)
  2019. {
  2020. return $this->setData(OrderItemInterface::FREE_SHIPPING, $freeShipping);
  2021. }
  2022. /**
  2023. * @inheritdoc
  2024. */
  2025. public function setQtyReturned($qtyReturned)
  2026. {
  2027. return $this->setData(OrderItemInterface::QTY_RETURNED, $qtyReturned);
  2028. }
  2029. /**
  2030. * @inheritdoc
  2031. */
  2032. public function setEventId($id)
  2033. {
  2034. return $this->setData(OrderItemInterface::EVENT_ID, $id);
  2035. }
  2036. /**
  2037. * @inheritdoc
  2038. */
  2039. public function setBaseWeeeTaxAppliedAmount($amount)
  2040. {
  2041. return $this->setData(OrderItemInterface::BASE_WEEE_TAX_APPLIED_AMOUNT, $amount);
  2042. }
  2043. /**
  2044. * @inheritdoc
  2045. */
  2046. public function setBaseWeeeTaxAppliedRowAmnt($amnt)
  2047. {
  2048. return $this->setData(OrderItemInterface::BASE_WEEE_TAX_APPLIED_ROW_AMNT, $amnt);
  2049. }
  2050. /**
  2051. * @inheritdoc
  2052. */
  2053. public function setWeeeTaxAppliedAmount($amount)
  2054. {
  2055. return $this->setData(OrderItemInterface::WEEE_TAX_APPLIED_AMOUNT, $amount);
  2056. }
  2057. /**
  2058. * @inheritdoc
  2059. */
  2060. public function setWeeeTaxAppliedRowAmount($amount)
  2061. {
  2062. return $this->setData(OrderItemInterface::WEEE_TAX_APPLIED_ROW_AMOUNT, $amount);
  2063. }
  2064. /**
  2065. * @inheritdoc
  2066. */
  2067. public function setWeeeTaxApplied($weeeTaxApplied)
  2068. {
  2069. return $this->setData(OrderItemInterface::WEEE_TAX_APPLIED, $weeeTaxApplied);
  2070. }
  2071. /**
  2072. * @inheritdoc
  2073. */
  2074. public function setWeeeTaxDisposition($weeeTaxDisposition)
  2075. {
  2076. return $this->setData(OrderItemInterface::WEEE_TAX_DISPOSITION, $weeeTaxDisposition);
  2077. }
  2078. /**
  2079. * @inheritdoc
  2080. */
  2081. public function setWeeeTaxRowDisposition($weeeTaxRowDisposition)
  2082. {
  2083. return $this->setData(OrderItemInterface::WEEE_TAX_ROW_DISPOSITION, $weeeTaxRowDisposition);
  2084. }
  2085. /**
  2086. * @inheritdoc
  2087. */
  2088. public function setBaseWeeeTaxDisposition($baseWeeeTaxDisposition)
  2089. {
  2090. return $this->setData(OrderItemInterface::BASE_WEEE_TAX_DISPOSITION, $baseWeeeTaxDisposition);
  2091. }
  2092. /**
  2093. * @inheritdoc
  2094. */
  2095. public function setBaseWeeeTaxRowDisposition($baseWeeeTaxRowDisposition)
  2096. {
  2097. return $this->setData(OrderItemInterface::BASE_WEEE_TAX_ROW_DISPOSITION, $baseWeeeTaxRowDisposition);
  2098. }
  2099. /**
  2100. * @inheritdoc
  2101. */
  2102. public function getProductOption()
  2103. {
  2104. return $this->getData(self::KEY_PRODUCT_OPTION);
  2105. }
  2106. /**
  2107. * @inheritdoc
  2108. */
  2109. public function setProductOption(\Magento\Catalog\Api\Data\ProductOptionInterface $productOption)
  2110. {
  2111. return $this->setData(self::KEY_PRODUCT_OPTION, $productOption);
  2112. }
  2113. /**
  2114. * @inheritdoc
  2115. *
  2116. * @return \Magento\Sales\Api\Data\OrderItemExtensionInterface|null
  2117. */
  2118. public function getExtensionAttributes()
  2119. {
  2120. return $this->_getExtensionAttributes();
  2121. }
  2122. /**
  2123. * @inheritdoc
  2124. *
  2125. * @param \Magento\Sales\Api\Data\OrderItemExtensionInterface $extensionAttributes
  2126. * @return $this
  2127. */
  2128. public function setExtensionAttributes(\Magento\Sales\Api\Data\OrderItemExtensionInterface $extensionAttributes)
  2129. {
  2130. return $this->_setExtensionAttributes($extensionAttributes);
  2131. }
  2132. //@codeCoverageIgnoreEnd
  2133. /**
  2134. * Check if it is possible to process item after cancellation
  2135. *
  2136. * @return bool
  2137. * @since 101.0.0
  2138. */
  2139. public function isProcessingAvailable()
  2140. {
  2141. return $this->getQtyToShip() > $this->getQtyToCancel();
  2142. }
  2143. }