Lately, we've been getting a few requests for something really tricky -- some merchants want to redirect buyers to a thank-you page hosted on their own Web site, and yet still display E-junkie download links in their site's thank-you page. This can be done when you redirect to a Common Thank-you Page URL (set in Seller Admin > Account Preferences). The thank-you page on your site will need to have an IFRAME with its src= URL set to:
https://www.e-junkie.com/ecom/rp.php?noredirect=true&client_id=CID&txn_id=TXNID
...where CID is your E-junkie client ID number (which you can find in Seller Admin > Account Summary) and TXNID is the unique value for txn_id= that we append to your thank-you page URL during each redirection. Since the value for txn_id= is unique for each transaction, you would need to add some custom scripting in your thank-you page, which would grab the txn_id= value from the page's own URL for each visit and rewrite that value onto the end of that IFRAME src= URL (see examples below).
If you want to customize what gets displayed inside that IFRAME, you would need to customize your E-junkie thank you page. For instance, you may want to add some custom CSS to your E-junkie-generated thank-you page (a good place for this would be Seller Admin > Account Preferences > Common Thank-you Page HTML), so the IFRAME content would better resemble the styling of your own site's thank-you page where the IFRAME is embedded.
Disabling product-specific emails/links
Any product-specific thank-you emails sent for download products would by default carry a link to the E-junkie-generated thank-you page for that product, rather than redirecting to your site's Common Thank-you Page URL. If you want to make sure your buyers would only ever see your site's custom thank-you page with IFRAME-embedded download links, Enable Templated Email for each product and then either:
- Include the code
[%thankyou_link%] in your product's Email Message template, which would insert a link that activates your Common Thank-you Page URL redirection;
...OR...
- Leave the product's Email Message field blank to disable the product-based email entirely, so buyers would receive only your Common Thank-you Email, which should include the
[%thankyou_link%] code to insert a link that activates your Common Thank-you Page URL redirection.
Code Examples
Using PHP:
Some PHP like this should insert the IFRAME into your page before it gets served to the buyer's browser:
<?php
echo '<iframe src="https://www.e-junkie.com/ecom/rp.php?noredirect=true&client_id=CID&txn_id=' . htmlspecialchars($_GET["txn_id"]) . '" style="width:100%;border:0;height:500px;"></iframe>';
?>
Using JavaScript:
If you're not familiar with using PHP, you could paste this JavaScript (note where you need to replace CID with your own E-junkie client ID) into your site's thank-you page wherever you want the buyer's browser to add the IFRAME after it gets served to the browser:
<script type="text/javascript">
<!--
function gup( name )
{
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regexS = "[\\?&]"+name+"=([^&#]*)";
var regex = new RegExp( regexS );
var results = regex.exec( window.location.href );
if( results == null )
return "";
else
return results[1];
}
document.write("<iframe \
src=http://www.e-junkie.com/ecom/rp.php?noredirect=true&client_id=CID&txn_id="
+gup('txn_id')+" style='width:100%;border:0;height:500px;'></iframe>");
// -->
</script><noscript>This page requires JavaScript to display your download link. You can either enable JavaScript in your browser and reload this page, or contact the seller to get a direct link to a download page that will work without JavaScript.</noscript>
NOTE: this JavaScript method will not work for buyers who have disabled JavaScript in their browsers, so if they contact you about it, you may need to send them a link manually from Seller Admin > Send Free Download Link.