Size Guides
This endpoint is used to fetch the size guide for a specific product in an online store. The endpoint takes a product_id
parameter, which is the ID of the product for which the size guide is being fetched.
:::tip
The Size Guides endpoint has been implemented in the Product Size Guide Web Component, and It's all setup to save developer's time and effort.
:::
Payload
Response
Usage
To perform the action of retrieving the size guide for any product, the developer may call the method getSizeGuides()
and pass in the product ID as an argument as follows:
// Call the getSizeGuides method with a product ID
salla.product.getSizeGuides(12345)
.then(response => {
// Do something with the size guide data
console.log(response);
})
.catch(error => {
// Handle any errors that occur
console.error(error);
});
Events
This endpoint may trigger two events, the onSizeGuideFetched
and onSizeGuideFetchFailed
events.
onSizeGuideFetched
This event is triggered when the action of retrieving the size guide for any product is done without having any errors coming back from the backend.
salla.product.event.onSizeGuideFetched((response) => {
console.log(response)
});
onSizeGuideFetchFailed
This event is triggered when the action of retrieving retrieving the size guide for any product is not completed and an error has occurred.
salla.product.event.onSizeGuideFetchFailed((errorMessage) => {
console.log(errorMessage)
});