예제 #1
0
 /**
  * Set up the full set of discount information placeholders
  * @param   integer   $groupCustomerId    The customer group ID of the current customer
  * @param   integer   $groupArticleId     The article group ID of the current article
  * @param   integer   $groupCountId       The count discount group ID of the current article
  * @param   integer   $count              The number of articles to be used for the count discount
  * @static
  * @author    Reto Kohli <*****@*****.**>
  */
 static function showDiscountInfo($groupCustomerId, $groupArticleId, $groupCountId, $count)
 {
     // Pick the unit for this product (count, meter, kilo, ...)
     $unit = Discount::getUnit($groupCountId);
     if (!empty($unit)) {
         self::$objTemplate->setVariable('SHOP_PRODUCT_UNIT', $unit);
     }
     if ($groupCustomerId > 0) {
         $rateCustomer = Discount::getDiscountRateCustomer($groupCustomerId, $groupArticleId);
         if ($rateCustomer > 0) {
             self::$objTemplate->setVariable(array('SHOP_DISCOUNT_RATE_CUSTOMER' => $rateCustomer));
         }
     }
     if ($groupCountId > 0) {
         $rateCount = Discount::getDiscountRateCount($groupCountId, $count);
         $listCount = self::getDiscountCountString($groupCountId);
         if ($rateCount > 0) {
             // Show discount rate if applicable
             self::$objTemplate->setVariable('SHOP_DISCOUNT_RATE_COUNT', $rateCount);
         }
         if (!empty($listCount)) {
             // Show discount rate string if applicable
             self::$objTemplate->setVariable('SHOP_DISCOUNT_RATE_COUNT_LIST', $listCount);
         }
     }
 }