Beispiel #1
0
 /**
  * Get original editable price
  *
  * @param Item $item
  * @return float
  */
 public function getOriginalEditablePrice($item)
 {
     if ($item->hasOriginalCustomPrice()) {
         $result = $item->getOriginalCustomPrice() * 1;
     } elseif ($item->hasCustomPrice()) {
         $result = $item->getCustomPrice() * 1;
     } else {
         if ($this->_taxData->priceIncludesTax($this->getStore())) {
             $result = $item->getPriceInclTax() * 1;
         } else {
             $result = $item->getOriginalPrice() * 1;
         }
     }
     return $result;
 }
 /**
  * Push `addEcommerceItem' with quote item data to given tracker
  *
  * @param \Magento\Quote\Model\Quote\Item $item
  * @param \Henhed\Piwik\Model\Tracker $tracker
  * @return \Henhed\Piwik\Helper\Tracker
  */
 public function addQuoteItem(Quote\Item $item, TrackerModel $tracker)
 {
     $tracker->addEcommerceItem($item->getSku(), $item->getName(), false, $item->hasCustomPrice() ? (double) $item->getCustomPrice() : (double) $item->getPriceInclTax(), (double) $item->getQty());
     return $this;
 }