Shopify Flow is an ecommerce automation platform that enables you to automate tasks and processes within your store and across your apps.
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
The current scope of the abandoned checkout flow does not allow for checking the lineitem "selling_plan_id" parameter. Is there a way in Flow to query an abandoned checkout object and check if the line items are a subscription product or not?
Hello @ChunkySteveo ,
Shopify Flow doesn't directly allow you to check the selling_plan_id on abandoned checkouts. Instead, use tags or metafields to mark subscription products. Then, in Flow, check for these tags or metafields to identify subscription products in the abandoned checkout.
For example:
Hey Steve,
Thanks for the idea, which would be good, but we use ReCharge for subscription items, and as such - we offer the products as one-off items, or to purchase with a subscription/selling_plan. Therefore we can't distinguish between sub and non-sub products, as they (99% of them) can all be bought singularly or as a subscription plan. This is why we're needing to query if there's a selling plan associated with the line item, in the checkout object.
Thanks - Steve
Hello @ChunkySteveo ,
Lets try this method !
const lineItem = checkout.lineItems.find(item => item.id === lineItemId);
if (lineItem.selling_plan_allocation) {
console.log('This item is part of a subscription plan.');
// You can access the selling plan details here
console.log(lineItem.selling_plan_allocation.selling_plan.id);
} else {
console.log('This item is not part of a subscription plan.');
}
Thanks!
Where is that code going in the Flow? Is that part of a "Run Code" action block? If so - what's the input to be used?
Thanks.
Is that in a "Run Code" block, Steve?