Making Your Joomla Template Work for Your Virtuemart 2.0 Store
- Details
-
Created on Friday, 23 December 2011 14:39
-
Written by Alex Steiner
This tutorial will show you how to have ultimate control of your Joomla template and module positions. Assign specific product and category page modules.
Download the PDF HERE.
Modules on Virtuemart Product Pages
Create a module position for all product pages
<?php if (JRequest::getVar('view')=='productdetails') { ?>
<div id="productmod"><jdoc:include type="modules" name="productdetails" /></div>
<?php } ?>
Create a module position for each product page
Creates a module position called productdetails# with # being the current product id.
<?php if (JRequest::getVar('view')=='productdetails') { ?>
<div id="productmod"><jdoc:include type="modules" name="productdetails<?php echo JRequest::getInt('virtuemart_product_id',0); ?>" /></div>
<?php } ?>
Modules on Virtuemart Category Pages
Create a module position for all categories
<?php if (JRequest::getVar('view')=='category') { ?>
<div id="catmod"><jdoc:include type="modules" name="categorymodule" /></div>
<?php } ?>
Create a module position for each category.
Creates a module position called category# with # being the current category id.
<?php if (JRequest::getVar('view')=='category') { ?>
<div id="catmod"><jdoc:include type="modules" name="category<?php echo JRequest::getInt('virtuemart_category_id',0); ?>" /></div>
<?php } ?>
Create a module position on the product page that can be assigned by category
Creates a module position on product details page called productbycat# with # being the current category id.
<?php if (JRequest::getVar('view')=='productdetails') { ?>
<div id="productbycat"><jdoc:include type="modules" name="productbycat<?php echo JRequest::getInt('virtuemart_category_id',0); ?>" /></div>
<?php } ?>
Many other views
You can do the same with any vmart view. Cart, account maintenance, etc.
<?php if (JRequest::getVar('view')=='VIEW-HERE') { ?>
<div id="divid"><jdoc:include type="modules" name="POSITION-NAME" /></div>
<?php } ?>'