Home Integration Methods Presta Shop

Presta Shop

Integration with Presta Shop needs modification of some processing files.
1
Localization of file and add tracking code (older versions of Presta Shop)
Connect to your FTP and find the file order-confirmation.php . This file process orders. Download it, open it in any text editor and find this line:

'HOOK_PAYMENT_RETURN' => Hook::paymentReturn(intval($id_order), intval($id_module))));


Add this tracking code after the line mentioned above. The code is for tracking total cost and order ID:
Now save the file and upload it back to FTP.
2
Localization of file and add tracking code (applies to version 1.4.4.x or above of Presta Shop)
Find the file OrderConfirmationController.php (in directory \controllers\), open it in any text editor and find lines: (last lines of function preProcess())

if ($order->payment != $module->displayName)
    Tools::redirect($redirectLink);

and right after add this tracking code. The code is for tracking total cost and order ID:
Now save the file and upload it back to FTP.
3
PayPal part 1
If you're using PayPal plugin (you can download if from http://www.prestashop.com/en/downloads/) then you have to follow these additional steps. First of all, you have to find the file paypal.tpl (or redirect.tpl for newer versions) inside shop/modules/paypal/. Edit it and find this line of code:

<input type="hidden" name="custom" value="{$id_cart}" />

Overwrite that line of code with following code:

4
PayPal part 2
Next thing to do is to find file validation.php, also inside shop/modules/paypal/. Edit this file and find this line of code:

$ch = curl_init('https://' . $paypalServer . '/cgi-bin/webscr');

Put following code right after that line of code:
Also, you have to activate PayPal IPN plugin inside of your Merchant panel > Plugins. Edit the plugin settings and change separator to ||
5
PayPal part 3
Last thing to do is to find this line of code inside validation.php:

if ($result == 'VERIFIED') {

Put following code right after that line of code:
That's all necessary in order to integrate Presta Shop + PayPal.
You can also try the integration module developed by Presta Shop:
http://addons.prestashop.com/en/advertising-marketing/890-post-affiliate-pro-.html

Code Placement

2 years ago Terry
Thank you for working this out! Have been waiting on this:)

I am assuming that the code you have provided is placed "below" the "HOOK_PAYMENT_RETURN" function?

Also the script id must be unique to my install, right?

Thanks again for adding the PrestaShop!

God bless,

Terry

Prestashop add on

2 years ago http://ardianys.com/
any response to previous comment ?

Not a word from support...

2 years ago Terry
Never heard anything from the folks here. Guess they are not monitoring this.

Did not get it to work with Presta shop so just gave up.

New module development

2 years ago PShopExpert
Hi,

I'm making a new free module to integrate clicks tracking as well as sales tracking for any payment gateway with easy installation.
I think it will be ready in 1 or 2 weeks, I will place a comment here to inform you (If I remember this comment...).

Best regards,
Vincent Millet
http://www.pshopexpert.com

Update

2 years ago Martin Pullmann
Vincent have provided us the code and it is updated so you can use this tracking method.

Prestashop Integration

2 years ago Unisson
Is the only integration we have to do with Prestashop ?
I use Paypal paiement and cheque on my store Prestashop and I have a wrong result in the commission.
The sold is to 17€ and the comission is to 1,7€ instead of 3,4€ ?
Where is my error ?

Contact support in case of problem

2 years ago Martin Pullmann
Please, contact our support center. The integration probably works fine, the problem is somewhere in your settings I guess.

Custom commissions by product

1 years ago Diego
I'm thinking in using this service with Presta Shop, but I wanted to know if it's possible to define a custom commission(percent) by product without having to add the the product id on the Affiliate Campaign edit page. I.e. In the product page, on the Presta Shop backend, is it possible to integrate Post Affiliate Pro so that it's possible to select there the Affiliate Campaign that I want to use on the product?

wrong

7 months ago parsa
hi
this training dont work with presta 1.4.3
please help me.
tnx.

Contact our livehelp

7 months ago Martin Pullmann
Please, in case of any issue or question, contact our online help. We will need your admin access in case of improvement of the integration.
Thanks.

Trzed

5 months ago Rastrislav
I trzed to integrate it to www.sperkovnica.eu but its not working, its old ?

Outdated Instructions

5 months ago Jay
In the lastest prestashop order-confirmation.php does have the code mentioned. Instead it ONLY says this....

require(dirname(__FILE__).'/config/config.inc.php');
ControllerFactory::getController('OrderConfirmationController')->run();

Outdated Instructions

5 months ago Jay
I meant to say it does NOT have the code mentioned. Can someone investigate this and update the instructions?

Presta Shop integration updated

4 months ago Matej Kendera
Use new Step 2 for versions 1.4.4.x