Example #1
0
 /**
  * Get line product data
  *
  * Return a Varien_Object with the following possible methods: getTaxCode, getMetaData
  *
  * @param Mage_Sales_Model_Order_Invoice_Item|Mage_Sales_Model_Order_Creditmemo_Item $item
  * @param int                                                                        $storeId
  * @return \Varien_Object
  */
 protected function _getLineProductData($item, $storeId)
 {
     $lineProductData = new Varien_Object();
     $product = $this->_getProductByProductId($this->_retrieveProductIdFromOrderItem($item));
     if (null === $product) {
         return $lineProductData;
     }
     $lineProductData->setTaxCode($this->_getTaxClassCodeByProduct($product));
     $metaData = array('ref1' => $this->_getRefValueByProductAndNumber($product, 1, $storeId), 'ref2' => $this->_getRefValueByProductAndNumber($product, 2, $storeId));
     $lineProductData->setMetaData($metaData);
     return $lineProductData;
 }
Example #2
0
 /**
  * Get line product data
  *
  * Return a Varien_Object with the following possible methods: getTaxCode, getRef1, getRef2
  *
  * @param Mage_Sales_Model_Order_Invoice_Item|Mage_Sales_Model_Order_Creditmemo_Item $item
  * @param int                                                                        $storeId
  * @return \Varien_Object
  */
 protected function _getLineProductData($item, $storeId)
 {
     $lineProductData = new Varien_Object();
     $product = $this->_getProductByProductId($item->getProductId());
     if (null === $product) {
         return $lineProductData;
     }
     $lineProductData->setTaxCode($this->_getTaxClassCodeByProduct($product));
     $lineProductData->setRef1($this->_getRefValueByProductAndNumber($product, 1, $storeId));
     $lineProductData->setRef2($this->_getRefValueByProductAndNumber($product, 2, $storeId));
     return $lineProductData;
 }