Light Mode
Categories
This endpoint lists all of the products within a given category. Categories aid in the organisation of products so that visitors may quickly find what they're looking for in the store.
Payload
Response
Usage
To perform the action of retriving the categories for a product, the developer may call the method categories()
as follows.
salla.product.categories({ id: 17 }).then((response) => {
/* add your code here */
});
// TIP: short version
salla.product.categories(17).then((response) => {
/* add your code here */
});
More about adding Categories as a component here
https://youtu.be/WgItYTCSISI?si=GGjP7A5durx_A1To
Events
This endpoint may trigger two events, the onCategoriesFetched and onCategoriesFailed events.
onCategoriesFetched
This event is triggered when retriving the categories for a product is done without having any errors coming back from the backend.
salla.event.search.onCategoriesFetched((response) => {
console.log(response)
});
onCategoriesFailed
This event is triggered when retriving the categories for a product is not completed and an error has occurred.
salla.event.search.onCategoriesFailed((errorMessage) => {
console.log(errorMessage)
});
Last modified: 9 months ago