예제 #1
0
 public function view($promotionID = null)
 {
     $this->requireAsset('css', 'vividStoreDashboard');
     $this->requireAsset('javascript', 'vividStoreFunctions');
     if ($promotionID) {
         $promotion = StorePromotion::getByID($promotionID);
     } else {
         $promotion = new StorePromotion();
     }
     $this->set('rewardTypes', StorePromotionRewardType::getPromotionRewardTypes());
     $this->set('ruleTypes', StorePromotionRuleType::getPromotionRuleTypes());
     $this->set('promotion', $promotion);
     $this->getAssets();
 }
예제 #2
0
 public static function installPromotionRuleType($handle, $name, $pkg)
 {
     $promotionRuleType = StorePromotionRuleType::getByHandle($handle);
     if (!is_object($promotionRuleType)) {
         StorePromotionRuleType::add($handle, $name, $pkg);
     }
 }