Jump to content

Newsletter mailchimp module


Fabrizio r

Recommended Posts

Hi, I connected my prestashop store to mailchimp with the official module, and the sync with the customers works properly.
However, users who sign up with the native form provided by prestashop are not imported, so they are on the list of my backoffice subscribers but not among the customers.
I do not know if the module provided by mailchimp is able to synchronize only the customers and not all the members, in the description is not clear, or I missed something.
Can someone help me?

Thanks

Link to comment
Share on other sites

  • 4 weeks later...
  • 7 months later...

The module have many problems with prestashop 1.7.5
From the Mailchimp Config / Mailchimp Sync the only think that work is the sync products in regular mode.
All the other sync did work in any mode. So you can't import your old data from the module.

"Live" it seems to work properly. So from the time you install the module new customers, new orders are syncing.


Also we have this error

[Thu Sep 05 12:43:44.364250 2019] [proxy_fcgi:error] [pid 9908] [client 79.129.43.209:56810] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught TypeError: Argument 3 passed to PrestaChamps\MailchimpPro\Hooks\Action\Customer\AccountUpdate::run() must be an instance of Customer, null given, called in /var/www/vhosts/example.com/httpdocs/modules/mailchimppro/mailchimppro.php on line 789 and defined in /var/www/vhosts/example.com/httpdocs/modules/mailchimppro/src/PrestaChamps/MailchimpPro/Hooks/Action/Customer/AccountUpdate.php:57nStack trace:n#0 /var/www/vhosts/example.com/httpdocs/modules/mailchimppro/mailchimppro.php(789): PrestaChamps\MailchimpPro\Hooks\Action\Customer\AccountUpdate::run(Object(Context), Object(DrewM\MailChimp\MailChimp), NULL)n#1 /var/www/vhosts/example.com/httpdocs/classes/Hook.php(966): Mailchimppro->hookActionCustomerAccountUpdate(Array)n#2 /var/www/vhosts/example.com/httpdocs/classes/Hook.php(351): HookCore::coreCallHook(Object(Mailchimppro), 'hookactionCusto...', Array)n#3 /var/www/vhosts/example.com/httpdocs/classes/Hook.php(903): HookCore::callHookOn(Object(Mailchimppro), 'act...n', referer: https://www.example.com/el/order

This happens when a customer at checkout in the address step and he go back to add something else to the cart. The second time he try to checkout we get this error and the customer gets a white page.

I search the problem and in public function hookActionCustomerAccountUpdate($params) at $params['newCustomer'] does not exist in table, only $params['customer'].

I have dump variable $params and i fix the problem

So in file modules/mailchimppro/mailchimppro.php you must replace function hookActionCustomerAccountUpdate (line 783) with the following.

public function hookActionCustomerAccountUpdate($params)
{
	if(isset($params['newCustomer']))
	{
		try {
			PrestaChampsMailchimpProHooksActionCustomerAccountUpdate::run(
			$this->context,
			$this->getApiClient(),
			$params['newCustomer']
			);
		} catch (Exception $exception) {
			PrestaShopLogger::addLog("[MAILCHIMP] :{$exception->getMessage()}");
		}
	}elseif (isset($params['customer']))
	{
		try {
			PrestaChampsMailchimpProHooksActionCustomerAccountUpdate::run(
			$this->context,
			$this->getApiClient(),
			$params['customer']
			);
		} catch (Exception $exception) {
			PrestaShopLogger::addLog("[MAILCHIMP] :{$exception->getMessage()}");
		}
	}
}

I didn't remove the $params['newCustomer'] because i don't now if it's in use in some other case. (where have no sense to use variable "newCustomer" in the CustomerAccountUpdate )


All the above are also tested in fresh install of prestashop 1.7.5.2

Edited by sanctusmob
beatify code (see edit history)
  • Thanks 1
Link to comment
Share on other sites

  • 1 month later...
  • 2 months later...

Anyone who has fixed this issue?

On 9/11/2019 at 9:12 AM, sanctusmob said:

[Thu Sep 05 12:43:44.364250 2019] [proxy_fcgi:error] [pid 9908] [client 79.129.43.209:56810] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught TypeError: Argument 3 passed to PrestaChamps\MailchimpPro\Hooks\Action\Customer\AccountUpdate::run() must be an instance of Customer, null given, called in /var/www/vhosts/example.com/httpdocs/modules/mailchimppro/mailchimppro.php on line 789 and defined in /var/www/vhosts/example.com/httpdocs/modules/mailchimppro/src/PrestaChamps/MailchimpPro/Hooks/Action/Customer/AccountUpdate.php:57nStack trace:n#0 /var/www/vhosts/example.com/httpdocs/modules/mailchimppro/mailchimppro.php(789): PrestaChamps\MailchimpPro\Hooks\Action\Customer\AccountUpdate::run(Object(Context), Object(DrewM\MailChimp\MailChimp), NULL)n#1 /var/www/vhosts/example.com/httpdocs/classes/Hook.php(966): Mailchimppro->hookActionCustomerAccountUpdate(Array)n#2 /var/www/vhosts/example.com/httpdocs/classes/Hook.php(351): HookCore::coreCallHook(Object(Mailchimppro), 'hookactionCusto...', Array)n#3 /var/www/vhosts/example.com/httpdocs/classes/Hook.php(903): HookCore::callHookOn(Object(Mailchimppro), 'act...n', referer: https://www.example.com/el/order

Whenever i try to implement the fix, i can not activate the module from backoffice.

We have been in dialog with mailchimp support, but they are not capable of helping us out.

Our error look something like this:

[30-Oct-2019 18:27:52 Europe/Copenhagen] PHP Fatal error:  Uncaught TypeError: Argument 3 passed to PrestaChamps\MailchimpPro\Hooks\Action\Customer\AccountUpdate::run() must be an instance of Customer, null given, called in /var/www/vhosts/eksempel.dk/modules/mailchimppro/mailchimppro.php on line 789 and defined in /var/www/vhosts/eksempel.dk/modules/mailchimppro/src/PrestaChamps/MailchimpPro/Hooks/Action/Customer/AccountUpdate.php:57
Stack trace:
#0 /var/www/vhosts/eksempel.dk/modules/mailchimppro/mailchimppro.php(789): PrestaChamps\MailchimpPro\Hooks\Action\Customer\AccountUpdate::run(Object(Context), Object(DrewM\MailChimp\MailChimp), NULL)#1 /var/www/vhosts/eksempel.dk/classes/Hook.php(970): Mailchimppro->hookActionCustomerAccountUpdate(Array)#2 /var/www/vhosts/eksempel.dk/classes/Hook.php(355): HookCore::coreCallHook(Object(Mailchimppro), 'hookactionCusto...', Array)#3 /var/www/vhosts/eksempel.dk/classes/Hook.php(907): HookCore::callHookOn(Object(Mailchimppro), 'actionCustomerA...', in /var/www/vhosts/eksempel.dk/modules/mailchimppro/src/PrestaChamps/MailchimpPro/Hooks/Action/Customer/AccountUpdate.php on line 57

 

Happens when information in checkout is filled out, and people go to payment. Then go back to change whatever. now payment is unavailable.

prestashop 1.7.6.1

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

  • 2 weeks later...
  • 8 months later...

Hi - tried this code fix in module for Prestashop 1.6.1.23 as customers were having a similar issue when checking out - no payment module available! However I get a blank page in Prestashop admin when code added - front end of shop works fine. How can I get this to wok for v1.6?

Thanks

Baz

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...