Beispiel #1
0
 /**
  * Add AvaTax specific extension attribute fields to a \Magento\Tax\Model\Sales\Quote\ItemDetails object
  *
  * @param \Magento\Tax\Api\Data\QuoteDetailsItemInterface $quoteDetailsItem
  * @param $avaTaxItemCode
  * @param $avaTaxTaxCode
  * @param $avaTaxDescription
  * @return $this
  */
 protected function addExtensionAttributesToTaxQuoteDetailsItem(\Magento\Tax\Api\Data\QuoteDetailsItemInterface $quoteDetailsItem, $avaTaxItemCode, $avaTaxTaxCode, $avaTaxDescription)
 {
     /** @var \Magento\Tax\Api\Data\QuoteDetailsItemExtensionInterface $extensionAttribute */
     $extensionAttribute = $quoteDetailsItem->getExtensionAttributes() ? $quoteDetailsItem->getExtensionAttributes() : $this->extensionFactory->create();
     $extensionAttribute->setAvataxItemCode($avaTaxItemCode);
     $extensionAttribute->setAvataxTaxCode($avaTaxTaxCode);
     $extensionAttribute->setAvataxDescription($avaTaxDescription);
     $quoteDetailsItem->setExtensionAttributes($extensionAttribute);
     return $this;
 }