Author Topic: how to categorize products in virtuemart  (Read 469 times)

kiasati

  • Jr. Member
  • **
  • Posts: 99
    • JoomlaJoy
how to categorize products in virtuemart
« on: January 25, 2018, 10:38:11 am »
Hi

I sell CCTV cameras on my site.
my product categories are like the picture below:


when creating a new product for "ip-bullet" for example, should i add the product to "camera" "ip camera" and "ip-bullet" categories, or only "ip-bullet"???
because i want the product to be shown under "ip camera" category. I mean when a user clicks on "ip camera" menu item, i want the products in sub-categories (in this case: ip-bullet and hd-bullet) to be shown in "ip camera" category page.
so should i add the product to all three categories or only the "ip-bullet" category?

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 7880
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.2.14
Re: how to categorize products in virtuemart
« Reply #1 on: January 25, 2018, 11:28:16 am »
I would only ip-bullet and enable the hidden switch in models/products.php

if ($virtuemart_category_id > 0) {
         $joinCategory = TRUE;
         if(VmConfig::get('show_subcat_products',false)){
            /*GJC add subcat products*/
            $catmodel = VmModel::getModel ('category');
            $childcats = $catmodel->getChildCategoryList(1, $virtuemart_category_id,null, null, true);
            $cats = $virtuemart_category_id;
            foreach($childcats as $childcat){
               $cats .= ','.$childcat->virtuemart_category_id;
            }
            $joinCategory = TRUE;
            $where[] = ' `pc`.`virtuemart_category_id` IN ('.$cats.') ';
         } else {
            $where[] = ' `pc`.`virtuemart_category_id` = ' . $virtuemart_category_id;
         }
      }


enable

if(VmConfig::get('show_subcat_products',false)){
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation