News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Router does not get correct layout and tmpl parameter passed

Started by Jumbo!, September 13, 2012, 22:02:31 PM

Previous topic - Next topic

Jumbo!

I have found some bugs in the router.php (components\com_virtuemart\router.php).

I have created few alternative layouts (other than default) for the product details page in my template html override which can be seen from Menu and assigned by the users for any respective product they want. Refer to this Jooomla Doc. http://docs.joomla.org/Layout_Overrides_in_Joomla_1.6#Component_Alternative_Layouts It works fine if SEF is disabled or if I remove the router.php  from components\com_virtuemart\ folder. But it does not work when SEF is enabled with Virtuemart router. I checked the router codes and found that layout parameter is not being passed on correctly for the product details page in the router. This must be fixed.

Secondly, if anyone assign any alternative tmpl for a single product details page and enable SEF with Virtuemart router it always redirect you to "component" tmpl. In this case I have found the error code in the router which is creating this problem. I just commented out the following codes between lines 290 to 294:
// sef the slimbox View
if (isset($query['tmpl'])) {
if ( $query['tmpl'] = 'component') $segments[] = 'modal' ;
unset($query['tmpl']);
}

You really do not need this. No other component do anything for tmpl in their routers.

This fixes the second issue but the first problem is still unresolved.

Looking forward to the bug fixes soon.

Milbo

First:

Virtuemart 2 has its own layout handling. You can set different layouts per category.

Second:

Please post the link, which is not working, so that I can understand the difference. Thx
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Jumbo!

Hi Milbo,

Sorry for the delayed response. I understand the layout functionality of Virtuemart 2. But why only does it create problem when SEF is switched on?

Here is the link of the page which you can refer for the 2nd issue. http://demos.virtueplanet.com/promart/index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=21&virtuemart_category_id=2&Itemid=107
Check the link for ASK A QUESTION ABOUT THIS PRODUCT. I have assigned a new tmpl called modal for facebox instead of component. It works fine when SEF is disabled but when SEF is enabled it forces the link to use tmpl=component. If I comment out those codes from router.php then all works fine.

You can also check this yourself by changing the tmpl name from component and turning SEF on with the default theme if you want.