Query String shortcuts

Give your customers the ability to add several items to their cart with one click. However you want to administer this link that we will show you how to create, you can have your customers add items to a cart in your site, even if they're currently viewing your website, with a link! There are many applications to apply this URL, like using them in an email, ads, custom pages etc

This is an example of what you'll be making:

Format: multi=sku:qty;sku:qty;

Example: www.mydomain.com/Cart.aspx?multi=ABC123:3;CBA456:2;XYX789:8

Below, we'll explain what all this means and how you can make your own.

Adding Products URL - Part One

What you are going to be building, is a link, that you can send/give to your customers. When they click on this link, it will add whatever you define.

You're going to be witting a bit of code, but we'll make it as straightforward as possible and do it step by step.

  • First, know that SKUs will be delimited (seperated) by semicolons (;).
  • To add the quantity number, put colon (:) after sku.
  • QTY is not required; if left blank, will assume 1.

With that being said, you'll write something that looks like this: "ABC123:3;CBA456:2;XYX789:8". This should read "I ordered 3 ABC123's, 2 CBA456, and 8 XYX789's." In this, "ABC123" is the sku and "3" is the quantity ordered etc.

Adding Products URL - Part Two

Next, you'll need to add what you just created, to your url. In this example we'll be using "www.mydomain.com/". Obviously the "mydomain" part is what you'll be replacing with your website name.

The next part of this piece is "/Cart.aspx?". So, so far it should look like this "www.mydomain.com/Cart.aspx?". Good so far?

Next after that is "multi=", so now we should have "www.mydomain.com/Cart.aspx?multi=".

Now lets put all these together. The last piece is adding what you created in Part One to the end of this, which should now read:

"www.mydomain.com/Cart.aspx?multi=ABC123:3;CBA456:2;XYX789:8"

 

Adding A Coupon To The Cart

You can also apply this same technique to let the customer apply a coupon to their cart as well. It's the same premises as the steps you just took, but changing out one or two components.

If you read the two steps above, this should look familiar and you should be able to make out what is going on here: "www.mydomain.com?applycoupon=SAVE5BUCKS".

Things that are different:

  • There is a "?" after ".com" instead of a slash
  • "/Cart.aspx?" and "multi=" are both replaced with "applycoupon="

Your domain obviously will need to be change, but instead of using "/Cart.aspx?" and "multi=", you'll be replacing both of those with "applycoupon=".

After making those changes to make the URL look like this "www.mydomain.com?applycoupon=" , all you have to do is put in the name of the coupon you create/created, and there you have it.

"www.mydomain.com?applycoupon=SAVE5BUCKS".