Exemplo n.º 1
0
 /**
  * Change the basket item quantity
  *
  * @param int $quantity Quantity
  *
  * @return true
  */
 public function changeQuantity($quantity)
 {
     $this->quantity = $quantity;
     $this->priceid = $this->article->getActualPriceforScaleUid($quantity);
     $this->price = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('Tx_Commerce_Domain_Model_ArticlePrice', $this->priceid, $this->lang_uid);
     $this->price->loadData();
     $this->priceNet = $this->price->getPriceNet();
     $this->priceGross = $this->price->getPriceGross();
     $this->recalculateItemSums();
     return TRUE;
 }
Exemplo n.º 2
0
 /**
  * Gets the price of this article and stores in private variable
  *
  * @param bool $translationMode Translation mode
  *
  * @return int
  */
 public function loadPrices($translationMode = FALSE)
 {
     if ($this->prices_loaded == FALSE) {
         $this->prices_uids = $this->databaseConnection->getPrices($this->uid);
         if ($this->prices_uids) {
             $priceData = array_shift($this->prices_uids);
             $this->price_uid = $priceData[0];
             $this->price = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('Tx_Commerce_Domain_Model_ArticlePrice', $this->price_uid);
             if ($this->price) {
                 $this->price->loadData($translationMode);
             } else {
                 return 0;
             }
             $this->prices_loaded = TRUE;
             $return = $this->price_uid;
         } else {
             $return = 0;
         }
     } else {
         $return = $this->price_uid;
     }
     return $return;
 }