Affiliate Software Documentation

Commission Integration with Prestashop 1.5

To integrate the affiliate software with Prestashop, follow these steps:

  1. Open up the /controllers/front/OrderConfirmationController.phpfile. Locate the code block as shown below and add the integration code as show below. Look for the //START AFFILIATE CODE and //END AFFILIATE CODE block to edit.
  2. Make sure to use your affiliate URL for the integration block.
    public function displayOrderConfirmation()
    	{
    		if (Validate::isUnsignedId($this->id_order))
    		{
    			$params = array();
    			$order = new Order($this->id_order);
    			$currency = new Currency($order->id_currency);
    
    			if (Validate::isLoadedObject($order))
    			{
    				$params['total_to_pay'] = $order->getOrdersTotalPaid();
    				$params['currency'] = $currency->sign;
    				$params['objOrder'] = $order;
    				$params['currencyObj'] = $currency;
    				
    				//START AFFILIATE CODE
    				$JAMIntegrate = file_get_contents("http://www.domain.com/affiliates/sale/amount/".$params['total_to_pay']."/trans_id/".$this->id_order."/tracking_code/".$_COOKIE['jamcom']);				
    				//END AFFILIATE CODE
    				
    				return Hook::exec('displayOrderConfirmation', $params);
    			}
    		}
    		return false;
    	}
  3. Save and upload to your /controllers folder.

 

Integrating with Prestashop 1.5 for Paypal

To integrate with Paypal on Prestashop 1.5, follow these steps:

  1. Open up modules/paypal/controllers/front/submit.php.Locate the code block as shown below under private function displayHook() and add the integration code as show below. Look for the //START AFFILIATE CODE and //END AFFILIATE CODE block to edit.
  2. Make sure to use your affiliate URL for the integration block.
    if (Validate::isLoadedObject($order))
    			{
    				$params['objOrder'] = $order;
    				$params['currencyObj'] = $currency;
    				$params['currency'] = $currency->sign;
    				$params['total_to_pay'] = $order->getOrdersTotalPaid();
    				
    					
    				//START AFFILIATE CODE
    $JAMIntegrate = file_get_contents("http://www.domain.com/affiliates/sale/amount/".$params['total_to_pay']."/trans_id/".$this->id_order."/tracking_code/".$_COOKIE['jamcom']);				
    				//END AFFILIATE CODE
    						
    				return $params;
    			}
  3.