public function dashboardForm()
 {
     $this->set('form', Core::make("helper/form"));
     $grouplist = StoreGroupList::getGroupList();
     $this->set("grouplist", $grouplist);
     $this->set("rewardType", StorePromotionRewardType::getByHandle('discount'));
 }
 public function saveReward()
 {
     $user = new User();
     if ($user->isLoggedIn()) {
         if ($this->post()) {
             $rewardType = StorePromotionRewardType::getByID($this->post('rewardTypeID'));
             $reward = $rewardType->getController()->addReward($this->post());
             $returnArray = array('rewardTypeID' => $this->post('rewardTypeID'), 'rewardTypeRewardID' => $reward->getID());
             echo json_encode($returnArray);
         }
     }
 }
Example #3
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();
 }
Example #4
0
 public static function installPromotionRewardType($handle, $name, $pkg)
 {
     $promotionRewardType = StorePromotionRewardType::getByHandle($handle);
     if (!is_object($promotionRewardType)) {
         StorePromotionRewardType::add($handle, $name, $pkg);
     }
 }
 public function dashboardForm()
 {
     $this->set('form', Core::make("helper/form"));
     $this->set('productFinder', StoreProductFinder::renderProductSearchForm());
     $this->set("rewardType", StorePromotionRewardType::getByHandle('free_product'));
 }