How to add a discount to the cart by clicking a link


A word to describe the The Spark Pay platform "robust". There are so many features that help make a storefront easy to use and configure. Often it is possible to combine the features of our systems to come up with some pretty neat effects. This KB is to show how a discount/coupon can apply to an order, by just clicking a link. 

This uses a combination of Adcodes and the Discount system. Feel free to check out our KB articles on these for more information.

To apply a discount to an order in this manner, an adcode needs to be created. You'll want to go to Marketing > Power Features > AdCodes in your administrator panel. Here, you'll want to create a new adcode, and give it a name.

AdCodes use something that is referred to as query strings. A query string is an additional command put at the end of a URL. The syntax for an adcode query string is ?a=youradcode. So for the discount in the picture above, the query string would be a=testdiscount. When you click a link that has this adcode query string, it associates the adcode with the visitor session. Now its time to set up the discount.

For this, you'll want to go to Marketing > Discounts, and create a new discount. One of the rules for the discount needs to be "AdCode equal to", with the adcode name already created as the target.

 

So now that we have the adcode set up, and the discount ready, we just need to create the link and add it to the page! So the URL for this discount would be: www.yourdomain.com/store/?a=testdiscount. Now when you click on it, it associates the adcode with your session. Since the rule is looking for this adcode, the discount should now apply to their order.

There are multiple edge case scenarios where this is useful. For example, this combines with our embedded commerce feature. Using these features, its possible to have a banner advertisement somewhere else on the internet provide a discount.  You could also turn this into a pop up window. Then if clicked, it will associate the discount with their session. There are so many creative ways to use this. We'd also love to hear your ideas for this! Let us know in the comments if you have any questions, or have come up with a creative way to use any of these features.

 

How helpful was this article?
Number of questions: 0