Menu Content

Currencies Accepted


Shopping Cart

cart
Your Cart is currently empty.

How to Download A Product

For most of our products, including the free ones, you will need to go through checkout and place an order.

Read More

 

Find Us Elsewhere

Follow us on Twitter

Spiral Scripts on Facebook

rapidssl_ssl_certificate
2Checkout.com is a worldwide leader in payment services
Home » Forum

Welcome, Guest

VM category module on category & product pages
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: VM category module on category & product pages

VM category module on category & product pages 1 month ago #492

How can I place the Virtuemart Category module on category pages and product pages? Normally this module only shows on the VM homepage. I succeeded to place it on the VM homepage, but not on other pages.

These are my settings:
Module assignment: on all pages
VM2 categories: all categories
No filtering of manufacturers, user type and shopper groups
VM2 pages: category, categories, productdetails, virtuemart
VM2 pages to exclude: use default
Virtuemart pages only
And ofcourse published the VM Modcontroller module and unlpublished the VM Category module

I use VM2.0.2 and J1.7.2. Hope you can help...
Attachments:
Last Edit: 1 month ago by Cynthia Versteeg.

Re: VM category module on category & product pages 1 month ago #493

The settings for the VM Modcontroller look correct.

But if a module will normally only display on the Virtuemart home page you cannot make it appear on other pages using the VM Modcontroller module. How this VM Modcontroller normally works is that you must set your module to be displayed on all pages, then the VM modcontroller is used to restrict the display to the parameters you require.

If it is possible, you should assign your Virtuemart category module to appear on all pages, not just the Virtuemart home page. But if this module is designed to only appear on the Virtuemart home page, this is something that is in the module code, and cannot be affected by the VM Modcontroller module. You will need to edit the categories module code to display on all pages, then use the VM Modcontroller module to control the display.

Re: VM category module on category & product pages 1 month ago #494

Hi Susan,

I assigned the VM-category module to all pages. I will look into the code if this module is designed to only appear on the Virtuemart home page.

Re: VM category module on category & product pages 1 month ago #495

You are welcome to send the module to us, I will have a look at the code and see if there is something that can be changed.

Re: VM category module on category & product pages 1 month ago #496

It seems loosing the modules has something to do with the homepage assignment in the menu. I made a copy of the homepage.
When I assign the copy to 'home' in menu manager > menu items, it looses all modules in the sidebar as soon as I arrive on a category page or product page.
When I assign the original page to 'home', this behavior transfers to this page and the copy functions good again.
Both pages are assigned to the same template.
I'm lost here...

mod_virtuemart_category.php:

<?php
defined('_JEXEC') or die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );
/*
* Best selling Products module for VirtueMart
* @version $Id: mod_virtuemart_category.php 1160 2008-01-14 20:35:19Z soeren_nb $
* @package VirtueMart
* @subpackage modules
*
* @copyright (C) John Syben ( This e-mail address is being protected from spambots. You need JavaScript enabled to view it )
* Conversion to Mambo and the rest:
* @copyright (C) 2004-2005 Soeren Eberhardt
*
* @license www.gnu.org/copyleft/gpl.html GNU/GPL
* VirtueMart is Free Software.
* VirtueMart comes with absolute no warranty.
*
* www.virtuemart.net
*----------------------------------------------------------------------
* This code creates a list of the bestselling products
* and displays it wherever you want
*----------------------------------------------------------------------
*/
/* Load VM fonction */
require('helper.php');
JTable::addIncludePath(JPATH_VM_ADMINISTRATOR.DS.'tables');

vmJsApi::jQuery();
vmJsApi::cssSite();

/* Setting */
$categoryModel = VmModel::getModel('Category');
$category_id = $params->get('Parent_Category_id', 0);
$class_sfx = $params->get('class_sfx', '');
$moduleclass_sfx = $params->get('moduleclass_sfx','');
$layout = $params->get('layout','default');
$active_category_id = JRequest::getInt('virtuemart_category_id', '0');
$vendorId = '1';
$cache = & JFactory::getCache('com_virtuemart','callback');
$categories = $cache->call( array( 'VirtueMartModelCategory', 'getChildCategoryList' ),$vendorId, $category_id );
// $categories = $categoryModel->getChildCategoryList($vendorId, $category_id);
// We dont use image here
//$categoryModel->addImages($categories);

if(empty($categories)) return false;


foreach ($categories as $category) {

$category->childs = $cache->call( array( 'VirtueMartModelCategory', 'getChildCategoryList' ),$vendorId, $category->virtuemart_category_id );
// $category->childs = $categoryModel->getChildCategoryList($vendorId, $category->virtuemart_category_id) ;
// No image used here
//$categoryModel->addImages($category->childs);
}
// $catTree = $categoryModel->getCategoriesInfo($vendorId=1 );
// echo json_encode($catTree,JSON_FORCE_OBJECT);
$parentCategories = $categoryModel->getCategoryRecurse($active_category_id,0);


/* Laod tmpl default */
require(JModuleHelper::getLayoutPath('mod_virtuemart_category',$layout));
?>


Re: VM category module on category & product pages 1 month ago #497

This sounds like a problem with the module assignment on your copy page.

The module you have shown me the code from is the standard virtuemart category module that comes with Virtuemart. If you click a link in the virtuemart category module you should see the same modules loaded on the linked page as on the page you came from. Then if you click a product link you should still see the same pages loaded.

The way that this works is that Joomla uses an 'itemId' parameter that tells it which menu item the page belongs to, it then loads the modules for that page. The Virtuemart category module passes this itemId parameter in the URL of any category and product links it displays. If something is going wrong with this it is probably because the itemId parameter is being dropped.

You should be able to see what is going on by turning of the SEF URLS, then you will see a raw Virtuemart URL, it should look something like:

index.php?option=com_virtuemart&view=category&virtuemart_category_id=5&Itemid=109

The Itemid is the last parameter, you should check that it is being passed correctly, it is possible that if you are using an SEF extension it could be changing the Itemid parameter, that might be causing the problem.
  • Page:
  • 1
Time to create page: 0.61 seconds
 
 

VirtueMart Featured Products Grid

Switch View

This module displays a short excerpt from articles in a selected category or section, or from a specified list of articles, with link and optional thumbnail image.

£14.00


A module extension for the the Joomla CMS. It plays a random list of mp3s using the Flash media player.

£12.00
Buy both our Flash slideshow products for Virtuemart and save £5.

£25.00


This module displays a short excerpt from articles in a selected category or section, or from a specified list of articles, with link and optional thumbnail image.

£12.00