I am using PHP to get URL information and pass it as a product variation when I add an item on that page to the cart. For example, a URL would contain a redemption code for a discount on a product (e.g. www.example.com?code=HF325SG). When that product is added to the cart, the discount code HF325SG is listed as a product variation.



We are trying to set up another system like this, but the codes being used are integers and contain no characters (e.g. 12345). When I try to add an item to the cart, the cart window appears and just hangs on loading. However, if I add a letter to the front of the code in the url (e.g. www.example.com?code=A12345), the cart loads.



Is there some workaround that allows just a number to be used as a variation?

  • created

    Apr '14
  • last reply

    Apr '14
  • 1

    reply

  • 1.2k

    views

  • 2

    users

  • 4

    links

There's no inherent limitation at our end like that -- e.g., I just manually edited a basic Add to Cart button URL to add "&on0=12345&os0=67890" to its query string and had no trouble adding that item to a cart with those variation values -- so whatever problem you're having may be something to do with the scripting you're using to add that value. Note also the technicalities for passing on/os values here:

http://www.e-junkie.com/ej/help.custom.purchase-buttons.htm#product



The "cart hangs on loading" that you described can also happen if you don't have a live Internet connection when testing the cart in your page, since our cart buttons and script needs to contact our server to look up product details. See other testing tips here:

http://www.e-junkie.com/ej/help.test.htm