We sell custom framed illustrated prints. I’m offering a collection of matching companion products (pint glasses, placemats, etc) to those customers who have purchased a print in the past.
To order one of these products, the customer must be logged in and have an order in their account that contains a framed print. Once that criteria is met, the product page will display a menu that allows the customer to select the order line containing the print they would like to apply to the product. The selected order is passed as a line item property on the order.
I solved this down to the order level using custom metafields with this code:
{% if customer %}
{%- if customer.metafields.custom.buyer != true -%}
Sorry. You don't seem to have any Custom Half Hull Print orders in our system to choose from.
{%- else -%}I have a flow setup that sets the customer Buyer metafield to true when a customer orders a print, and another that sets the order Art metafield to true at the same time.
Works great for orders with only one print, but need a solution for orders that contain more than one custom print. I need the menu to paint out each order line that contains a print.
Any ideas?