How can I hide the display price and the add to cart button?
There are 2 ways:
- Change the liquid files of your theme. Our products can be identified with the vendor or type equal to 'BYOB'. Please consult your theme developer if necessary
- Add a custom liquid section to your collection
For OS 2.0 themes like Dawn, you can add a custom liquid to the collection. Please follow the steps below:- Prepare the collection handle if the collection link is https://byob.myshopify.com/collections/vans. The collection handle is 'collections/vans'
- Set the product price to a special price like $25.5 or any price you like. Please note that all prices under the collection will be removed
- Prepare the class name of the price element. This is a bit harder. You have to use the inspector on Chrome. Open it with Ctrl + Shift + I or F12 or right-click => Inspect. For Dawn theme, the class name is 'price':
- In the theme editor, go to Collections => Default Collection. Add a custom liquid to your theme. After that, Copy and paste the code below. Replace the handle, price, and class name with your own (the first 2 - 4 lines):
<script> let collection_handle = 'collections/YOUR-COLLECTION-NAME'; let price = 'YOUR PRICE'; let classname = 'YOUR CLASSNAME'; if (window.location.pathname.includes(collection_handle)) { let elements = document.getElementsByClassName(classname); for (el of elements) { if (el.innerText.includes(price)) { while (el.firstChild) { el.removeChild(el.firstChild); } // remove extra sibling element like direct add to cart button if (el.nextElementSibling) el.parentNode.removeChild(el.nextElementSibling); } } } </script><br>
You can also watch this video for the whole process (the sample theme is Dawn):
- You may need to type a space and save it again. The theme editor is slow and not saving the changes occasionally.