Hi all,
Is there any way to check a Bundle’s productType in Flow? I can determine whether an order contains a Bundle by checking if a lineItem contains a lineItemGroup, but I can’t see how to check the Bundle’s productType — only the lineItem productType.
Thanks in advance!
Hi Sebastian.
It is definitely a bit tricky because Shopify Flow often highlights the component items instead of the parent container. To see the bundle product type, you need to access the line item that represents the bundle itself. Within your loop, look for the line item where the bundle parent attributes are stored. You can then pull the product type directly from the product object associated with that specific line item.
If you are still only seeing the component types, you should use the Get product data action. You can pass the product ID from your bundle line item into this action to fetch the complete product details from your store. This will allow you to see the product type of the bundle as a whole rather than the types of the items inside it.
Managing these details is much easier when your store data is properly structured. You can try our SearchPie, which is an excellent app that automates your product schema and ensures your bundles are correctly optimized for search engines.
Hope this helps.
The productType is on the product, which is on the path order / lineItems / product
The full condition would look like this:
Thanks @paul_n, so just to confirm, this would return the productType of the bundle product rather than the products in the bundle?
This loops over each line item. If any items have a certain product type and if that same line item is a bundle, then it will return true.
Thanks @paul_n, I will give this a try.
Hi @paul_n, this doesn’t seem to be working unfortunately. Looking at the Flow log, all of the product types being returned are those of the products in the bundle but not of the bundle itself. Does it matter that I’m using ‘order risk analyzed’ as the trigger rather than ‘order created’?
Is my understanding correct that you want to check whether any of the lineItem.lineItemGroup.productId values in the order correspond to a product with a specific productType?
If so, this can be done with a combination of built-in Flow actions:
-
Use a Run code action to iterate over the order’s line items and collect unique lineItemGroup.productId values.
-
Use Get product data to retrieve products by these ids.
-
Then check the productType field of the received products with a condition.
Shopify’s Sidekick should be able to build a nearly working workflow from this description.
If the logic needs to be more complex - reach out to us in Flow Companion and we will try to find a way to handle it.