Light Mode
Get Product Details
This endpoint is used to return information about a particular product to the user.
:::tip
The get details endpoint has been implemented in the Product Options Web Component, and It's all setup to save developer's time and effort.
:::
Payload
Response
Usage
To perform the action of retrieving product details, the developer may call the method getDetails() as follows:
salla.product.getDetails(23345, ["images", "sold_quantity", "category"])
.then((response) => {
/* add your code here */
});
Events
This endpoint may trigger two events, the onDetailFetched and onDetailFetchFailed events.
onDetailFetched
This event is triggered when the action of retrieving product details is done without having any errors coming back from the backend.
salla.product.event.onDetailFetched((response) => {
console.log(response)
});
onDetailFetchFailed
This event is triggered when the action of retrieving product details is not completed and an error has occurred.
salla.product.event.onDetailFetchFailed((errorMessage) => {
console.log(errorMessage)
});
Last modified: 3 months ago