VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: EvanGR on September 27, 2018, 08:50:58 AM

Title: Modules under certain categories or products
Post by: EvanGR on September 27, 2018, 08:50:58 AM
Hello,

I want to add some modules under certain products, or categories of products (e.g. include company logos, badges, labels etc...)

(ideally, batch add them to individual products by product category)

What would be a good (performant and easy to maintain) way of doing this?

Thanks
Title: Re: Modules under certain categories or products
Post by: Jörgen on September 27, 2018, 09:40:21 AM
Using Joomla core functions you can set up menu for the categories you want to have special attention and set up modules to be displayed for this category only. These modules coud be easily maintaned.

If the options for displaying this are not precise enough I can recommend the advanced module manager, I use the pro version. It is not an easy extension to use, but You have great possibilities to display modules as You like.
https://www.regularlabs.com/extensions/advancedmodulemanager (https://www.regularlabs.com/extensions/advancedmodulemanager)

You could add items in your product description instead and use the free plugin include_content_item to insert articles in the product description. The you only edit the articles when changes are neccesary. A little bit similar to using modules.
https://www.kksou.com/php-gtk2/Joomla/Include-Content-Item-plugin.php (https://www.kksou.com/php-gtk2/Joomla/Include-Content-Item-plugin.php)

Hope this could be of help

Jörgen @ Kreativ Fotografi
Title: Re: Modules under certain categories or products
Post by: EvanGR on September 27, 2018, 10:56:47 AM
Yes, it helps... thank you very much!
Title: Re: Modules under certain categories or products
Post by: Jörgen on September 27, 2018, 13:02:35 PM
Good Luck, Please let us know what You decied to go for.

Jörgen @ Kreativ Fotografi
Title: Re: Modules under certain categories or products
Post by: PRO on September 29, 2018, 17:22:58 PM

In your product details template, to show a module by the category id.


<?php
jimport('joomla.application.module.helper');
$modules = JModuleHelper::getModules($position);
foreach ($modules as $module) {
echo JModuleHelper::renderModule('cat'.$this->product->virtuemart_category_id);
}
?>

THEN: you setup a module via module manager.

for the position
type in catcategory_ID

for example, the category id 345
the position is cat345
Title: Re: Modules under certain categories or products
Post by: EvanGR on October 02, 2018, 08:54:12 AM
Thank you all...

Could something similar be done with Joomla articles, instead of modules?

For product texts that require repetition, I could embed one or more Joomla articles and save on time and trouble. Possible?

Joomla articles are a lot easier to organize than modules.

Thanks
Title: Re: Modules under certain categories or products
Post by: GJC Web Design on October 02, 2018, 10:13:28 AM
http://bfy.tw/K9o8
Title: Re: Modules under certain categories or products
Post by: EvanGR on October 02, 2018, 13:14:54 PM
I know of that plugin by Regular Labs. I did not know if it was compatible with VM products, or if there was a native Joomla/VM method of doing the job.
Thanks!
Title: Re: Modules under certain categories or products
Post by: Jörgen on October 02, 2018, 13:39:51 PM
Quote from: Jörgen on September 27, 2018, 09:40:21 AM
You could add items in your product description instead and use the free plugin include_content_item to insert articles in the product description. The you only edit the articles when changes are neccessary. A little bit similar to using modules.
https://www.kksou.com/php-gtk2/Joomla/Include-Content-Item-plugin.php (https://www.kksou.com/php-gtk2/Joomla/Include-Content-Item-plugin.php)

Jörgen @ Kreativ Fotografi
Title: Re: Modules under certain categories or products
Post by: EvanGR on October 02, 2018, 13:54:21 PM
I missed that bit, sorry, and thanks!
Title: Re: Modules under certain categories or products
Post by: Studio 42 on October 02, 2018, 13:56:36 PM
For product, you can use custom fields and change render in category to add it.
Some template can use badge on checking the stock for eg.
Using this method is faster that using Joomla plugins most time and you can mass add/remove customfields using my tool vm be PRO or import it using csvi or my tool VM be pro.
Title: Re: Modules under certain categories or products
Post by: GJC Web Design on October 02, 2018, 14:07:14 PM
As Patrick says -- if a client wants to have particular content shown in VM at a particular cat etc then text custom fields are the normal approach displayed in the template by an if statement to filter them