Upgrade the Buy with Prime Cartridge
Buy with Prime API is now available for early access
Sign up for early access to the Buy with Prime API using the 'Sign Up' button below. The API may change as Amazon receives feedback and iterates on it.
We recommend upgrading the Buy with Prime cartridge for major releases or when you need access to new features.
Compatibility
The Buy with Prime cartridge requires:
- Storefront Reference Architecture (SFRA) 6.0 or later.
- Compatibility Mode 22.7 or later.
- For Amazon Pay integration, Amazon Pay cartridge version 24.1 or later.
Prerequisites
To upgrade the Buy with Prime cartridge, your organization must have the following prerequisites:
- Access to Buy with Prime for Salesforce Commerce Cloud GitHub repository.
- An integrated development environment (IDE) of your choice.
- Node.js version 14.19 or later.
- Deployment tools configured to upload cartridges to Salesforce Commerce Cloud such as Prophet or other upload utilities.
Pre-upgrade best practices
Before proceeding with the upgrade, do the following:
- Review release notes: Review the release notes for the Buy with Prime Cartridge to understand the changes.
- Create backups: Create a full backup of your site's data, configurations, and codebase.
- Test in sandbox: Perform the entire upgrade process in a non-production environment that mirrors your production setup.
- Separate custom code: Ensure all your custom code related to Buy with Prime, such as custom controllers or templates, resides in a separate custom cartridge.
- Plan testing: Conduct comprehensive testing after the upgrade to ensure all functionalities, including your customizations, work correctly.
- Prepare rollback plan: Have a well-defined rollback plan in case you encounter issues during or after the upgrade.
Upgrade the Buy with Prime cartridge
Step 1: Download latest version
Download the latest Buy with Prime cartridge version from the Buy with Prime for Salesforce Commerce Cloud GitHub repository.
Step 2: Update metadata
If you need to update metadata, do the following:
- Import the new metadata into your Salesforce Commerce Cloud instance using Business Manager.
- Update your site metadata in the Buy with Prime cartridge. For details, see Update your site metadata in the Buy with Prime cartridge.
- Import your site metadata to Salesforce Commerce Cloud. For details, see Import your site metadata to Salesforce Commerce Cloud.
Step 3: Compare changes
- Save a copy of your current
int_buywithprime_sfra
andint_buywithprime
cartridges for reference. - Compare the changes between the new and old versions of the
int_buywithprime_sfra
cartridge, focusing on updates to controllers, models, scripts, and templates. For details on comparing commits and branches, see Comparing commits. - Identify any new controller routes such as replace, append, or prepend, or file overrides that were not present in your previous integration.
- To ensure your integration remains up-to-date, manually merge any changes from the new cartridge version into your customized files.
Step 4: Update Subresource Integrity (SRI)
If upgrading from before version 0.13.0 of the cartridge, update SRI. For details, see Update Subresource Integrity Hash Values for Scripts in the Buy with Prime Cartridge.
Step 5: Build the cartridge
- At a command prompt, open your
buy-with-prime-for-salesforce-commerce-cloud
directory. - Change directory to the
cartridges
directory. - Run
npm install
. - Run
npm run build
.
Step 6: Upload cartridges
Upload the cartridges using Prophet or run npm run uploadCartridge
.
Post-upgrade testing
Use the following recommended progression for testing and deploying the upgraded Buy with Prime cartridge:
- Sandbox testing: Test Buy with Prime functionality through manual and regression testing in the sandbox environment.
- QA environment: Deploy and test the upgraded cartridge in the QA environment.
- Staging/UAT: After QA approval, deploy the cartridge to staging for user acceptance testing (UAT).
- Production: After successful UAT completion, deploy the cartridge to production.
Post-upgrade rollback
If issues occur during or after the upgrade, do the following:
- Restore the previous versions of the
int_buywithprime_sfra
andint_buywithprime
cartridges. - If you applied any metadata updates during the upgrade process, revert any configurations such as custom site preference values or service credentials back to the previous state.
- Build the Buy with Prime cartridge.
- To upload the restored
int_buywithprime_sfra
andint_buywithprime
cartridges to your SFCC instance, use Prophet or runnpm run uploadCartridge
.
Related topics
Updated about 23 hours ago