Shopify themes, liquid, logos, and UX
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:
<p class="line-item-property__field">
<label for="colors-you-would-like-example-g3-p6-bk1">🎨Colors You Would Like: (Example G3, P6, BK1) </label>
<input required class="required" id="colors-you-would-like-example-g3-p6-bk1" type="text" name="properties[🎨Colors You Would Like: (Example G3, P6, BK1) ]">
</p>
<p class="line-item-property__field">
<label for="wooden-beads-yesno">🪵Wooden Beads: Yes/No</label>
<input required class="required" id="wooden-beads-yesno" type="text" name="properties[🪵Wooden Beads: Yes/No]">
</p>
<p class="line-item-property__field">
<label for="wooden-beads-yesno">🪵Wooden Beads: Yes/No</label>
<input required class="required" id="wooden-beads-yesno" type="text" name="properties[🪵Wooden Beads: Yes/No]">
</p>
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' %}
<p class="line-item-property__field">
<label for="colors-you-would-like-example-g3-p6-bk1">:artist_palette:Colors You Would Like: (Example G3, P6, BK1) </label>
<input required class="required" id="colors-you-would-like-example-g3-p6-bk1" type="text" name="properties[:artist_palette:Colors You Would Like: (Example G3, P6, BK1) ]">
</p>
<p class="line-item-property__field">
<label for="wooden-beads-yesno">🪵Wooden Beads: Yes/No</label>
<input required class="required" id="wooden-beads-yesno" type="text" name="properties[🪵Wooden Beads: Yes/No]">
</p>
<p class="line-item-property__field">
<label for="braids-twists-knots-yesno">🪢 Braids, Twists, & Knots: Yes/No</label>
<input required class="required" id="braids-twists-knots-yesno" type="text" name="properties[🪢 Braids, Twists, & Knots: Yes/No]">
</p>
{% 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!
B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.
B2B Portal, Quote, Net 30: Speed up purchasing and streamline your quotation process with advanced features like quick order, request for quote.
B2B Lock Password Protect: Easily control access to pages, products, and pricing with robust features.
BSS Commerce - Full-service eCommerce Agency I Use Shopify for 1$ in the first month now
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!
By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024