0.0.3 • Published 2 years ago
@petlabco/checkout-product-plugin v0.0.3
This plugin is used to source product data from builder.io and the checkout API.
How To publish:
npm publish --access=public
How this works:
On build:
1. query all the productData pages that exist
2. merge the checkout API data with the builder data to generate a productSelectorData
node with the following shape:
{
id: data.title,
useInProduction: data.useInProduction,
thumbnailImage: data.thumbnailImage,
url: data.url,
productSelector: {
onetime: {
products: [],
discounts: [],
bumpOffers: []
},
subscription: {
products: [],
discounts: [],
bumpOffers: []
}
}
}
Improvement opportunities:
- update the backend to get all prices by one request for all variants. It can make the plugin much faster