News:

Support the VirtueMart project and become a member

Main Menu

Incorrect Template being applied to Pages when VM SEO is enabled

Started by siobhano, May 03, 2013, 20:10:57 PM

Previous topic - Next topic

siobhano

I have two template styles for my website one is applied to the home page and the second is intended to be applied to all other pages. Everything works fine across category views, product views, cart views. However, I have one problem area and that is when I test the "edit address" functionality for the shopper on the front end the wrong template is being applied. This ONLY happens if I have VM SEO enabled - if I disable SEO the correct template is applied. How can I better control this so that I can enable seo AND have the correct template applied to the edit address page?  My site is being developed offline on localhost so no live url to share yet.

Hoping someone can point me in the right direction on this. Appreciate any help you can provide. I have cross-posted this question in the SEF forum but have no replies as yet. Really hoping someone can enlighten me.
__________________________________________________________________________________
link info
SEO enabled - incorrect template applied - browser link is  http://localhost/tw2012/index.php/user/editaddresscartBT
SEO disabled - corrrect template applied - browser link is
http://localhost/tw2012/index.php/cart/view/user/task/editaddresscart/addrtype/BT

Joomla! 2.5.9  VirtueMart 2.0.20b
PHP Version    5.3.8
Web Server    Apache/2.2.21

jenkinhill

Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

siobhano

THANKS for your help on this and the link! :) 

I have followed your very clear instructions and everything is good on the FE site except for VM functions such as edit customer address which are called from within the shopping cart module. The cart itself pops up with the correct template but edit address, when called, loads the home page template rather than VM items template. This ONLY happens when VM SEO is enabled otherwise all is fine. Is there a way to force the edit address function to always load the correct template - could I assign it to a hidden menu item ? How would I do that ? What menu item type would it be ?  Would like to work from admin interface to achieve this if possible.

Did notice the php script for edit address contained the code segment listed below but hoping I don't have to mess with that.


Thank you so much for your help - really do appreciate it

____________________________________________
<?php // }
if ($this->userDetails->JUser->get ('id')) {
   echo $this->loadTemplate ('addshipto');
} ?>
<input type="hidden" name="option" value="com_virtuemart"/>
<input type="hidden" name="view" value="user"/>
<input type="hidden" name="controller" value="user"/>
<input type="hidden" name="task" value="<?php echo $this->fTask; // I remember, we removed that, but why?   ?>"/>
<input type="hidden" name="layout" value="<?php echo $this->getLayout (); ?>"/>
<input type="hidden" name="address_type" value="<?php echo $this->address_type; ?>"/>
<?php if (!empty($this->virtuemart_userinfo_id)) {
   echo '<input type="hidden" name="shipto_virtuemart_userinfo_id" value="' . (int)$this->virtuemart_userinfo_id . '" />';
}
echo JHTML::_ ('form.token');
?>