Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

VirtueMart Problem with Login Module

VirtueMart Problem with Login Module

H Stephen,

I'm struggling to use Pro with VirtueMart.

I have 2 templates: "HomePage" and "Insidecontent". The later includes VirtueMart as well as other pages.

MTP directs the selected menu item to the correct template correct.

However, if from inside VM I select the "forgot password" or "forgot username" then MTP redirects me to the Homepage where VM now displays the form. Both these features are contained within  mod_virtuemart_login  - this being a module. And yet "create new account" which is also part of the same VM module DOES correctly go to the "inside" template.

I have selected within MTP rules the VM component, The succeed template set to "inside" the fail set to "homepage' and in both cases 'proceed to next rule'

lastly, very curious - it makes no difference whether I have or have not selected any menu items from "inside" it redirects regardless to the correct page even though homepage is set as default.

I don't get it

Many thanks Vince

Edited By: vincej
21-Sep-10 19:14:32

vincej
Beginner Modder
ranks
useravatar
Offline
4 Posts
Administrator has disabled public posting

Re: VirtueMart Problem with Login Module

Hi Vince,

let me address those issues one by one.

(1) the "forgot password" & "forgot username" links are opening in the "HomePage" template rather than the "Insidecontent" template

This is because of a fundamental problem in Joomla - if no Itemid is specified in a URL, the page gets treated as if it was the frontpage, as far as assigning modules and templates is concerned.

That's why MetaTemplate Pro also has a "page type" selector, which is a lot more specific. So I set up my test by selecting "frontpage (blogstyle)" from the page type, instead of selecting "Home" from the menu list.

If you're using the standard "frontpage" component on your site, I'd suggest doing the same. If however you're using a different type of front page (e.g. an article view) then you'd do it slightly differently - ask if you want an explanation for that.

(2) "Create new account" goes to the right template
- this is because it includes an Itemid in the URL, so Joomla picks this up and knows that you are not on the front page.

(3) Even when you add a rule to check for the Virtuemart component, and tell it to use the "Insidecontent" template, it still doesn't change the template for the Forgot Password links
- that's because these links are not actually to pages that are part of Virtuemart. They are links to the com_user component smile  So if you need to target these, select "com_user" from the component list. However, hopefully you won't need to do this if you get (1) working properly.

(4) "it makes no difference whether I have or have not selected any menu items from "inside" it redirects regardless to the correct page even though homepage is set as default"
- I'm not 100% sure what you mean here.
- If you mean that you are trying to set a new "default" page using the "Site Default Menu Item" dropdown in the SUCCEED/FAIL actions, then you're probably using them for the wrong thing [and there's a bit of a bug with them which is fixed in the upcoming release]. See documentation for this feature on this page.
- If you're trying to do a redirect using the "redirect page..." selector, then... why?

Hope that helps!
Cheers,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3313 Posts
User info in posts
Administrator has disabled public posting

Re: VirtueMart Problem with Login Module

Hi Stephen, I was hoping to clarify a few things from this post. Hopefully you can help me.  I am currently using the free version of MetaTemplate, so if at any point my issues can be solved by purchasing the Pro version, please let me know.  I am also using Joomla 1.5 w/ Virtuemart.

Site: http://pbresortwear.com/
guest login: guest
guest pass: guest2010

Goal: landing page = login page template (which it currently is) with virtuemart login module. Once user logs in, the template switches to the default VM template and places the user on the about page (itemid=1).

What is currently happening: http://pbresortwear currently lands on the correct page and template. (itemid=27 menutype=login).  Once they log in, the template changes to the default VM template (which is what is wanted) but it stays on the same itemid=27 (menutype=login).  I need it to link to itemid=1.

Currently the only rule I have setup thru MetaTemplate is:

if ( MM_NOT_LOGGED_IN )
    return "piranhabay_login";
if ( MM_LOGGED_IN )
    return "piranhabay";

This is placed in the "advanced" section of the rule.  Am I missing something?  How can I accomplish my goal.  Do I need to purchase the PRO version to accomplish this?

Your help is much appreciated.

Thank you,

Jimmy

thebadcharacter
Beginner Modder
ranks
useravatar
Offline
3 Posts
Administrator has disabled public posting

Re: VirtueMart Problem with Login Module

Hi Jimmy,

You say that you want the page to change to Itemid 1 instead of Itemid 27 when they log in. This seems to be the first problem to start with. Unfortunately the VM login module doesn't give you the option to redirect to another page on login like the standard Joomla login module does.

This could be fixed reasonably easily with some modifications to the VM module to support setting the page (Itemid) that it should redirect to after login. There's code in the standard login module that can be used almost exactly to achieve this.

If this could be fixed, would it solve everything else for you?

Cheers,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3313 Posts
User info in posts
Administrator has disabled public posting

Re: VirtueMart Problem with Login Module

Thanks for the reply, I took your advice and edited the VM login module to redirect the user (on login) to the 'about' page.

I also changed the rule to the following:
under 'Advanced" -

if ( MM_NOT_LOGGED_IN )
    return "piranhabay_login";

default PHP return value: false

Succeed Actions:
Set template: Login Page
Default menu item: login

This works for the most part; A non logged in user is taken to the default login page under the correct template, and now that I changed the login module to redirect to the correct menu item (the about page), this also uses the correct template. 

now my current issue: When a logged in user clicks the home page link, I would like it to send them to the about page (same menu item as when they first successfully login).  It instead sends them to the default login menu item, which is the login page.

jimmy

thebadcharacter
Beginner Modder
ranks
useravatar
Offline
3 Posts
Administrator has disabled public posting

Re: VirtueMart Problem with Login Module

Hi Jimmy,

you say "I would like it to send them to the about page (same menu item as when they first successfully login)".

If the home page link is to "/" (not /home or anything else like that) then that can be controlled with the Default Menu Item.
You stated above that you set the default menu item to the login page - that's why people are being sent there. (although I don't get how that's happening for logged in users... perhaps there's another rule activated?)

What I'd do is this:

- set up a rule like this:
In the PHP, use:

if (MM_LOGGED_IN) return true;

(with the default PHP return value set to false)

- in the SUCCEED action, select a template from the dropdown list if you need to. Set the Site Default Menu Item to the About page.
- in the FAIL action, select the piranhabay_login template from the dropdown list. Set the Site Default Menu Item to the login page.

I *think* this will do what you've asked for, and keeps the rule fairly simple.

Cheers,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3313 Posts
User info in posts
Administrator has disabled public posting

Re: VirtueMart Problem with Login Module

Thanks Stephen, that rule provides the same result, but cleaner.


The login page was set as the default menu item. I set the 'About' page as the default menu item (and made the article access level to registered users). This seems to do the trick.  Thank you very much for the help!

Jimmy

thebadcharacter
Beginner Modder
ranks
useravatar
Offline
3 Posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1679
Total Polls:
6
Total Posts:
5913
Dormant:
User Info:
 
Total Users:
10796
Newest User:
mokao3
Members Online:
0
Guests Online:
165

Online: 
There are no members online

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked