Sub-categories products shown in parent category view: how to? ->feature request

Started by SteP[IT], April 18, 2015, 18:15:22 PM

Previous topic - Next topic

SteP[IT]

I have many customer's websites were parents categories have no product assigned to, but have many sub-categories (also nested) with many products: if I'm not wrong, according to the current VM3 way to show products in category view, you can't show all the subcategories assigned products in the parent category view.
Is there a way to get the parent category view displaying all subcategories tree assigned products without the needing of assigning them to all the upper-level categories in the tree?
It would be better to have a config option to get this result.
Waiting for kindly sggestions.
Regards
J 3.9.2 - VM 3.4.3

MMC EDIZIONI - Italian High-Quality PaperBooks Publisher
Site: https://www.mmcedizioni.it

SteP[IT]

J 3.9.2 - VM 3.4.3

MMC EDIZIONI - Italian High-Quality PaperBooks Publisher
Site: https://www.mmcedizioni.it

GJC Web Design

Quoteassigning them to all the upper-level

afaik this is the standard way to do this -- I think there is a plugin to automate it
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 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
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

SteP[IT]

Adding the same product to the upper tree parent categories is not the best choise to get a good SEO rank: in that way you get as many products urls as the category number is (one per each parent category), all pointing to the same identical product page content.
In my opinion, simply showing all sub-tree products in parents categories without forcing them to be assigned to that categories will avoid this: the link to the product will remain the same only one (it has been assigned to only one category), also if displayed in upper categories. This is why I would like to see that option in VM core config.
J 3.9.2 - VM 3.4.3

MMC EDIZIONI - Italian High-Quality PaperBooks Publisher
Site: https://www.mmcedizioni.it

franzpeter

Is that really a problem for SEO Rank? Google for example takes care about canonical url. So if you display same product in different categories means that you just assign the same product with the product categories reference table. It is just a display thing, the canonical url gives the correct or better true url.  I doubt about that it has any influence on SEO Rank!

SteP[IT]

But I still have some J 2.5.x-VM3 websites, and I can't see there any VM-generated canonical: am I wrong?
J 3.9.2 - VM 3.4.3

MMC EDIZIONI - Italian High-Quality PaperBooks Publisher
Site: https://www.mmcedizioni.it

Rune Rasmussen

I second this request, as it would be quite useful and helpful to have a setting for this in core.

Having them assign to all parents make it unnecessary complex if you also want to display the products in other categories for t.ex campaigns, or just because they fit in several. The way the bulk assign of products to categories works now also makes it more complex than needed, since it doesn't show already selected, and you have to select all, else it's removing products from previous - it doesn't just add the newly selected...

Oh, and the automated plugins available works for all the cart. But sometimes it would be nice to decide per category, if you want to display from subs... other thing is that those plugins also has their downsides, and conflicts with other things here and there.
Rune Rasmussen - https://www.syntaxerror.no/

Norwegian Translation Team

Studio 42

Hi,
You can add a loop (the best is to make changes in your template file) to get the products for each 1st level subcategories.
simply adapt and reuse the core function in JOOMLA/components\com_virtuemart\views\category\view.html.php
$ids = $productModel->sortSearchListQuery (TRUE, $this->categoryId);

or if you need all products then you have to get all sub categories and products. But this can be a heavy work in a big shop

If you do the overides in your template, then you can safe update virtuemart.

I think the first solution, is better for safe, because the product are displayed a level before in your site. But you see only one level more.

deuce4884

Quote from: Studio 42 on April 22, 2015, 22:16:54 PM
Hi,
You can add a loop (the best is to make changes in your template file) to get the products for each 1st level subcategories.
simply adapt and reuse the core function in JOOMLA/components\com_virtuemart\views\category\view.html.php
$ids = $productModel->sortSearchListQuery (TRUE, $this->categoryId);

or if you need all products then you have to get all sub categories and products. But this can be a heavy work in a big shop

If you do the overides in your template, then you can safe update virtuemart.

I think the first solution, is better for safe, because the product are displayed a level before in your site. But you see only one level more.

I'm guessing you mean to do an override to the default view for virtuemart category. I'm new to Virtuemart so please bare with me. I'm currently running version 3.0.9 on Joomla 3.4.2. The shop I'm currently working on is not very big, so how would you implement this to show all products?

Studio 42

My solution only get 1 level deeper.
To get all subcategories product, it's to slow to use it that way.

deuce4884

Oh ok. I may be able to use only going 1 level deeper. How would I go about implementing the foreach loop in the template file to do that?