Jump to content

Prestashop 1.7 actionCustomerAccountAdd hook not firing


prestashop_newuser

Recommended Posts

Hello,

I am creating a custom module where I want the user details when they make register on the store. So to achieve that I am using actionCustomerAccountAdd hook. This hook is firing on Prestashop 1.6 but not firing in Prestashop 1.7

Here is my sample code for the custom plugin

<?php

if (!defined('_PS_VERSION_')) {
    exit;
}

class Hellouser extends Module
{
    protected $config_form = false;

    public function __construct()
    {
        $this->name = 'hellouser';
        $this->tab = 'other';
        $this->version = '1.0.0';
        $this->author = 'test';
        $this->need_instance = 0;
        $this->module_key = '';

        parent::__construct();
        $this->bootstrap = 'true';
        $this->displayName = $this->l('Hello User');
        $this->description = $this->l('Sample Plugin');
        $this->confirmUninstall = $this->l('Are you sure you want to uninstall this?');
        $this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_);

        $this->js_path = $this->_path.'views/js/';
        $this->css_path = $this->_path.'views/css/';
        $this->img_path = $this->_path.'views/img/';
        $this->logo_path = $this->_path.'logo.png';
        $this->module_path = $this->_path;
    }

    public function install()
    {
        if (!parent::install() || 
            !$this->registerHook(
                array('actionCustomerAccountAdd')))
            return false;
    }

    public function uninstall()
    {
        return parent::uninstall();
    }


    public function hookActionCustomerAccountAdd($params) {
        print_r($params);
        exit;
    }
}

So can someone please tell me whats the issue here?
 

Edited by prestashop_newuser (see edit history)
Link to comment
Share on other sites

  • 1 year later...

Hi,

I am facing the same issue with this code:

/**
     * Don't forget to create update methods if needed:
     * http://doc.prestashop.com/display/PS16/Enabling+the+Auto-Update
     */
    public function install()
    {
        return parent::install()
            && $this->createRequiredDBTables()
            && $this->registerHook('actionCustomerAccountAdd');
    }

public function hookActionCustomerAccountAdd($params)
    {
        $this->logger->info('Hook action customer account add fired');
        echo 'hook fired';
        die();
    }

Any ideas? Thank you

Link to comment
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...