VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: Heste Janse van Rensburg on July 26, 2017, 13:06:13 PM

Title: Show only manufacturers per Product category
Post by: Heste Janse van Rensburg on July 26, 2017, 13:06:13 PM
I'm new to Virtue Mart - I've used a template for my website that came with Virtue Mart 3.  So I would like to see if this will work for me.
On the website I need to show a list of my product categories, and when the user click on a category, it should only show the manufacturers of that product, not the products it self.
In other words, when click on Products / Appliances / Kettles - it should show Manufacturer details 1, 3 and 4  and when click on Products / Appliances / Vacuum cleaners - it should show Manufacturer details 2 and 5

Will it be possible to configure it like that and if so - please guide me how to do the setup/configuration?

Thank you in advance.
Title: Re: Show only manufacturers per Product category
Post by: hellorain on July 26, 2017, 14:01:34 PM
Hello,

Display only manufacturer as per category layout, Need some customization on category page.

Best Regards,
hellorain.
Title: Re: Show only manufacturers per Product category
Post by: Heste Janse van Rensburg on July 26, 2017, 18:44:54 PM
Thank you hellorain
if you say customization on the category page - can I do it in the admin panel - or do you mean hard coding?

Title: Re: Show only manufacturers per Product category
Post by: hellorain on July 26, 2017, 19:00:54 PM
Hi,

Means hard coding, but, also can be done by creating upgrade safe functions in pages over rides.

Best Regards,
Title: Re: Show only manufacturers per Product category
Post by: Studio 42 on July 28, 2017, 16:19:44 PM
You mixed something, it's not very clear.
Say you have a category A
You display it.
THis display subcategories + Products.
YOu can after filter the manufacturers.

So your result should be:
You display it.
This display manufacturers only ?
Title: Re: Show only manufacturers per Product category
Post by: Heste Janse van Rensburg on August 01, 2017, 16:26:05 PM
Yes Studio 42,
I want the user to click for example on Appliances / Kettles and then all manufacturers that supply kettles, should be displayed in the results, not the products, only manufacturers.
Title: Re: Show only manufacturers per Product category
Post by: technext2k on August 01, 2017, 23:09:40 PM
You need to modify the code of the module (which shows products) to show manufacturers instead. This cannot be done by simply configuring it as I think so.
Title: Re: Show only manufacturers per Product category
Post by: Heste Janse van Rensburg on August 02, 2017, 09:32:51 AM
Thank you technext2k  ;)
Title: Re: Show only manufacturers per Product category
Post by: hellorain on August 02, 2017, 10:17:11 AM
Hello,

We can help you regarding custom coding.

Best Regards,
hellorain.
Title: Re: Show only manufacturers per Product category
Post by: Studio 42 on August 03, 2017, 12:09:25 PM
Quote from: technext2k on August 01, 2017, 23:09:40 PM
You need to modify the code of the module (which shows products) to show manufacturers instead. This cannot be done by simply configuring it as I think so.
Sorry but in this case, it's not a module but you need to overide the category layout(s) and if a manufacturer is set, load another file, or add the code to display manufacturer.

The simplified code to display manufacturer is
if($condition){
   echo $this->loadTemplate('manufacturer');
   return;
}
If in your case it's always for the second level of categories, then you can check if the category have a parent category set then load the list of manufacturers.

Another solution is to write a layout and set it in the category that should display manufacturers directly but this need in all case to rewrite the code.