Author Topic: Show categories and their child split  (Read 179 times)

Huubs

  • Jr. Member
  • **
  • Posts: 56
Show categories and their child split
« on: November 17, 2017, 17:20:13 pm »
Hello,

I'm trying to display my front page in parts. So I have a main category where all my products are located, but I want to split up the main products and their parts.

So like this:

Products
- Prod 1
- Prod 2 etc

Parts
- Part 1
- Part 2 etc.

Now I thought about using child category, so I make a category "Parts" and put it in the main Products category and then I display the products and the child products below eachother.

But when I do that I see all the products in the top part, and below that there is only a link to the category. How can I achieve just direct links to products, but just parted so I have some overview.

Huubs

  • Jr. Member
  • **
  • Posts: 56
Re: Show categories and their child split
« Reply #1 on: November 20, 2017, 15:30:19 pm »
Anybody has an idea?

Huubs

  • Jr. Member
  • **
  • Posts: 56
Re: Show categories and their child split
« Reply #2 on: November 22, 2017, 12:31:32 pm »
Ok, I'm one step closer. The only thing that has to work is the actual display of the child category products.

With this code I can get all the products in the child category:

Code: [Select]
$productModel = VmModel::getModel('Product');
         
$productsChildren = $productModel->getProductListing($group, $nbrReturnProducts, $withCalc, $onlyPublished, $single, $filterCategory, $category_id = $this->category->children->virtuemart_category_id, $filterManufacturer, $manufacturer_id);

echo shopFunctionsF::renderVmSubLayout('products',array('products'=>$productsChildren,'currency'=>$this->currency,'products_per_row'=>$this->perRow,'showRating'=>$this->showRating));

The last one is not working. Maybe I need to no use the other things like currency or products per row