Jump to content

Integrating Prestashop and GetResponse


Recommended Posts

Good afternoon everyone,

I am trying to integrate GetResponse with Prestashop to be able to use all the automation functionality of the first one.
There is a module of GetResponse for Prestashop that when installed it includes many functionalities but to use the function "Ecommerce - URL Visited" you have to insert the following code in the head.
 

<? php echo "<script type = 'text / javascript'> gaSetUserId ('". $ email. "'); </ script>"; ?>

From what I could read, this code can only be inserted by creating a module. So I have done it, I install it without problems, but when I go to my page, I get the following message: "No template was found for module getresponse2"
 

<? php
if (! defined ('_ PS_VERSION_'))
{
  exit;
}

class getresponse2 extends Module
{
  public function __construct ()
  {
    $ this-> name = 'getresponse2';
    $ this-> tab = 'others';
    $ this-> version = '1.0.0';
    $ this-> author = 'Álvaro Portela';
    $ this-> need_instance = 0;
    $ this-> ps_versions_compliancy = array ('min' => '1.6', 'max' => _PS_VERSION_);
    $ this-> bootstrap = true;

    parent :: __ construct ();

    $ this-> displayName = $ this-> l ('GetResponse2');
    $ this-> description = $ this-> l ('insert code for GetResponse Ecommerce');

    $ this-> confirmUninstall = $ this-> l ('Do you want to uninstall the module?');

    if (! Configuration :: get ('MYMODULE_NAME'))
      $ this-> warning = $ this-> l ('No name provided');
  }
    public function install ()
     {
      if (parent :: install () == false OR! $ this-> registerHook ('header'))
     return false;
      return true;
     }
    
    public function hookHeader ($ email)
     {
      global $ smarty;
      // Variables or PHP code that we want to insert
        echo "<script type = 'text / javascript'> gaSetUserId ('". $ email. "'); </ script>";
       // echo "gaSetUserId ('". $ userEmail. "');";
        $ smarty-> assign ('email', $ email);
      return $ this-> display (__ FILE__, 'head.tpl');
     }
}


How can I tell the path to my head.tpl file?

I'm also not sure I'm taking the $ email variable correctly.

Here the code:



Thank you very much for your help

Share this post


Link to post
Share on other sites

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
×
×
  • Create New...

Important Information

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