コード例 #1
0
 public function getLineCost()
 {
     $price = $this->price;
     if (0 !== $this->discountPercent) {
         $discounted = $price * $this->discountPercent / 100;
         $price = round($price - $discounted, 2);
     }
     if ('Yes' === $this->taxable) {
         $taxService = new Storefront_Service_Taxation();
         $price = $taxService->addTax($price);
     }
     return $price * $this->qty;
 }
コード例 #2
0
 /**
  * Get the price
  *
  * @param  boolean $withDiscount Include discount calculation
  * @param  boolean $withTax      Include tax calculation
  * @return string The products price
  */
 public function getPrice($withDiscount = true, $withTax = true)
 {
     $price = $this->getRow()->price;
     if (true === $this->isDiscounted() && true === $withDiscount) {
         $discount = $this->getRow()->discountPercent;
         $discounted = $price * $discount / 100;
         $price = round($price - $discounted, 2);
     }
     if (true === $this->isTaxable() && true === $withTax) {
         $taxService = new Storefront_Service_Taxation();
         $price = $taxService->addTax($price);
     }
     return $price;
 }