示例#1
0
 public function view()
 {
     $products = new VividProductList();
     $products->setItemsPerPage($this->maxProducts);
     $products->setGroupID($this->gID);
     $products->setFeatureType($this->showFeatured);
     $paginator = $products->getPagination();
     $pagination = $paginator->renderDefaultView();
     $this->set('products', $paginator->getCurrentPageResults());
     $this->set('pagination', $pagination);
     $this->set('paginator', $paginator);
     //load some helpers
     $this->set('ih', Core::make('helper/image'));
     $this->set('th', Core::make('helper/text'));
     $this->requireAsset("css", "font-awesome");
 }
示例#2
0
 public function view($gID = null)
 {
     $products = new StoreProductList();
     $products->setItemsPerPage(10);
     $products->setGroupID($gID);
     $products->activeOnly(false);
     $products->setShowOutOfStock(true);
     if ($this->get('keywords')) {
         $products->setSearch($this->get('keywords'));
     }
     $paginator = $products->getPagination();
     $pagination = $paginator->renderDefaultView();
     $this->set('products', $paginator->getCurrentPageResults());
     $this->set('pagination', $pagination);
     $this->set('paginator', $paginator);
     $this->requireAsset('css', 'vividStoreDashboard');
     $this->requireAsset('javascript', 'vividStoreFunctions');
     $grouplist = StoreGroupList::getGroupList();
     $this->set("grouplist", $grouplist);
 }
示例#3
0
 public function view($gID = null)
 {
     $products = new VividProductList();
     $products->setItemsPerPage(10);
     $products->setGroupID($gID);
     $products->activeOnly(false);
     if ($this->get('keywords')) {
         $products->setSearch($this->get('keywords'));
     }
     $paginator = $products->getPagination();
     $pagination = $paginator->renderDefaultView();
     $this->set('products', $paginator->getCurrentPageResults());
     $this->set('pagination', $pagination);
     $this->set('paginator', $paginator);
     $pkg = Package::getByHandle('vivid_store');
     $packagePath = $pkg->getRelativePath();
     $this->addHeaderItem(Core::make('helper/html')->css($packagePath . '/css/vividStoreDashboard.css'));
     $this->addFooterItem(Core::make('helper/html')->javascript($packagePath . '/js/vividStoreFunctions.js'));
     $grouplist = VividProductGroupList::getGroupList();
     $this->set("grouplist", $grouplist);
 }
示例#4
0
 public function view()
 {
     $products = new StoreProductList();
     $products->setSortBy($this->sortOrder);
     if ($this->filter == 'current' || $this->filter == 'current_children') {
         $page = Page::getCurrentPage();
         $products->setCID($page->getCollectionID());
         if ($this->filter == 'current_children') {
             $products->setCIDs($page->getCollectionChildrenArray());
         }
     }
     if ($this->filter == 'page' || $this->filter == 'page_children') {
         if ($this->filterCID) {
             $products->setCID($this->filterCID);
             if ($this->filter == 'page_children') {
                 $targetpage = Page::getByID($this->filterCID);
                 if ($targetpage) {
                     $products->setCIDs($targetpage->getCollectionChildrenArray());
                 }
             }
         }
     }
     $products->setItemsPerPage($this->maxProducts);
     $products->setGroupIDs($this->getGroupFilters());
     $products->setFeatureType($this->showFeatured);
     $products->setShowOutOfStock($this->showOutOfStock);
     $products->setGroupMatchAny($this->groupMatchAny);
     $paginator = $products->getPagination();
     $pagination = $paginator->renderDefaultView();
     $this->set('products', $paginator->getCurrentPageResults());
     $this->set('pagination', $pagination);
     $this->set('paginator', $paginator);
     //load some helpers
     $this->set('ih', Core::make('helper/image'));
     $this->set('th', Core::make('helper/text'));
     $this->requireAsset("css", "font-awesome");
 }
示例#5
0
 public function view()
 {
     $products = new StoreProductList();
     $sort = $this->sortOrder;
     if ($_GET['sort' . $this->bID]) {
         $sort = $_GET['sort' . $this->bID];
     }
     $products->setSortBy($sort);
     if ($this->filter == 'current' || $this->filter == 'current_children') {
         $page = Page::getCurrentPage();
         $products->setCID($page->getCollectionID());
         if ($this->filter == 'current_children') {
             $products->setCIDs($page->getCollectionChildrenArray());
         }
     }
     if ($this->filter == 'page' || $this->filter == 'page_children') {
         if ($this->filterCID) {
             $products->setCID($this->filterCID);
             if ($this->filter == 'page_children') {
                 $targetpage = Page::getByID($this->filterCID);
                 if ($targetpage) {
                     $products->setCIDs($targetpage->getCollectionChildrenArray());
                 }
             }
         }
     }
     $products->setItemsPerPage($this->maxProducts);
     $products->setGroupIDs($this->getGroupFilters());
     $products->setFeatureType($this->showFeatured);
     $products->setShowOutOfStock($this->showOutOfStock);
     $products->setGroupMatchAny($this->groupMatchAny);
     $paginator = $products->getPagination();
     $pagination = $paginator->renderDefaultView();
     $products = $paginator->getCurrentPageResults();
     foreach ($products as $product) {
         $product->setInitialVariation();
     }
     $this->set('sort', $sort);
     $this->set('products', $products);
     $this->set('pagination', $pagination);
     $this->set('paginator', $paginator);
     //load some helpers
     $this->set('ih', Core::make('helper/image'));
     $this->set('th', Core::make('helper/text'));
     $this->requireAsset("css", "font-awesome");
     $js = \Concrete\Package\VividStore\Controller::returnHeaderJS();
     $this->requireAsset('javascript', 'jquery');
     $this->addFooterItem($js);
     $this->requireAsset('javascript', 'vivid-store');
     $this->requireAsset('css', 'vivid-store');
 }