Custom coupon on thank you page

Questions and answers about ShopSite Custom Templates

Custom coupon on thank you page

Postby jlodwick » Wed Apr 25, 2012 4:07 pm

I wanted to see if there was a way to add a custom coupon to the thank you page for each product ordered (separate coupon for each product) with the order number on each coupon, our logo, company name, etc.. I was thinking maybe setting up a loop with the [OrderNum] [PRODUCT.Name] and [PRODUCT.Price]. Any ideas? Thanks, Jeff
jlodwick
 
Posts: 7
Joined: Wed Apr 25, 2012 3:57 pm

Re: Custom coupon on thank you page

Postby Jim » Thu Apr 26, 2012 12:52 pm

There is no built in way to automatically generate a coupon on the fly. So there isn't a way that this could be done in ShopSite.

I guess if you wanted to spend the time and create a lot of coupons, you could create individual coupons, for say the next 1000 or so orders, using the order number as the "Alternate Code:" (or as part of the code with some text added to it) . Then modify the shopping cart template in such a way that you add a line telling the shopper if they make another purchase and enter the order number (with any other text you used for the code) for the coupon code they will get a discount.

This wouldn't make the process automatic but it would be a way of giving a different coupon to each shopper.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Re: Custom coupon on thank you page

Postby jlodwick » Fri Apr 27, 2012 7:15 pm

Sorry for the misunderstanding I used the term coupon meaning something different than the shopsite coupons. Let me try to explain a little better what I'm trying to do. I have a site similar to Groupon. So on my site someone will buy a deal for lets say a massage for example. The product name says something like "$49 for 90 minute massage at Some Massage Store". Today I take that product name and the order number and put together a fancy "coupon" (for lack of a better term) with our logo and email it to them. I want to find some way to automate this process on the thank you page so it automatically creates this for each product so they can print them out with their receipt. Following is an example of exactly what I'm trying to do (automatically). Please scroll down to the bottom of the following page. http://www.spaenvydeals.com/Deals/coupon-testing.html

Thanks,
Jeff
jlodwick
 
Posts: 7
Joined: Wed Apr 25, 2012 3:57 pm

Re: Custom coupon on thank you page

Postby Jim » Fri Apr 27, 2012 8:33 pm

First of all, I just finished digging up my garden and applying compost to it. So how far will you travel to give a massage? :-)

There might be a way to do something like this if you have a ShopSite Pro level store. You would need that level to get the various features that you would need to create your "Coupons", (shopping cart javascript variables, Variable Price product). Note that the contents of the shopping cart are all dumped out by one tag so there is no way you could get the products ordered directly from the table. However, there are javascript variables available in a Pro level store that you could probably use. See http://www.shopsite.com/help/11.0/en-US/sc/pro/cart.variables.html for a list of the variables available. The Per-product Variables would probably be the ones you would find most useful.

Next you would want to create a Variable price product and enable the variable name and variable sku fields.

Then using the information from the javascript Per Product Variables you could substitute the necessary fields, probably name, price and (order number could be used as sku) into the variable product and create an OrderAnywhere type link to put on the receipt. See this forum post for sample code which you could modify http://support.shopsite.com/forums/viewtopic.php?f=1&t=7857 You could also use some of the Extra product fields if necessary since those are available in the javascript variables.

Note that I haven't tried this but it should be possible to do provided you know javascript or can hire someone that does.

Another option might be the Order API (found under Merchandising) and create a script that receives the parameters pass to it about the order and then use that information similar to what I described above. You could either use the OrderAPi too replace the thankyou screen or you could use it to send a separate email to the shopper with the "coupon" Documentation on Order API can be found at http://shopsite.com/help/11.0/en-US/sc/pro/order.api.html
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Re: Custom coupon on thank you page

Postby jlodwick » Fri Apr 27, 2012 9:41 pm

Hehe I don't do massage but if you want to take a vacation out to Colorado I could get you one of our deals for a massage. :wink: I've been doing some research on this and actually found out about the javascript options and have been playing around with it. I've gotten pretty close. I currently have it so it will post one coupon using javascript with the variables from ShopSite (my coupon-testing page I sent you is updated with this too). I just need to figure out how to do a loop with it. I'm sure I'll figure this out but if you know javascript maybe you could help me. I currently have the javascript below. If I change "ss_name[1]" then it updates with the info in "ss_name[1]" so like I said it's working for one product but if they order more then one "ss_name[1]", "ss_name[2]", etc. then it obviously doesn't work. I think I need to do a "for" loop for this but I am really new to javascript so I'm not sure how to do this. By the way I do have the Pro version of ShopSite.

<script type="text/javascript">
<!--

if (ss_name[0]) {
document.write ("<div id=\"testing\"><img src=\"design/coupon.png\"></div><div id=\"testing1\">");
document.write(ss_name[0]);
document.write("</div>");
document.write ("<div id=\"testing2\">Order Number:");
document.write (ss_ordernum);
document.write ("</div><br><br><br><br><br><br><br>");
}
// -->
</script>
jlodwick
 
Posts: 7
Joined: Wed Apr 25, 2012 3:57 pm

Re: Custom coupon on thank you page

Postby jlodwick » Fri Apr 27, 2012 9:51 pm

I found a link that had pretty much exactly how to do this javascript code (with minor modification needed) and I got it working :D Here's my code just in case anyone is interested:

<script type="text/javascript">
<!--
for (i = 0; i < number_products; i++) {
if (ss_name[i]) {
document.write ("<div id=\"testing\"><img src=\"design/coupon.png\"></div><div id=\"testing1\">");
document.write(ss_name[i]);
document.write("</div>");
document.write ("<div id=\"testing2\">Order Number:");
document.write (ss_ordernum);
document.write ("</div><br><br><br><br><br><br><br>");
}
}
// -->
</script>
jlodwick
 
Posts: 7
Joined: Wed Apr 25, 2012 3:57 pm


Return to Custom Template Questions

Who is online

Users browsing this forum: No registered users and 86 guests

cron