Introduction
Abandoned cart recovery is essential for any eCommerce store because it helps recover lost sales. Magento 2 has features that allow you to configure abandoned cart recovery easily. This article explains how to configure Magento 2 for abandoned cart recovery in simple steps.
Step 1: Enable Email Notifications
For Magento 2 to send abandoned cart recovery emails, you must enable email notifications in the backend. Navigate to Stores > Configuration > Customers > Customer Configuration > Create New Account Options
, and then set Enable Automatic Assignment to Customer Group
to "Yes." This setting allows Magento 2 to assign customers a group automatically based on their behavior.
Step 2: Set Up a Cron Job
For Magento 2 to perform abandoned cart recovery, you must set up a cron job. A cron job is a scheduled task that runs automatically at preset intervals. It ensures that Magento 2 sends abandoned cart recovery emails timely. To create a cron job, log in to your server, and then enter the following command:
crontab -e
Once the command executes, the server opens the cron file. Next, add the following line to the file:
* * * * * /usr/bin/php /var/www/html/magento2/bin/magento cron:run | grep -v "Ran jobs by schedule" >> /var/www/html/magento2/var/log/magento.cron.log
The above command runs the Cron every minute. To run the cron every 5 minutes, change the * * * * *
to */5 * * * *
.
Step 3: Configure Abandoned Cart Emails
Magento 2 allows you to configure abandoned cart recovery emails. To access the abandoned cart email configuration settings:
- Navigate to
Marketing
and then selectCommunications
, followed byEmail Templates
. - Next, select "Add New Template" and then choose "Abandoned Cart".
- Configure the email template and Save the changes.
Also, you must assign the email template to the abandoned cart workflow. To assign the email template, navigate to Marketing > Communications > Email Templates > Abandoned Cart
, and then select the "Queue" option to apply the template.
Step 4: Set up a Cart Expiration Time
The cart expiration time is the time set for a cart to expire. An expired cart triggers abandoned cart recovery emails. To set up the cart expiration time in Magento 2, navigate to Stores > Configuration > Sales > Checkout
, and then adjust the Quote Lifetime
field. A cart automatically expires after the set days from a customer’s last activity.
Step 5: Enable the Abandoned Cart Workflow
The last step is to enable the abandoned cart workflow. To enable the abandoned cart workflow, navigate to Marketing > Communications > Email Workflow > Add New Email Workflow
, then choose "Abandoned Cart". Scroll down to the "Workflow Options" section and enable the "Abandoned Cart" workflow.
Conclusion
Magento 2 has features that allow you to configure abandoned cart recovery emails in a few steps. Creating a cron job, setting up the cart expiration time, and enabling the abandoned cart workflow help you recover lost sales by sending timely reminders to potential customers. By following the above steps, you can configure Magento 2 with ease and start recovering lost sales.