示例#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('CommerceTeam\\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;
 }
示例#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 = GeneralUtility::makeInstance('CommerceTeam\\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;
 }