Disclaimer This plugin is intended to demonstrate the gift certificate features provided by the B2C Commerce Script API as standard. It is not intended to be used in a production environment as is.
This plugin enhances the app_storefront_base cartridge by providing gift certificate functionality, including the following capabilities:
- Buy a gift certificate, including setting the recipient name, recipient email, amount, recipient message
- Send the gift certificate by email to the recipient
- Check a gift certificate balance
- Use a gift certificate as a payment method
- Cannot mix products and gift certificate in the same basket:
- Adding a gift certificate to basket will remove any products already there
- Adding a product to basket will remove any gift certificate already there
- Cannot add to basket more than 1 gift certificate
Recorded demonstration: MP4
Tested with app_storefront_base version 4.2.1
Edit package.json and set the base
property of the paths
object to point to a standard app_storefront_base cartridge, eg.
"paths": {
"base": "/Users/user1/projects/project1/storefront-reference-architecture/cartridges/app_storefront_base"
}
npm install
npm run compile:js
npm run uploadCartridge
sfra_giftcert:app_storefront_base
In Business Manager:
- Go to Merchant Tools > Ordering > Payment Processors
- Create a payment processor with ID: BASIC_GIFT_CERTIFICATE
- Go to Merchant Tools > Ordering > Payment Methods
- Create and enable a payment method with ID: GIFT_CERTIFICATE
- Set the payment processor BASIC_GIFT_CERTIFICATE for the payment method GIFT_CERTIFICATE
In Business Manager:
- Go to Merchant Tools > Content > Content Assets
- Open footer-support
- Add/Edit the following line
<li><a href="$httpsUrl('GiftCertificate-Landing')$" title="Go to Gift Certificates">Gift Certificates</a></li>