Pass variables through URL

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • alexplag
    Mivite Lite

    • Feb 2012
    • 3

    #1

    Pass variables through URL

    Hey Miva community,

    I had called staff and searched the web for this request and have not found much success.

    An affiliate web site can create a link to our store with various variables in the URL regarding the customers information / address, etc.

    We want to find a way so that our MIVA store can process the variables passed in the URL and fill out the checkout field so customers don't have to put the same information twice.

    Is there a tool to basically communicate the variables in the URL and place them in the customer information page?

    Is there a way to store the info in a global variable and pass it around manually from page to page?

    I don't know how I would go about doing this but can't imagine it is something that hasn't been done before!

    Thanks for any input!
  • Bruce - PhosphorMedia
    Developer Partner











    • Mar 2006
    • 11256

    #2
    Re: Pass variables through URL

    URL variables (those things which follow the "?" in a URL string) are CGI variables. As such, they are available to any page on which they are expressed. Meaning, that a user clicks www.mystore.com?this=foo&that=bar, whatever processes that page has two variables it can manipulate and display: "this" and "that". Specifically in merchant, those variables can be displayed using
    Code:
    &mvt:global;this;
    and
    Code:
    &mvt:global:that;
    or used in an expression like:
    Code:
    <mvt:if expr="g.that">
    Do This
    <mvt:elseif="g.this">
    Do That
    <mvt:else>
    Do something else
    </mvt:if>
    Bruce Golub
    Phosphor Media - "Your Success is our Business"

    Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
    phosphormedia.com

    Comment

    • alexplag
      Mivite Lite

      • Feb 2012
      • 3

      #3
      Re: Pass variables through URL

      Hey Bruce.

      That was helpful information.

      Let me explain what I want to do.

      User fills out form on separate website.

      Form will put all information into a url which links to the Miva store. The following is an example of the link:

      www.mystore.com/merchant.mvc?&ShipFirstName=test

      We want to be able to take all the bold variables and store them during the users session at our Miva store and when the user Checks Out, all the fields will already be populated based on the initial variables that were contained in the URL above.

      (PS. I have purchased Emporium Plus Toolkit as I know there was a tool called updatebasket and basketfiller that could be useful)

      How could i have something store all the variables from an initial referral link and keep it until user checks out?

      I'd love to learn more about it as I see some similar posts but none really mentioning how to pass variables through simple URL.

      Comment

      • Bruce - PhosphorMedia
        Developer Partner











        • Mar 2006
        • 11256

        #4
        Re: Pass variables through URL

        Well, yea, that's a different question: not "how do I process variables from a URL into a MivaMerchant script", but rather "How do I persist variables through out the MivaMerchant store"

        For the later, there are several methods:

        1) Detect and capture the data into a database. (Requires a significant level of scripting knowledge.)
        2) Pass the captured variables through each page. (Tedious and prone to errors.)
        3) Store the data in a cookie and pull it from there (A little less level of scripting.)
        and for your specific case
        4) On capture, send them to the Create Account, pre-fill that pages form with the URL data.

        I believe Tool kit has a 'function' that does #2....look for persistent variables or something like that, or ask Bill.
        5)
        Bruce Golub
        Phosphor Media - "Your Success is our Business"

        Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
        phosphormedia.com

        Comment

        • alexplag
          Mivite Lite

          • Feb 2012
          • 3

          #5
          Re: Pass variables through URL

          Hey Bruce,

          Thank you for your help. So I've been speaking with William. Really helpful guy.

          I managed to pass variables set in the URL to a cookie and have them output successfully in Firefox, Chrome and Safari.

          My biggest issue is the dreaded Internet Explorer.

          It appears that when going to the secure checkout page, there is a message IE says "there are both secure and non-secure items on this page, do you want to load both" I say yes.

          But then all the customer fields are blank.

          I feel this is probably a common problem for others using Cookies with IE as it seems like the script is working on every other browser.

          Do you have any idea of what needs to be done?

          the URL below is loaded with vars that pass through to checkout for most browsers. Try it out.



          any idea?

          Comment

          Working...
          X