예제 #1
0
 public function view()
 {
     $products = new VividProductList();
     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->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");
 }
예제 #2
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');
 }