–Hidden comment

Use attributes in format region_from and region_to= to change the languages showing in language switcher.
Available regions are:
europe_from europe_to
asia_from asia_to
mideast_from mideast_to
america_from america_to

Example:
europe_from=0 europe_to=22 will put all languages (ordered in language switcher settings) from 1 to 21 to Europe region:
asia_from=22 asia_to=25 will put all languages from 23 to 24 (so only 2) into Asia region.

Summer Cart

An easy-to-use full-featured PHP shopping cart.

Summer Cart has all the tools and features to enable online merchants easily build a working store from top to bottom. Whether you sell a dozen of niche specialties, or list hundreds of mass products, you will get high visibility and popularity of your operation through a masterly crafted store.

Integration of Post Affiliate Pro with Summer Cart will require to modify not just footer of your shop (to add click tracking code), but also 2 shopping cart classes. See details of this integration below.

Click integration

Click tracking code should be stored into file skins//customer/footer.tmpl.

If you don’t have this file in your skin, just copy it from skeleton directory to your theme directory and add click tracking code, which is prepared for you in Post Affiliate Pro (menu Tools -> Integration -> Click tracking)

Add this code before </body> tag in your footer.tmpl template.

Sale Integration

Sale integration will work in 2 steps and integration is done by calling PAP API requests to Post Affiliate Pro directly from php code of your shopping cart.

In first step will be created transaction in Post Affiliate Pro (status Pending) and later, when order will be delivered to your customer, transaction in Post Affiliate Pro will change status to Approved.

Add transaction step

Your shopping cart will create order in time, when is visitor redirected to payment processor (e.g. Paypal). In same time is created transaction in Post Affiliate Pro (status Pending)

Open the shopping cart file: /include/sc/util/order/OrdersInProgress.php

so that we can place there the sale tracking code right at the end of class scOrdersInProgress .

In order to track the entire order as 1 transaction (commission) in Post Affiliate Pro (even if multiple items are purchased during the particular order) use the following code:

private function registerNewPostAffiliateProTransaction($order) {
    include_once('<PATH_TO_PAP_API>/PapApi.class.php');
    $saleTracker = new Pap_Api_SaleTracker('https://URL_TO_PostAffiliatePro/scripts/sale.php');

    $productIDs = '';
    $items = $order->getOrderItems();
    foreach($items as $item) {
       $productIDs .= $item->get('OrderItemProductCode').',';
    }

    $sale = $saleTracker->createSale();
    $papOrderDetails = $order->getOrderTotalLines();
    $sale->setTotalCost($papOrderDetails[0]->get('OrderTotalLineCustomerCurrencyAmount'));
    $sale->setOrderID($order->getPK());
    $sale->setProductID($productIDs);
 
    $saleTracker->register();
}

If you wish each item purchased during the order to be tracked as a separate transaction (commission) in Post Affiliate Pro, then use the following code:

private function registerNewPostAffiliateProTransaction($order) {
    include_once('<PATH_TO_PAP_API>/PapApi.class.php');
    $saleTracker = new Pap_Api_SaleTracker('https://URL_TO_PostAffiliatePro/scripts/sale.php');
      $items = $order->getOrderItems();
      foreach($items as $item) {
          $sale = $saleTracker->createSale();
          $sale->setTotalCost($item->get('OrderItemTotal'));
          $sale->setOrderID($order->getPK());
          $sale->setProductID($item->get('OrderItemProductCode'));
      }
      $saleTracker->register();
    }

IMPORTANT: this method should be stored before end of class, it means before last } in file /include/sc/util/order/OrdersInProgress.php

IMPORTANT: Don’t forget to replace with correct path to PapApi.class.php file.

PapApi.class.php file can be downloaded from your Post Affiliate Pro installation in menu Tools-> Integration -> Api Integration.

Copy it to your server, where is installed your shop and set the correct path on place of .

Add transaction step

Now we should use the method registerNewPostAffiliateProTransaction, which we added in previous step.

Please add following line of code into method createOrder right before last line

return $this->_lastOrderId;
$this->registerNewPostAffiliateProTransaction($order);

Change status of transaction

Status of existing transactions in Post Affiliate Pro can be controlled by changing of status in your shopping cart.

Following code will change status of PAP transaction to Approved, if you will set your shopping cart order to status Delivered.

And it will set PAP transaction to status Declined, if you will set your shopping cart order to status Cancelled, Failed Or Returned.

Edit your shopping cart file /include/sc/domainobj/Order.php and at the end of class Order add following method:

    private function updatePostAffiliateProTransaction() {
      try {
  		  include_once('<PATH_TO_PAP_API>/PapApi.class.php');
        $session = new Gpf_Api_Session("https://URL_TO_PostAffiliatePro/scripts/server.php");

        if(!$session->login("<MERCHANT_USERNAME>","<MERCHANT_PASSWORD>")) {
          return false;
        }


        $request = new Pap_Api_TransactionsGrid($session);
        $request->addFilter("orderid", Gpf_Data_Filter::LIKE, $this->getPK());
        $request->addFilter("rtype", Gpf_Data_Filter::EQUALS, 'S');
        try {
        	$request->sendNow();
        	$grid = $request->getGrid();
        	$recordset = $grid->getRecordset();
        } catch (Exception $e) {
          return false;
        }

        foreach($recordset as $rec) {
          $transaction = new Pap_Api_Transaction($session);
          $transaction->setTransid($rec->get('transid'));
          try {
        	  if(!$transaction->load()) {
        	   return false;
        	  } else {
        	     if ($transaction->getStatus() != 'D') {
                  $newStatus = '';
                  switch($this->get('OrderStatus')) {
                    case scOrderStatus::ORDER_STATUS_UNFINISHED:
              		  case scOrderStatus::ORDER_STATUS_PAYMENT_PENDING:
              		  case scOrderStatus::ORDER_STATUS_NEW:
              		  case scOrderStatus::ORDER_STATUS_IN_PROGRESS:
              		  case scOrderStatus::ORDER_STATUS_ON_HOLD:
              		  case scOrderStatus::ORDER_STATUS_QUEUED:
              		    $newStatus = 'P';
              		    break;
              		  case scOrderStatus::ORDER_STATUS_RETURNED:
              	    case scOrderStatus::ORDER_STATUS_PAYMENT_FAILED:
              		  case scOrderStatus::ORDER_STATUS_CANCELLED:
              		    $newStatus = 'D';
              		    break;
              		  case scOrderStatus::ORDER_STATUS_DELIVERED:
              		    $newStatus = 'A';
              		    break;
            		  default:
            		    return false;
                  }
                  // changing the status of a transaction
                  if (strlen($newStatus) && $transaction->getStatus() != $newStatus) {
                    $transaction->setStatus($newStatus);
                    $transaction->save();
                  }
               }
        	  }
          } catch (Exception $e) {
            return false;
          }
        }
        } catch (Exception $e) {
          return false;
        }
        return true;
    }

IMPORTANT: this method should be stored before end of class, it means before last } in file /include/sc/domainobj/Order.php

IMPORTANT: Don’t forget to replace with correct path to PapApi.class.php file.
PapApi.class.php file can be downloaded from your Post Affiliate Pro installation in menu Tools-> Integration -> Api Integration.

Copy it to your server, where is installed your shop and set the correct path on place of .

IMPORTANT: On place of use your merchant username and on place of use your password. API request will use your user credentials to access transactions in your Post Affiliate Pro installation.

Change status of transaction

Now we should use the method, which we added to class Order.

Add the following line of code (found in the box below) into file /include/sc/domainobj/Order.php to the very end of the updateOrderStatus and setOrderStatus methods.

$this->updatePostAffiliateProTransaction();

Custom Order Statuses

In case you plan to use custom order statuses in your Summer Cart, you should adapt method updatePostAffiliateProTransaction in your shopping cart file /include/sc/domainobj/Order.php.

in switch function you should add new case statements, where value will be ID of your custom status.

Back to Integrations Create account for FREE
Would you like to improve your affiliate software even more? Check out the PayWhirl integration for Post Affiliate Pro.

PayWhirl

The given text discusses various aspects of affiliate marketing, including software options, targeting the correct audience, content creation, SEO, and KPIs for sales growth. It also mentions specific affiliate programs and integrations with Post Affiliate Pro.

Would you like to improve your affiliate software even more? Check out the aMember v4 integration for Post Affiliate Pro.

aMember v4

The text provides instructions on integrating PayPal with OptimizePress/OptimizeMember through modifying the PayPal module, adding a special code for PayPal notification integration, and activating the PayPal plugin in Post Affiliate Pro. The integration steps are explained step by step with code snippets provided. Other available integrations with Post Affiliate Pro are also mentioned, including Paymate Express and Stripe. The article also discusses how to integrate aMember with PayPal using Post Affiliate Pro and suggests syncing aMember signup forms with Post Affiliate Pro for automatic affiliate signups.

Would you like to improve your affiliate software even more? Check out the Google Checkout (in Wordpress ecommerce Plugin) integration for Post Affiliate Pro.

Google Checkout (in WordPress ecommerce Plugin)

The text describes various integrations and features of Post Affiliate Pro, including Google Wallet and MoonClerk. It also mentions the CheckItOut.AI affiliate program and provides contact information for sales and support.

Would you like to improve your affiliate software even more? Check out the Cleeng for Post Affiliate Pro.

Cleeng

The article discusses the integration of the PostAffiliate Pro software with various e-commerce platforms and affiliate programs. It explains how to set up the software to track sales and commissions, as well as recurring payments. The article also provides information on other affiliate programs and tools for managing payments.

Our website uses cookies. By continuing we assume your permission to deploy cookies as detailed in our privacy and cookies policy.

×

Schedule a one-on-one call and discover how Post Affiliate Pro can benefit your business.

We’re available on multiple dates

Schedule a call