Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1
    Join Date
    Aug 2008
    Posts
    448
    Plugin Contributions
    0

    Default Getting variables from link clicked

    Hello,
    I don't know where to post for this question. Basically, I want to perform a certain action on tpl_login_default.php based on where the customer came from. So far they either come from
    Login: http://www.meaningfulaccents.com/ind...ain_page=login

    or

    Continue checkout on Shopping cart: http://www.meaningfulaccents.com/ind...ckout_shipping

    I was thinking of using main_page as an argument, but I don't know how to pass it all the way to tpl_login_default.php. So then I tried to grab the previous clicked link and just do my conditional statements from that but I don't know how to do that either. Anyone can help? Thanks.

  2. #2
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Getting variables from link clicked

    Why ?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Aug 2008
    Posts
    448
    Plugin Contributions
    0

    Default Re: Getting variables from link clicked

    Hi Dr. Byte,
    The reason is because I want to display certain words/sentences and button when they are doing a proceed to checkout as oppose to when they want to login/create account. All this of course being for user friendly experience for customers. For example, I've decided to remove the paypal EC button from that page because I find it weird to present it twice once on shopping cart and then again after they click proceed to checkout. If you want me to go more into detail, let me know. Thank you for your help.
    Last edited by ebaobao; 16 Sep 2011 at 04:32 AM. Reason: typo

  4. #4
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Getting variables from link clicked

    Code:
    <?php if ($_SESSION['cart']->count_contents() > 0) { then there's something in their cart so it's likely they've arrived with intent to checkout }
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Aug 2008
    Posts
    448
    Plugin Contributions
    0

    Default Re: Getting variables from link clicked

    Hi Dr. Byte,

    Thank you. However, that would still not satify the condition where they are in their shopping cart and then click on the login link. I want login to be very distinct from proceed to checkout whenever they click the login link. Any other ideas? Thanks again.

  6. #6
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Getting variables from link clicked

    If they're in their shopping cart and click the login link, then they'll have something IN their cart, and thus the code I posted will work.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  7. #7
    Join Date
    Aug 2008
    Posts
    448
    Plugin Contributions
    0

    Default Re: Getting variables from link clicked

    Hi Dr. Byte,
    I appreciate the help. Thank you. I understand what you mean. Maybe I'm not being clear about what I want, so let me try again. Lets take the case where the user has added an item to their cart.

    1. after adding, the user is at the shopping cart page.

    2. Now from there, the user can click proceed to checkout or the login link in the header.

    3. currently, the behavior is that both of those links will give the exact same login page because ZC recognizes that the cart has an item. that is NOT what i want.

    4. for example, if the user clicks on login link, I don't care what they are doing or where they are at or even if there is an item in cart or not. I will just present to them ONLY the username & password fields. I DON'T want to show the user the new customer? sign up stuff.

    5. if they click on proceed to checkout, then I will include the new customer? sign up stuff and also the username & password fields to the right.

    hope this is a little more clear. Thank you for your help again. Any suggestions?
    Last edited by ebaobao; 17 Sep 2011 at 03:24 AM. Reason: typo

  8. #8
    Join Date
    Aug 2008
    Posts
    448
    Plugin Contributions
    0

    Default Re: Getting variables from link clicked

    Here is a better example. When a user clicks login or my account, it brings up the exact same login page.
    login url: http://www.website.com/index.php?main_page=login
    my account url: http://www.website.com/index.php?main_page=account.
    I don't want the same thing for those links. for my account link i want the login page to only display username/password fields. since they want to go to their account, it doesn't make sense to ask them if they are a new user and if they want to sign up since they have an account already. I want to recognize where the user came from by what link they clicked on and display the login page with specific info based on where they came from. That is why I was planning to use the main_page parameter in the url for my if/else statements. What would be the best approach for this? Thanks.

  9. #9
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Getting variables from link clicked

    So, you're saying that if I come along as a new customer to your shop and want to create an account, and the only remotely close option I have for that is your "Login" link, and I click that, you're NOT going to give me the option to create an account? Doesn't seem very intuitive.

    Why are your customers bothered by seeing the option to register beside the login fields? Especially when the cursor is already set into the username login field ready for them to proceed with login easily?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  10. #10
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default Re: Getting variables from link clicked

    The argument for your desired functionality lacks logic and common sense...

    The system has no way of knowing whether a visitor is an existing customer, or a new customer, when they click "checkout".

    (As it is about to become illegal - in the EU - to set such cookies, using this method to remember a customer is no an option).

    I do not know of any web shopper who has been "offended" when presented with both LOGIN and REGISTER invitations.

    People are not stupid... they will know which one to select...
    20 years a Zencart User

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v151 Modifying Products URL Link - Adding Client Variables Dynamically.
    By Matt Staines in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 26 Oct 2013, 10:44 AM
  2. navbar/mouseover make a link stay highlighted when its clicked
    By missanna in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 10 Jun 2010, 07:47 AM
  3. Google checkout not working getting Oops! page when button is clicked???
    By paddy_uk2007 in forum Addon Payment Modules
    Replies: 2
    Last Post: 11 Dec 2008, 01:27 PM
  4. How to Remove Categories from Center after clicked from Navigation menu?
    By stlnyc in forum Customization from the Admin
    Replies: 0
    Last Post: 30 Oct 2008, 09:10 PM
  5. Layout enlarges when any link is clicked.
    By punkprints in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 13 Jul 2008, 06:13 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg