3 / 3
May 2012

Hi, my product inlcudes both variants and variations and i wish to construct a URL that will pass all the relevant choices through.



What is the format for passing variations?



I am using this format for variants which works well:

https://www.e-junkie.com/ecom/gb.php?c=cart&i=1094184&cl=148641&ejc=2&o1=BABYBLUE-BT-BB&quantity=1



However I'm not sure how to pass variations through in the URL. My variations are 'text', 'colour' and 'font'.



many thanks

  • created

    May '12
  • last reply

    May '12
  • 2

    replies

  • 993

    views

  • 2

    users

  • 8

    links

This help page subsection covers that topic to some extent:

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



This help page explains Variations and Variants configuration:

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



Our system can handle GET and POST variables interchangeably, so anything passed via a form field/menu can also be passed via URL parameter with the same variable name, and vice-versa -- e.g., this is our typical Cart button code for an item using Variations:



<form action="https://www.e-junkie.com/ecom/gb.php?c=cart&i=XXXXXX&cl=YYYYYY&ejc=2" target="ejejc" method="POST" accept-charset="UTF-8">

<input type="hidden" name="on0" value="Size"/>

Size:<br/>

<select name="os0">

<option value="Small">Small</option>

<option value="Large">Large</option>

</select>

<br/>

<input type="image" src="http://www.e-junkie.com/ej/ejadd_to_cart.gif" border="0" alt="Add to Cart" class="ec_ejc_thkbx" onClick="javascript:return EJEJC_lc(this.parentNode);"/>

</form>



...but you could also pass a predetermined Size parameter using Variations via this URL:



https://www.e-junkie.com/ecom/gb.php?c=cart&i=XXXXXX&cl=YYYYYY&ejc=2&on0=Size&os0=Large



Note that Variations parameters must be passed in pairs (on0/os0, on1/os1, on2/os2) but the values passed for those names can otherwise be completely arbitrary -- i.e., they don't need to match names/values specified in the product's Define Variations screen, and indeed you don't even need to enable "Variations which tell more..." in the product's settings (that setting and Define Variations are only used to auto-generate button code with the desired menus/fields).



However, if you're using Variants (as distinct from Variations), that must be enabled and configured in the product settings, and any Variants values (o1, o2, o3) passed via form menu or URL parameter must exactly match values you have configured in the product's Define Variants screen.

Hi, Thanks for this.



It was the need to pass both the name and value that i had not realised - i've got it working now.



The key bit i could not find was this example:



on0=Size&os0=Large