Advertisement
Guest User

Untitled

a guest
Apr 3rd, 2014
891
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 6.45 KB | None | 0 0
  1.         $manufacturer_id = JRequest::getInt('manufacturer_id');
  2.         $label_id = JRequest::getInt('label_id');
  3.         $vendor_id = JRequest::getInt('vendor_id');
  4.        
  5.         $view_name = "cart";
  6.         $view_config = array("template_path"=>JPATH_COMPONENT."/templates/".$jshopConfig->template."/".$view_name);
  7.         $view = $this->getView($view_name, getDocumentType(), '', $view_config);
  8.         if ($category->category_template=="") $category->category_template="default";
  9.         $view->setLayout("category_".$category->category_template);        
  10.  
  11.         $jshopConfig->count_products_to_page = $category->products_page;
  12.  
  13.         $context = "jshoping.list.front.product";
  14.         $contextfilter = "jshoping.list.front.product.cat.".$category_id;
  15.         $orderby = $mainframe->getUserStateFromRequest( $context.'orderby', 'orderby', $jshopConfig->product_sorting_direction, 'int');
  16.         $order = $mainframe->getUserStateFromRequest( $context.'order', 'order', $jshopConfig->product_sorting, 'int');
  17.         $limit = $mainframe->getUserStateFromRequest( $context.'limit', 'limit', $category->products_page, 'int');
  18.         if (!$limit) $limit = $category->products_page;
  19.         $limitstart = JRequest::getInt('limitstart');
  20.  
  21.         $orderbyq = getQuerySortDirection($order, $orderby);
  22.         $image_sort_dir = getImgSortDirection($order, $orderby);
  23.         $field_order = $jshopConfig->sorting_products_field_select[$order];
  24.         $filters = getBuildFilterListProduct($contextfilter, array("categorys"));
  25.        
  26.         if (getShopMainPageItemid()==JRequest::getInt('Itemid')){
  27.             appendExtendPathWay($category->getTreeChild(), 'category');
  28.         }
  29.        
  30.         $orderfield = $jshopConfig->category_sorting==1 ? "ordering" : "name";
  31.         $sub_categories = $category->getChildCategories($orderfield, 'asc', $publish = 1);
  32.         $dispatcher->trigger( 'onBeforeDisplayCategory', array(&$category, &$sub_categories) );
  33.  
  34.         if ($category->meta_title=="") $category->meta_title = $category->name;
  35.         setMetaData($category->meta_title, $category->meta_keyword, $category->meta_description);
  36.        
  37.         $total = $category->getCountProducts($filters);
  38.         $action = xhtmlUrl($_SERVER['REQUEST_URI']);
  39.        
  40.         $dispatcher->trigger('onBeforeFixLimitstartDisplayProductList', array(&$limitstart, &$total, 'category'));
  41.         if ($limitstart>=$total) $limitstart = 0;
  42.  
  43.         $products = $category->getProducts($filters, $field_order, $orderbyq, $limitstart, $limit);
  44.         addLinkToProducts($products, $category_id);
  45.  
  46.         jimport('joomla.html.pagination');
  47.         $pagination = new JPagination($total, $limitstart, $limit);
  48.         $pagenav = $pagination->getPagesLinks();
  49.        
  50.         foreach($jshopConfig->sorting_products_name_select as $key=>$value){
  51.             $sorts[] = JHTML::_('select.option', $key, $value, 'sort_id', 'sort_value' );
  52.         }
  53.  
  54.         insertValueInArray($category->products_page, $jshopConfig->count_product_select); //insert category count
  55.         foreach ($jshopConfig->count_product_select as $key => $value){
  56.             $product_count[] = JHTML::_('select.option',$key, $value, 'count_id', 'count_value' );
  57.         }
  58.         $sorting_sel = JHTML::_('select.genericlist', $sorts, 'order', 'class = "inputbox" size = "1" onchange = "submitListProductFilters()"','sort_id', 'sort_value', $order );
  59.         $product_count_sel = JHTML::_('select.genericlist', $product_count, 'limit', 'class = "inputbox" size = "1" onchange = "submitListProductFilters()"','count_id', 'count_value', $limit );
  60.        
  61.         $_review = JTable::getInstance('review', 'jshop');
  62.         $allow_review = $_review->getAllowReview();
  63.        
  64.         if (!$category->category_ordertype) $category->category_ordertype = 1;
  65.        
  66.         $manufacuturers_sel = '';
  67.         if ($jshopConfig->show_product_list_filters){
  68.             $filter_manufactures = $category->getManufacturers();
  69.             $first_manufacturer = array();
  70.             $first_manufacturer[] = JHTML::_('select.option', 0, _JSHOP_ALL, 'id', 'name');
  71.             if (isset($filters['manufacturers'][0])){
  72.                 $active_manufacturer = $filters['manufacturers'][0];            
  73.             }else{
  74.                 $active_manufacturer = 0;
  75.             }
  76.             $manufacuturers_sel = JHTML::_('select.genericlist', array_merge($first_manufacturer, $filter_manufactures), 'manufacturers[]', 'class = "inputbox" onchange = "submitListProductFilters()"','id', 'name', $active_manufacturer);
  77.         }
  78.        
  79.         if ($jshopConfig->use_plugin_content){
  80.             changeDataUsePluginContent($category, "category");
  81.         }
  82.  
  83.         $display_list_products = (count($products)>0 || willBeUseFilter($filters));
  84.  
  85.         $dispatcher->trigger('onBeforeDisplayProductList', array(&$products));
  86.         $view->assign('config', $jshopConfig);
  87.         $view->assign('template_block_list_product', "cart/list_products.php");
  88.         $view->assign('template_block_form_filter', "cart/form_filters.php");
  89.         $view->assign('template_block_pagination', "cart/block_pagination.php");
  90.         $view->assign('path_image_sorting_dir', $jshopConfig->live_path.'images/'.$image_sort_dir);
  91.         $view->assign('filter_show', 1);
  92.         $view->assign('filter_show_category', 0);
  93.         $view->assign('filter_show_manufacturer', 1);
  94.         $view->assign('pagination', $pagenav);
  95.     $view->assign('pagination_obj', $pagination);
  96.         $view->assign('display_pagination', $pagenav!="");
  97.         $view->assign('rows', $products);
  98.         $view->assign('count_product_to_row', $category->products_row);
  99.         $view->assign('image_category_path', $jshopConfig->image_category_live_path);
  100.         $view->assign('noimage', $jshopConfig->noimage);
  101.         $view->assign('category', $category);
  102.         $view->assign('categories', $sub_categories);
  103.         $view->assign('count_category_to_row', $jshopConfig->count_category_to_row);
  104.         $view->assign('allow_review', $allow_review);
  105.         $view->assign('product_count', $product_count_sel);
  106.         $view->assign('sorting', $sorting_sel);
  107.         $view->assign('action', $action);
  108.         $view->assign('orderby', $orderby);
  109.         $view->assign('manufacuturers_sel', $manufacuturers_sel);
  110.         $view->assign('filters', $filters);
  111.         $view->assign('display_list_products', $display_list_products);
  112.         $view->assign('shippinginfo', SEFLink($jshopConfig->shippinginfourl,1));
  113.         $view->display();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement