Hi,
I have problems to make WP Affiliate Platform work on my blog. My wordpress version is 3.0.5 and the WP Affiliate Platform is 4.7.1. My shoping cart system is WP Shop Germany (a popular German WP shopping system) written in PHP. Her's an example product page of my blog: http://www.driediger.de/menowin-froehlich-biografie-ich-musste-verlieren-um-zu-gewinnen/
I've followed your instructions from this documentation page:
http://www.tipsandtricks-hq.com/wordpress-affiliate/awarding-commission-via-http-get-or-post-189
I've integrated the mentioned PHP-example code as instructed on the thank you page of the shopping cart and performed some tests. The affiliate platform just counts the clicks, but there is no commission awarding and the sales count is always "0".
I'm really frustrated especially because I don't know what I'm doing wrong. It would be nice if you could give me some additional instructions to make it work.
To make it clearer what I've done here's the exact code of my "Thank You page". The "Thank You Page" (do.phtml) appears when the costumer clicks the order (bestellen) button on the checkout overview. The costumer makes the payment manually after recieving the product invoice. So here's the code:
<?php
/*
Dieses Template wird nach Abschluss einer Bestellung angezeigt. Es können folgende Platzhalter verwendet werden.
<?php echo $this->order_id; ?> Returns the orderID
<?php echo $this->k_id; ?> Returns the costumerID
<?php echo $this->order_data['price_gesamt']; ?> Returns the sale amountAuf die bestellten Produkte können sie mittels $this->basket zugreifen.
<?php echo sizeof($this->basket); ?> Returns the number of ordered products
<?php echo $this->basket[1]['anr']; ?> Returns 1st productID
<?php echo $this->basket[1]['menge']; ?> Returns the ordered amount of 1st product
<?php echo $this->basket[1]['preis']; ?> Price of 1st product*/
?>
<div class="wpshopgermany">
<h2><?php echo __("Schritt 5 von 5: Abschluss der Bestellung", "wpsg"); ?></h2><?php if ($this->failed) { ?>
<h2><?php echo __("Die Bestellung konnte nicht durchgeführt werden.", "wpsg"); ?></h2>
<?php } else { ?>
<h2><?php echo __("Vielen Dank für Ihre Bestellung", "wpsg"); ?></h2>
<p><?php echo __("Ihre Bestellung ist erfolgreich in unserem System eingegangen und wird bearbeitet. Vielen Dank für Ihr Vertrauen.", "wpsg"); ?></p><?php
// The sale amount. You get this value from your payment gateway or the shopping cart
$sale_amt = $this->order_data['price_gesamt'];
echo $sale_amt;// The Post URL (Get this value from the settings menu of this plugin)
$postURL = "http://www.driediger.de/wp-content/plugins/wp-affiliate-platform/api/post.php";
echo $postURL;// The Secret key (Get this value from the settings menu of this plugin)
$secretKey = "4e09fc1de376d";
echo $secretKey;
// Retrieve the value from the browser's cookie to find out who the referrer was
$affiliate_id = $_COOKIE['ap_id'];
echo $affiliate_id;// Prepare the data
$data = array ();
$data['secret_key'] = $secretKey;
$data['ap_id'] = $affiliate_id;
$data['sale_amt'] = $sale_amt;// send data to post URL to award the commission
$ch = curl_init ($postURL);
curl_setopt ($ch, CURLOPT_POST, true);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
$returnValue = curl_exec ($ch);
curl_close($ch);
?><?php } ?>
<?php foreach ($this->modText as $t) { echo $t; } ?>
</div>
Any ideas to solve this problem?
Thx in advance for your support.
Eddie