How to add products to basket from a text link
Products are normally add to a user's shopping basket when the user clicks the 'add to basket' option.
If product variations (like sizes or colours), and/or product extras, are available on the product, then the visitor will have to select those options first before adding the item to their basket.
You may want the visitor to be able to add a product to their basket by clicking a quick link (rather than a button on the product page) and if a product has variations or options, these can be preselected for the customer.
The visitor will click a text link like 'add to your basket' or it could be an image. A good example is shown below:
Creating the URL
Here's an example URL
http://www.yourdomainname.com/lion-t-shirt?add-to-basket&quantity=2&variation[Colour]=Green
The first part, before the query parameter, is the URL for the product. This can be obtained by going to the product on your website and copying the URL from your browser's address bar.
The part after the question mark has the following features:
add-to-basket
tells ShopWired to add the product to the basketquantity
tells ShopWired the quantity of the product to addvariation
if the product has variations, the variations that should be selectedchoice
if the product has choices, the choices that should be selectedextras
if the product has extras, the extras that should be selectedcomments
allows comments to be added to the product in the order (such as customisation text)
Variations
Variations
variation[variation-name]=variation-selected
For variations, construct the URL by using variation-name
and variation-selected
. For example, variation[size]=small
.
variation-name
is the name of the option (like 'size' or 'colour')variation-selected
is the name of the variation that you would like to be selected (e.g. 'small' or 'green')
Multiple variations can be configured with the &
character, e.g
variation[size]=small&variation[colour]=green
Choices
Choices
choice[choice-name]=choice-selected
For choices, construct the URL by using choice-name
and choice-selected
. For example, choice[finish]=metal
.
choice-name
is the name of the product choice (like 'finish' or 'material')choice-selected
is the name of the choice that you would like to be selected (e.g. 'metal' or 'walnut')
Multiple choices can be configured with the &
character, e.g.
choice[finish]=metal&choice[feet]=walnut
Extras
Extras
extras=choice-ID
For extras, use the unique ID of the product extra. For example, extras=10103
.
choice-ID
is the unique ID of the product extra
Multiple product extras can be configured with a comma, e.g.
extras=10103,10903