How To Give a Discount to customers of your JV-partner

Let’s suppose you decide to make JV with someone to sell you product.
One of the most popular methods is to give a discount to customers or subscribers of your JV partner. How to make it with your Order Page?
This simple PHP-script helps you modify your Order Page quick and easy.

Order Page

Usually your Order Page has an order form or a payment link which takes your customers to a payment system.

Order form

<form method="post"
action= "https://www.paypal.com/cgi-bin/webscr">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="my@email.com">
<input type="hidden" name="item_name" value="Item name">
<input type="hidden" name="item_number" value="1234">
<input type="hidden" name="amount" value="19.95">
<input type="hidden" name="no_shipping" value="1">
<input type="submit" value="Buy Now">
</form>

Order link

<a href="https://www2.2checkout.com/2co/buyer/purchase?
sid=12345&cart_order_id=20061218&total=19.95">Buy Now</a>

All you need is to change the price of the order (in red).

List of your JV partners

This script allows to have several JV partners with different discounted prices.

1) Create a price.php file with the code like below.
And upload it onto your site beside the Order page.

<?php
$price = 19.95; //Regular price

//Enter your partner's domain names with the desired prices
$discountFrom = array(
 "john-doe.com" => 9.95, //the best partner
 "mr.smith.com" => 17.00, //my new partner
 "site.com" => 18.00, //yet another JV partner
);

$referer = getenv("HTTP_REFERER");
foreach ($discountFrom as $from => $discount) {
 if (eregi($from, $referer)) { $price = $discount; break; }
}
?>

Note. When customers went through a link from this partner domains they would be offered with the appropriate price.

2) Rename your .html order page with the .php extension.
This will allow to execute php-code in your page.

3) Place this include code at the top of your order page:

<?php include("price.php"); ?>

4) Insert this php-code into your order form or payment link instead of the actual amount:

<?=$price?>

So your order.php page will look like below

<?php include(”price.php“); ?>
<HTML>
 <BODY>

… ORDER PAGE TEXT …

<form method="post"
action= "https://www.paypal.com/cgi-bin/webscr">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="my@email.com">
<input type="hidden" name="item_name" value="Item name">
<input type="hidden" name="item_number" value="1234">
<input type="hidden" name="amount" value="<?=$price?>">
<input type="hidden" name="no_shipping" value="1">
<input type="submit" value="Buy Now">
</form>

OR with a payment link

<a href="https://www2.2checkout.com/2co/buyer/purchase?
sid=12345&cart_order_id=20061218&total=<?=$price?>" >Buy Now</a>

 <BODY>
<HTML>

Live Sample

Take a look at the sample at this page.

<?php include("price.php"); ?>
<html>
<head>
<title>Discount Sample</title>
</head>
<body>

<button>Buy Now for $<?=$price?></button>

<a href="...">Click this link</a> to see the button discounted.

</body>
</html>

 

by Michel Komarov, © Copyright 2006. iCoder.com

 

Share in social bookmarking:These icons link to social bookmarking sites where readers can share and discover new web pages.  digg del.icio.us BlinkList Reddit NewsVine YahooMyWeb co.mments

Got a question?   Leave a Reply

You must be logged in to post a comment.