Menu
productRecommendations
Returns recommended products for a given product, identified by either ID or handle. Use the intent argument to control the recommendation strategy.
Use it in a workflow
- Add a step and choose the Shopify Storefront connector.
- Pick the productRecommendations action (under Product).
- Fill in the fields below, then reference the result from later steps as
{{productrecommendations.response.data}}.
Query
This is the query the action sends by default. Edit it in the step's Query field to change which fields come back.
query ProductRecommendations($productId: ID, $productHandle: String, $intent: ProductRecommendationIntent) {
productRecommendations(
productId: $productId
productHandle: $productHandle
intent: $intent
) {
availableForSale
category {
ancestors
id
name
}
compareAtPriceRange {
maxVariantPrice {
amount
currencyCode
}
minVariantPrice {
amount
currencyCode
}
}
createdAt
descriptionHtml
encodedVariantAvailability
encodedVariantExistence
featuredImage {
altText
height
id
originalSrc
src
thumbhash
width
}
handle
id
isGiftCard
onlineStoreUrl
priceRange {
maxVariantPrice {
amount
currencyCode
}
minVariantPrice {
amount
currencyCode
}
}
productType
publishedAt
requiresSellingPlan
seo {
description
title
}
tags
title
totalInventory
trackingParameters
updatedAt
variantsCount {
count
precision
}
vendor
}
}
Variables
Pass these as a JSON object in the step's Variables field.
{
"productId": "string",
"productHandle": "string",
"intent": "RELATED"
}
Need more? See the Shopify Storefront guide for connection setup and behaviour shared by every action.
Was this page helpful?