Jump to content

Synching Prestashop and MailChimp


MightyMouseofGod

Recommended Posts

I think my newsletter signup at the bottom of my homepage stopped working when we upgraded Prestashop to 1.7.8.10 and Mailchimp to v3.0.7 (it had been on 2.something previously). When you type in an email address and hit SUBSCRIBE it just reloads the home page and the email address doesn't appear in Prestashop or Mailchimp.

Looking into configuring the module it complained that I had 2 stores using the same Mailchimp list and I fixed that in the way it suggested. It's still asking me to press the Sync button. I'm more than a little concerned that although it shows the right number of products to sync in the list in Store Sync, there are far fewer customers and subscribers than there are in Prestashop or Mailchimp.

I have exported a contact list from Mailchimp as a backup but I'd still like to understand a bit more about what is going on.

I can give a temporary password to anyone willing to help.

Thanks

Debbie

Link to comment
Share on other sites

  • 2 weeks later...

Hi,

  • Firstly, Make sure that your Mailchimp API key is correctly configured in your Prestashop module settings.
  • Verify that the Mailchimp list ID is correctly set up in your PrestaShop module.
  • If the module is asking you to press the "Sync" button, it's possible that there's a synchronization issue between PrestaShop and Mailchimp. Try clicking the "Sync" button to initiate a manual synchronization.
  • In Mailchimp, check that the list you are syncing with Prestashop is set up correctly. Ensure that the list is active and able to receive new subscribers.
  • Clear the cache in Prestashop.

Thanks!

 

Link to comment
Share on other sites

Hi 

Recently Mailchimp Version was upgraded to a newer version from V2 to V3. Now the way of fetching the list and updating the list has completely changed. 

For Adding new users to the list try the below code

 

            $api_key = // Your API KEY;

            $list_id = // Your List ID;

            $Mailchimp = new Mailchimp($api_key);

            $result = $Mailchimp->post("lists/$list_id/members", array(

                'email_address' => trim($email),

                'status' => 'subscribed',

            )

            );

            $subscriber_hash = $Mailchimp->subscriberHash(trim($email));

            $Mailchimp->patch("lists/$list_id/members/$subscriber_hash", array('merge_fields' => array('FNAME' => $first_name, 'LNAME' => $last_name)));

 

For fetching the list you can refer to the below code

public function mailchimpGetLists($api_key = null)

    {

        if (trim($api_key) != '' && $api_key !== null) {

            try {

                $Mailchimp = new Mailchimp($api_key);

                $lists = $Mailchimp->get('lists');

                if ($lists !== false) {

                    $options = array();

                    foreach ($lists["lists"] as $list) {

                        $options["success"][] = array(

                            'value' => $list["id"],

                            'label' => $list["name"]

                        );

                    }

                } else {

                    $options["error"][] = array(

                        'value' => "0",

                        'label' => $this->l("No list found. (Verify Credentials)")

                    );

                }

            } catch (\Exception $e) {

                $options["error"][] = array(

                    'value' => "0",

                    'label' => $e->getMessage()

                );

            }

        } else {

            $options["error"][] = array(

                'value' => "0",

                'label' => $this->l("No list found. (Verify Credentials)")

            );

        }

 

        return $options;

    }

For using the code when the below library is imported to the desired location you can simply include the library like below

include_once(dirname(__FILE__) . '/libraries/drewm/mailchimp-api/src/MailChimp.php');

 I've attached the library here with the email which you can use in your code.

mailchimp-api.zip

Link to comment
Share on other sites

  • 8 months later...
On 10/9/2023 at 11:10 AM, AddWeb Solution said:

Hi,

  • Firstly, Make sure that your Mailchimp API key is correctly configured in your Prestashop module settings.
  • Verify that the Mailchimp list ID is correctly set up in your PrestaShop module.
  • If the module is asking you to press the "Sync" button, it's possible that there's a synchronization issue between PrestaShop and Mailchimp. Try clicking the "Sync" button to initiate a manual synchronization.
  • In Mailchimp, check that the list you are syncing with Prestashop is set up correctly. Ensure that the list is active and able to receive new subscribers.
  • Clear the cache in Prestashop.

Thanks!

 

Hi, sorry for the late reply - I've been unwell for a while but getting back into things now. I didn't have an API in Mailchimp when I looked, but have now generated one. I can't see where in the Prestashop Mailchimp module I put the API. 

Prestashop version is currently 1.7.8.11

Mailchimp Module v3.0.16 

Cache cleared

It's not apparently asking me to sync.

The Mailchimp side of things seems to be working OK

Link to comment
Share on other sites

  • 1 year later...

i have also sync problem

previously with PS1.6 was worked instantly very well

we updated to the PS1.7 and i have problems with sync prestashop 1.7 with mailchimp

somhow is stop and not sync my customers at all

when i make run cronjob manually i got this:

================================================================
2025-08-14 16:57:15  There were 286 job(s) successfully synced to the MailChimp!
  Breakdown: 242 product sync job(s), 44 other job(s)
  Product batch processing: 5 batch(es) in 00:0:6
Errors:  
 − Job type: customer | Id: 22688 | Message: 404: The requested resource could not be found. (2. attempt(s))

or only customer sync

================================================================
2025-08-14 17:51:03  There were 44 job(s) successfully synced to the MailChimp!
Errors:  
 − Job type: customer | Id: 6 | Message: 400: xxxx was permanently deleted and cannot be re-imported. The contact must re-subscribe to get back on the list. (1. attempt(s)) 
 − Job type: customer | Id: 10 | Message: 400: xxxxx   is already a list member. Use PUT to insert or update list members. (1. attempt(s)) 
 − Job type: customer | Id: 30 | Message: 400: xxxxx was permanently deleted and cannot be re-imported. The contact must re-subscribe to get back on the list. (1. attempt(s)) 
 − Job type: customer | Id: 31 | Message: 400: xxxx was permanently deleted and cannot be re-imported. The contact must re-subscribe to get back on the list. (1. attempt(s)) 
 − Job type: customer | Id: 32 | Message: 400: xxxxx is already a list member. Use PUT to insert or update list members. (1. attempt(s)) 
 − Job type: customer | Id: 50 | Message: 400: xxxxxx was permanently deleted and cannot be re-imported. The contact must re-subscribe to get back on the list. (1. attempt(s))

it seems he made sync but not appear new customers 

 

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