Forum Replies Created
-
AuthorPosts
-
July 2, 2011 at 3:06 pm in reply to: Awarding Commission via HTTP GET or POST – Problems to make it work #33833mreddieMember
Thank you for your quick support. You saved my day!!!
Everything’s fine now!!!
Regards,
Eddie
July 1, 2011 at 9:56 am in reply to: Awarding Commission via HTTP GET or POST – Problems to make it work #33831mreddieMemberThx for your quick reply.
I’ve performed the above instructions. Here’s the “new” code of the “Thank You Page” after modification:
<?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; ?> Returns the sale amount
Auf 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]; ?> Returns 1st productID
<?php echo $this->basket[1]; ?> Returns the ordered amount of 1st product
<?php echo $this->basket[1]; ?> 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;
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;
echo $affiliate_id;
// Prepare the data
$data = array ();
$data = $secretKey;
$data = $affiliate_id;
$data = $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);
print_r($returnValue);
curl_close($ch);
?>
<?php } ?>
<?php foreach ($this->modText as $t) { echo $t; } ?>
</div>
After a test-order (the sale amount was €12,90, the test-affiliateID is “mreddie”, the secretKey is “4e09fc1de376d”) I got this results:
A screenshot of the “Thank You Page” after the test:
http://www.driediger.de/files/scr_ThankYouPage.jpg
This is the output of the “aff_commission_post_debug.log”-file after the test:
[06/29/2011 5:51 PM] – SUCCESS :Start Processing…
[06/29/2011 5:51 PM] – SUCCESS :Request does not have any GET or POST data.. cannot process request
[06/29/2011 5:56 PM] – SUCCESS :Start Processing…
[06/29/2011 5:56 PM] – SUCCESS :Request does not have any GET or POST data.. cannot process request
[06/30/2011 11:56 PM] – SUCCESS :Start Processing…
[06/30/2011 11:56 PM] – SUCCESS :Request does not have any GET or POST data.. cannot process request
[07/01/2011 12:00 AM] – SUCCESS :Start Processing…
[07/01/2011 12:00 AM] – SUCCESS :Request does not have any GET or POST data.. cannot process request
[07/01/2011 9:31 AM] – SUCCESS :Start Processing…
[07/01/2011 9:31 AM] – SUCCESS :Request does not have any GET or POST data.. cannot process request
-
AuthorPosts