VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: Amilcar on January 23, 2018, 00:15:32 AM

Title: Layout of a category in the module
Post by: Amilcar on January 23, 2018, 00:15:32 AM

Can you call the Layout menu option of a category, where the products of a category are shown on the homepage, within a module?

I create the menu item and call this menu item within a module.

I would not like to use the VirtueMart Products module, because of the formatting shown.

Att..
Amilcar
Title: Re: Layout of a category in the module
Post by: Ghost on January 23, 2018, 07:21:43 AM
Yes, you can. Here's a basic mod_virtuemart_product override using product sublayout:

<?php // no direct access
defined ('_JEXEC') or die('Restricted access');
// add javascript for price and cart, need even for quantity buttons, so we need it almost anywhere
vmJsApi::jPrice();
?>

<div class="vmgroup<?php echo $params->get ('moduleclass_sfx'?>">
<?php if ($headerText) { ?>
<div class="vmheader"><?php echo $headerText ?></div>
<?php }
echo shopFunctionsF::renderVmSubLayout('products',array('products'=>array($products), 'currency'=> $currency'showRating' => false));

if ($footerText) { ?>

<div class="vmfooter<?php echo $params->get ('moduleclass_sfx'?>">
<?php echo $footerText ?>
</div>
<?php ?>
</div>
Title: Re: Layout of a category in the module
Post by: Amilcar on January 23, 2018, 10:45:16 AM

Okay Ghost, thanks for your cooperation.
But I do not know how to use this code that you reported.
Could you help me with that?
Thank you very much.

Att..

Amilcar
Title: Re: Layout of a category in the module
Post by: Ghost on January 23, 2018, 10:49:32 AM
Create a template override of mod_virtuemart_product and add this code to the override file.

If you don't know how to make template overrides, read this https://docs.joomla.org/How_to_override_the_output_from_the_Joomla!_core