In this article, you will learn how to upgrade the Magento 2 US Privacy Laws from v2.x to v3.x using two methods – via Composer or FTP.
Important Information:
We strongly recommend upgrading and testing the US Privacy Laws extension in a development environment before deploying it on the production store.
Step 1. Update the Extension
You can choose one of the two following methods to update the extension on your Magento 2 store:
Updating Extension via Composer
First, remove the following folder if it exists:
app/code/Plumrocket/CCPA
Then, update the extension files by running the following command from the Magento root directory:
- Use this command if the US Privacy Laws v3 extension was installed in the
vendor/plumrocket/plumrocket/module-ccpa
folder.
composer remove plumrocket/ccpa-metapackage
composer require plumrocket/ccpa-metapackage
- Or use this command if the US Privacy Laws v3 Extension was installed in the
app/code/Plumrocket/CCPA
folder.
composer require plumrocket/ccpa-metapackage
After running these commands, you may be prompted to enter the username and password (see the How to Get Plumrocket Composer Repository Keys user guide).
To complete the updating process, run the next four Magento 2 commands:
php bin/magento cache:flush
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
Updating Extension via FTP
In order to update the extension files via FTP, remove the app/code/Plumrocket/CCPA
folder and perform the Installation via FTP steps.
Step 2. Change the “Do Not Sell Page”
If you have customized the Do Not Sell My Personal Information page, you need to update it to comply with the new CPRA requirements. In the US Privacy Laws extension v.3.x.x we have provided the new default Do Not Sell or Share My Personal Information page that you can use as an example.
Please follow the steps below to change the “Do Not Sell” page on your store:
Step-by-step guide:
- In the Magento admin panel, go to Plumrocket -> US Privacy Laws -> Configuration -> Do Not Sell or Share My Personal Information Page tab.
- In the “Do Not Sell” CMS Page field, choose the new page from the list of CMS pages. You can either select our default Do Not Sell or Share My Personal Information page, or a custom one created based on it.
- Click Save Config.
Step 3. Change the “Do Not Sell” Confirmation Email Template
Please skip this step if you have been using the “Guest Opt-Out Confirmation (Default)” email template, as it was automatically updated.
However, if you used a custom template, you should update its content to reflect the new CPRA requirements. Please go to Marketing -> Email Templates in the Magneto admin panel, and click the edit icon on your Guest Opt-Out Confirmation template. Then make sure you have set the correct email template in the extension configurations by following the next steps:
Step-by-step guide:
- In the Magento admin panel, go to Plumrocket -> US Privacy Laws -> Configuration -> Do Not Sell or Share My Personal Information Page tab.
- In the “Guest Confirmation Email Template” field, select your custom email template with updated content according to the CPRA requirements.
- Click Save Config.