:::: MENU ::::

Magento Tutorial | Magento Blog | Learn Magento 2

Cookies Consent Popup

First, You must have installed the Mailchimp extension in your project.


To Synchronize Mailchimp with Magento facilitate the subscription to the Newsletter for the customer and get the service of Mailchimp that will provide a lot of other additional services to the Magento platform.


How to configure Mailchimp in Magento 2?

1) Mailchimp -> Configuration,





2) From the Mailchimp General Configuration Section,
Choose Yes from the Enabled Field. You can see the above screenshot for reference to the enabled option.


3) Click on the Get API Credentials, and a new popup opens from Mailchimp,

When you click on the Get API Credentials button, a new popup will be displayed for asking the username and password for the MailChimp.
After Login with a Mailchimp account, the Second step you will ask to allow for Authorize Mailchimp for Magento 2, Press Allow button to go to the next step in the Popup.
Once you press Allow button, you will see the API key for Mailchimp that need to be added to the API key field of Magento.


You can see the final step of Popup from the Mailchimp API key as looks like the given screenshot.




4) After inserting the API key to the configuration, you need to click the top right button Save Config to save our changes.

This is the process to connect a Mailchimp account with Magento. you can use the subscription feature of Mailchimp in Magento by following the above steps.






 After upgrading to 2.4.3-p1 this issue occurs

Actually it was a problem with upgrade from 2.3.6 to 2.4.3 - magento added 2FA to login in 2.4 and on my Windows installation, for some reason, instead of showing error informing me that i need to configure 2FA to login, it just reloaded login form without any notice or errors.

Disabling 2FA module will solve the issue.


please run below command in terminal Magento root path :


    bin/magento module:disable Magento_TwoFactorAuth

    bin/magento cache:flush 

basically shim is used to avoid dependency conflict. 

For example if you calling a **custom javascript** then it must be loaded after javascript library isn't it? but magento doesn't know whether the library is loaded or not. So using shim we'll let system know that it is dependent on **library** so it will be instantiated when we map shim.

And

Magento uses requirejs to speed up the stuffs and (asynchronously module dependencies) nature of require js. So we use shim to tell the machine load our defined dependency first i.e., **jquery**

If we don't define then we get **jquery not defined error** while developing custom extensions as well.

The RequireJS shim configuration directive allows you to configure what I’ll call “load order” dependencies. i.e., you can say

when you load the jquery.cookie module? Make sure you’ve completely loaded the jquery module first. 


**Example :**

    var config = {

    paths:{

        "jquery.cookie":"Package_Module/path/to/jquery.cookie.min"

    },

    shim:{

        'jquery.cookie':{

            'deps':['jquery']

        }

    }};


We’ve defined a new top level configuration property named shim. This property is a javascript object of key value pairs. The key should be the name of your module (jquery.cookie above). The value is another javascript object that defines the shim configuration for this specific module.


That error indicates somewhere in your code passing null to the third parameter when calling a PHP function that is deprecated in PHP 8.1.


Assume you have below code:


return sprintf(
    $path,
    str_replace('methods_', '', $method)
);

The type of the third parameter should be changed to string if it is null. So the fixed code looks like the below:


return sprintf(
    $path,
    str_replace('methods_', '', $method ?? '')
);

The solution for your code:


$fromDate = date("Y-m-d",strtotime(str_replace("/", "-", $helper->getNewYearBallFromDate() ?? '')));
$toDate  = date("Y-m-d",strtotime(str_replace("/", "-", $helper->getNewYearBallToDate() ?? '')));