Author Topic: Display all products under the sub-categories of the current category too VM2  (Read 54222 times)

franci77

  • Beginner
  • *
  • Posts: 15
Hi,

Even though this code update actually works, there is a problem that the subcategories products aren't actually assigned to parent categories, and because of that if anyone noticed, you can't filter products by manufacturers.

Besides, the file got overwritten, when you updated VM.

So I found another solution. There is a plugin: http://extensions.joomla.org/extensions/extension-specific/virtuemart-extensions/virtuemart-categories/23074
The plugin will assign all subcategory's products also to parent categories. So you will have subcategory's products also displayed when you are on parent category view. And now you can also filter them by manufacturers and you don't have to worry about the updates.

Note that product.php should be in default state. And BACKUP your database BEFORE you assign products to parent categories in case you don't like the results.


Best regards,
Franci

karuppiah

  • Beginner
  • *
  • Posts: 38
Great Post matearts ;D
karuppiah

liquid.ideas

  • Jr. Member
  • **
  • Posts: 90
Thanks Guys, you are all awesome!! Worked like a bomb!! Anyway do you think this could be done as an override?
Perhaps Ivus will know. Thing is there are a couple of places I cant override, like if I put this (above fix) into:

templates/my_template/html/com_virtuemart/models it doesnt do anything, I actually have to put it in the admin folder.

I also have the same problem over writing the featured products if I put the single.php file into:

templates/my_template/html/mod_virtuemart_product/ it wont override either?

I know I went a little off topic here but I would like to override the fix, anyone know where I am going wrong?


Maxim Pishnyak

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2657
Maybe JHacks extension could automate such tasks (files in models folder etc), how do you think?

As for "mod_virtuemart_product" case:
what are you doing and what is going wrong?

liquid.ideas

  • Jr. Member
  • **
  • Posts: 90
HI Maxim,

To explain, If I create a featured products module, in the drop down parameters you can select which php file to use eg: single, default etc. so to do a template override, I used templates\my_template\html\mod_virtuemart_product\tmpl\singlejofeat.php, but In the module I cannot select the file that I created which is: singlejofeat.php unless I have it in modules/mod_virtuemart_product/singlejofeat.php, not ideal if I update VM, any ideas?

Regards,

Jo

Maxim Pishnyak

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2657
I doubt that VM update will overwrite file like modules/mod_virtuemart_product/singlejofeat.php. Just use for 'singlejofeat.php' file enough unique filename.

Could you have 'singlejofeat.php' in modules/mod_virtuemart_product/singlejofeat.php just for fashion?
Any way instead that file another one tween in templates\my_template\html\mod_virtuemart_product\tmpl\ will be used.

Ninjab

  • Jr. Member
  • **
  • Posts: 78
Hi there, I have tried this and it didnt do anything when displaying in category view. My sub categories were exactly the same in its parent category page.

What I am trying to do is this layout:

Category Title
         Sub Category Title
                Product 1    Product 2    Product 3

         Sub Category Title
                Product 1    Product 2    Product 3

Ultimately this would be on the site I am working on as:

Notebook Bags
         
          Ultrabook Bags
                 Product 1    Product 2    Product 3

          Macbook Bags
                 Product 1    Product 2    Product 3

I don't want to display any products from parent category (well I won't have any there anyway :)) and the sub categories need to have their titles and products listed below. I want to display the hierarchy like this page: http://www.incipio.com/cases/iphone-cases/iphone-5-cases.html

I have also attached an image that is how I would like to have it to better explain.

Thanks :)

[attachment cleanup by admin]

Maxim Pishnyak

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2657
Did you have any success with your "Only Sub-categories in Category view" thread?

Ninjab

  • Jr. Member
  • **
  • Posts: 78
No one except you had replied unfortunately :(

Maxim Pishnyak

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2657
So what is the current status of your issue?

Ninjab

  • Jr. Member
  • **
  • Posts: 78
The current status is my template looks like my attached image now. But I need it to look like the my earlier attached image which is my 2nd attached image here.

The sub categories only list their picture and name. I need only the name (title) of the sub category/s to be listed in the parent category view and their products listed under each sub category title.

All I need is the parent title to be at the top, then the pagnation. Under that to be sub category titles, and under each sub-cat title is their products. As mentioned like in the link from Incipios page.

Thanks.

[attachment cleanup by admin]

Maxim Pishnyak

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2657
To get rid of category images you need to edit template override.

Have you any success with adding products with this:
OK thanks I have found it that way via google. I will try altering the code to do that and inspect that thread.
?

Ninjab

  • Jr. Member
  • **
  • Posts: 78
getting rid of the parent category image is not the problem, I can do that.

I need this layout:

Category Title (sleeves)
         1st Sub Category Title (iPad)
                Product 1    Product 2    Product 3

         2nd Sub Category Title (iPad mini)
                Product 1    Product 2    Product 3

So far the current layout is the sub categories at the top. And they do not list any products under them.

Ninjab

  • Jr. Member
  • **
  • Posts: 78
Surely this is possible? Can someone please help with this?

Mana

  • Beginner
  • *
  • Posts: 1
    • Save And Load
Re: Display all products under the sub-categories of the current category too VM2
« Reply #44 on: September 17, 2013, 09:17:11 am »
Thank you much for this solution, is working like a char  ;).