I am looking to pull a products vendor presumably from state.productInfo
but I am having no luck. Where is the vendor information stored?
Hi @ianjgreenfield, We hope you’re doing well!
By default, Builder does not pull vendors like it is done for products and collections. That being said, you could still a have dropdown of vendors to target. In Builder, you will need to manually enter the vendor values as targeting options (you can make this targeting attribute have enum values so they display in a list rather than needing to manually type in a vendor each time). Then in your codebase, if vendors are available from an API, you can use the API to dynamically pull products of vendors or hardcode them.
Let us know if you have further questions!
I am not targetting based on vendors, I am looking to add the vendor name to product boxes within a collection list.
Hi @ianjgreenfield, Builder pulled the vendor name here: - https://cdn.builder.io/api/v1/shopify/products/8000877134122.json?apiKey=YOUR_API_KEY. You can find other endpoints in Shopify’s documentation.
I think using a custom code to call the endpoint and storing all product IDs and vendor names to state. And use data binding for vendor name to field in product box where product id is equal might work for your requirement.
Recommended docs:
Thank you @garima . Am I able to surface the product id from a Builder collection/ product box?