Jump to content

Send purchase value and currency after external payment


harry59
 Share

Recommended Posts

Hi


I have a PrestaShop Facebook module installed on my site in order to track diffrent events. However, I have a problem with the purchase event. I use an external payment gateway (Przelewy24) which, after successful  payment redirects to a page that displays a message about the correct payment but without order summary.

As a result, I get information about the purchase in the facebook event manager but without the value and currency. I suppose you have to modify payment_successful.tpl and paymentSuccessful.php. Thank you in advanced for any kind of help.

Here is a link to payment module which I use and code of paymentSuccessful.php

<?php
/**
 * Class przelewy24paymentSuccessfulModuleFrontController
 *
 * @author Przelewy24
 * @copyright Przelewy24
 * @license https://www.gnu.org/licenses/lgpl-3.0.en.html
 *
 */

/**
 * Class Przelewy24paymentSuccessfulModuleFrontController
 */
class Przelewy24paymentSuccessfulModuleFrontController extends ModuleFrontController
{

    /**
     * Initializes front controller: sets smarty variables,
     * class properties, redirects depending on context, etc.
     *
     * @throws PrestaShopException
     */
    public function init()
    {
        unset($this->context->cookie->id_cart);

        return parent::init();
    }

    /**
     * Init content.
     */
    public function initContent()
    {
        parent::initContent();

        $this->context->smarty->assign(
            array(
                'logo_url' => $this->module->getPathUri() . 'views/img/logo.png',
                'home_url' => _PS_BASE_URL_,
                'urls' => $this->getTemplateVarUrls(),
                'id_order' => $this->id_order,
            )
        );

        $this->setTemplate('module:przelewy24/views/templates/front/payment_successful.tpl');
    }
}

 

Share this post


Link to post
Share on other sites

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More