Fetch from Product Feed
findProduct Function
The #findProduct
fetches a product from your Product Feed, by using an SKU. By itself, it's a limited function, but when used in conjunction with #includeProducts
or #findMatching
, it can be a powerful tool for customizing your messages.
Examples
Find a Product by its SKU
The first example shows how to use the #findProduct function to fetch the image link of a users' favourite Product, which has been attached to the User via the User Feed.
Get the remaining Stock Count for products in the Cart
The second example shows how to use the #findProduct function together with #includeProducts to show the remaining stock for the three most expensive items in the cart.
#findProduct extension to search a list (also within another product)
On June 7, we've included an update to our #findProduct function that can enable you to go even further than before by pulling a specific element from a list (or even a list attached to another product). Here's what the list could look like in the product feed:
This works great with simple cross-selling cases, especially when you'd like your customer to buy accessories for an item or even other related items. Here's an example of how to search within another product:
The above example will search the "mainProductSKU" (111111 in our example) and returns the details of the first accessory (itemFromList=0 in our example, which is 998776).
Last updated