Esempio n. 1
0
 /**
  * Unset custom_price data for quote item
  *
  * @param Item $item
  * @return void
  */
 protected function unsetCustomPrice(Item $item)
 {
     /** @var \Magento\Framework\Object $infoBuyRequest */
     $infoBuyRequest = $item->getBuyRequest();
     if ($infoBuyRequest->hasData('custom_price')) {
         $infoBuyRequest->unsetData('custom_price');
         $infoBuyRequest->setValue(serialize($infoBuyRequest->getData()));
         $infoBuyRequest->setCode('info_buyRequest');
         $infoBuyRequest->setProduct($item->getProduct());
         $item->addOption($infoBuyRequest);
     }
     $item->unsetData('custom_price');
     $item->unsetData('original_custom_price');
 }