News:

Looking for documentation? Take a look on our wiki

Main Menu

[ SOLVED ] redirect a category to product details page

Started by buzi, November 01, 2012, 11:13:32 AM

Previous topic - Next topic

buzi

Hi,
i'm quite sure if this is the right section, but here goes:

id'e like a specific category to go directly to a specific product details page
i don't think this can be done by configuration.
if you are asking why i dont create a menu item to point to the product details , well its complicated.

tried using the joomla generic redirect component, and other redirect components, even tried to change the .htaccess like this:

Redirect 301 /index.php?option=com_virtuemart&view=category&virtuemart_category_id=10 http://www.mysite.com/index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=94&virtuemart_category_id=10

but none of those work (other .htaccess rules do work)
im guessing there is some in-code url generation that produces those links and overrides the .htaccess.

any ideas how to approach this ?

Thanks 

PRO

create a separate "category layout" template

Then. in the category, set it to the new layout

Then, you can use this code in it

<?php
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');
$app = JFactory::getApplication();
   if (!$app->isAdmin()) {
$app->redirect('url-to-redirect-to', null, null, true, true);
}


buzi

very nice PRO, it worked like a charm.
Thank you very much. :)
May the force be with you.