If 'costumize' is selected then engraving option appears

Solved

If 'costumize' is selected then engraving option appears

bndcreationsllc
Visitor
2 0 0

I want to add the option that if the variant 'customize' is selected then the option to engrave appears. 

 

Below is the code for the engraving section. Currently, it is under the buy.buttons.liquid so it appears all the time regardless if the variant 'customize' is selected or not. 

<p class="line-item-property__field">
<label for="Engrave">Engrave</label><br>
<input id="Engrave" type="text" name="properties[Engrave]" style="width: 100%; line-height: 2;">
</p>

Accepted Solution (1)
ThePrimeWeb
Shopify Partner
2139 616 510

This is an accepted solution.

Hey @bndcreationsllc,

 

Go to your theme's "Edit Code" Option, then in the search bar type "theme.liquid"
Below the tag "<head>" tag paste the following. Screenshot attached for reference.

<style>
.line-item-property__field:has(#Engrave) {
    display: none !important;
}

body:has(input[value="Customize"]:checked) .line-item-property__field:has(#Engrave) {
    display: block !important;
}
</style>

 

Screenshot is for reference only, the correct code to paste is the one shown above.

ThePrimeWeb_0-1709414692134.jpeg

 

Was I helpful?

Buy me a coffee

🙂

Need help with your store? contact@theprimeweb.com or check out the website
Check out our interview with Shopify!

View solution in original post

Replies 4 (4)

ThePrimeWeb
Shopify Partner
2139 616 510

Hey @bndcreationsllc,

 

Can you share the link to your store please? Thanks!

Was I helpful?

Buy me a coffee

🙂

Need help with your store? contact@theprimeweb.com or check out the website
Check out our interview with Shopify!
bndcreationsllc
Visitor
2 0 0

Here is the link to my site, https://bndcreationsllc.com/

ThePrimeWeb
Shopify Partner
2139 616 510

This is an accepted solution.

Hey @bndcreationsllc,

 

Go to your theme's "Edit Code" Option, then in the search bar type "theme.liquid"
Below the tag "<head>" tag paste the following. Screenshot attached for reference.

<style>
.line-item-property__field:has(#Engrave) {
    display: none !important;
}

body:has(input[value="Customize"]:checked) .line-item-property__field:has(#Engrave) {
    display: block !important;
}
</style>

 

Screenshot is for reference only, the correct code to paste is the one shown above.

ThePrimeWeb_0-1709414692134.jpeg

 

Was I helpful?

Buy me a coffee

🙂

Need help with your store? contact@theprimeweb.com or check out the website
Check out our interview with Shopify!

EasifyApps
Shopify Partner
635 19 48

Hi @bndcreationsllc,

To implement an engraving text field that only appears when the "Customize" variant is selected, follow these steps using the Easify Product Options app. For example:

EasifyApps_3-1713843965177.png

EasifyApps_4-1713843980841.png

 

App Settings:

  • Create a text field using the app's Text Box option type.

EasifyApps_0-1713843778692.png

 

  • Add Conditional logic to the Text Box so it's displayed only when the "Customize" variant is selected.

EasifyApps_1-1713843793823.png

 

  • Add the Text Box to the relevant product(s).

EasifyApps_2-1713843838570.png

Easify Product Options: Any product options app can help you create custom options, but Easify turns those options into sales and conversions!
Easify Inventory Sync: Automate inventory syncing for Bundles, Duplicates, and Raw Materials. Say goodbye to manual tracking headaches.
Easify Product Attachments: Enrich your store with downloadable content. Easily add PDFs and other files to product or any page.
>>> Try Apps for Free | 24/7 Live Chat Support