How to add line Item Properties to only 1 collection?

I have the code written for the “Colors You Would Like: (Example G3, P6, BK1)” line item, “Wooden Beads: Yes/NO” line item, and “? Braids, Twists, & Knots: Yes/No” line item. They work perfectly! But I only want to add those 3 line items to my collection called “Custom Orders”.

Can someone please write a code for this? Thank you!

The 3 codes that work:

:artist_palette: Colors You Would Like: (Example G3, P6, BK1)

?Wooden Beads: Yes/No

?Wooden Beads: Yes/No

Hi @HappyHues ,

I have reviewed your requirement, you just need to edit code script and the issue will be resolved.

You need to wrap the line items in a conditional statement that checks if the product belongs to the “Custom Orders” collection in liquid file.

Like this below:

{% if product.collections contains 'Custom Orders' %}
  

    
    
  

  

    
    
  

  

    
    
  

{% endif %}

With “{% if product.collections contains ‘Custom Orders’ %}” , you can add those 3 line items to my collection called “Custom Orders”.

I hope these instructions will help you. If they are helpful, please give us likes and mark as the solution.

Have a nice day sir!

Thank you for the reply! I appreciate you taking the time to help! It is still not working, am I putting the code into the wrong line or section? I am very new to this!