Articles on: Protection

Install the AfterShip protection widget on Magento-2 store

⚠️ Install Protection requires the merchant to modify Magento-2’s code on the server side.



Install Protection widget on your Magento-2 store would require 3 simple steps.


Step 1. Get Magento-2 store appKey in your store admin site.



1) Go to STORES → All Stores




2) Click the target store entry detail page




3) Find a number after website_id, and combine the store URL is the appKey we need.

appKey format: Store URL|[the number after website_id]

Take the demo store screenshot below as an example, the appKey should be magento10.XXX.com|1




Step 2. Insert the script into Magento-2 checkout template



1) Replace ***appKey*** with the appKey we found in the last step in the code.

<script async type="text/javascript" src="https://widgets.automizely.com/protection/magento2/checkout.min.js?appKey=***appKey***"></script>


2) Merchant locates the file */vendor/magento/module-checkout/view/frontend/templates/onepage.phtml on the server.

The path of the file could be different depending on the user installation of the store.

The content in the file should be the same as https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Checkout/view/frontend/templates/onepage.phtml.

3) Merchant copy & paste the code append into the file.


Step 3. Check if the Protection widget shows up correctly on the checkout page.



Updated on: 31/10/2023

Was this article helpful?

Share your feedback

Cancel

Thank you!