HOW DO I Create An Alternate Static HTML Thank You Page

General ShopSite user discussion

HOW DO I Create An Alternate Static HTML Thank You Page

Postby crowco » Mon Jan 08, 2007 4:37 pm

Our shopsite 8.0 store is offering a new eBook which requires a third party key from ebookgold.com to be displayed on a static confirmation or thankyou page. I want to place it on the thankyou page but it should only show if the ebook is in the shopping cart.

I wrote some javascript and placed it in the Text Area labeled "Text at the top of the Thank You screen:" at the top of the Thank You screen. It worked, but since the thankyou.cgi page isn't static, ebookgold refuses the connection and the unlock codes could not be accessed. So, I wrote this javascript and placed it in a table located in the Thank You Page Definition in a custom shopping cart template but then the shopping cart freezes to a blank screen when you try to access it. Is it possible to redirect to an alternate HTML thank you screen based on specific items in the shopping cart ?

Does anyone know how to redirect to an alternate static thankyou.html page If a specific product is in the customer's shopping cart?

Code: Select all
<script language="javascript" type="text/javascript">
var i = 0;
var x = 0;
ProdName = new Array();
i = ss_name.length;

do
{
ProdName[x] = ss_name[x];

   if(ProdName[x] == "TEST PRODUCT")
   {
   document.write("You MUST use the KEY NUMBER to unlock your eBook");
   document.write("<img alt=" + "Unable to retrieve your PIN from the database. Please contact your e-book supplier for a valid PIN code." + "src="+ "http://www.ebookgold.com/1234/1234/" + " border=" + "0" + ">");
   }
   x++;
   i--;
}
while(!(i == 0))
</script>


If anyone can offer assistance I would be extremely greatful. Otherwise, I think I just might have to pull my hair out.

Thanks in advance for you assistance

Craig
crowco
 
Posts: 5
Joined: Mon Jan 08, 2007 4:11 pm

Postby robm » Tue Jan 09, 2007 5:22 pm

Try something like:
Code: Select all
<script type="text/javascript">
<!--
for (i = 0; i < number_products; i++) {
         if (ss_name[i].match(/TEST PRODUCT/)) {
             document.write('<img alt="Unable to retrieve your PIN from the database. Please contact youre-book supplier for a valid PIN code" src="http://www.ebookgold.com/1234/1234" border=0>');
         }
}
// -->
</script>
robm
 
Posts: 463
Joined: Fri Aug 04, 2006 5:46 pm
Location: Connecticut

How Do You Access Shopsite Variables from Static HTML Page?

Postby crowco » Tue Jan 09, 2007 7:08 pm

Thanks for your reply rob. Your code is very succinct. Very nice. But the code has to be on a static html page because the security confirmation servers need a known existing page to validate.

Here is what I am trying now. I placed a link to my alternate thank you page on the final thankyou screen and your javascript runs there (it was much cleaner than mine). So far, so good. Everything works like a charm but I really need to force a login on this page before the javascript runs. I don't want to expose an active script on a static page for everyone and their brother to find.
I was thinking of using an IFRAME for Remote Scripting. I would like to display the ebook unlock codes based on successful login and verification that the product was puchased.

I need to access the Shopsite customer userid/pw data and be able to parse the customer's orders to confirm they purchased a book. Can that be done from a static html page (or a custom page)? If not, does anyone have any other ideas?

Thank you in advance your assistance

Craig
crowco
 
Posts: 5
Joined: Mon Jan 08, 2007 4:11 pm

Postby Jim » Tue Jan 09, 2007 8:49 pm

Have you checked out the Order API option available in ShopSite Pro stores? http://www.shopsite.com/help/8.2/en-US/ ... r.api.html ShopSite will pass all parameters from the order to a cgi that you create as name=value pairs. You can then create your own thankyou page as you need and even send the email receipt to the shopper.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Postby crowco » Tue Jan 09, 2007 9:20 pm

Thanks for your quick response Jim. That wasn't the answer I was hoping for but it is what it is. I guess I have to go learn about Order API's and PERL script now.

Again. Thank you

Craig
crowco
 
Posts: 5
Joined: Mon Jan 08, 2007 4:11 pm

Shopsite Order API with PHP

Postby mokele » Wed Jan 10, 2007 6:25 pm

You can also use PHP with the Shopsite Order API.
Scott Norman
Web Developer/Programmer
YourHost.com
Ecommerce Web Site Hosting & Internet Solutions
mokele
 
Posts: 20
Joined: Thu Aug 10, 2006 12:30 pm
Location: Fountian Valley, CA


Return to User Forum

Who is online

Users browsing this forum: No registered users and 93 guests

cron