Shopify themes, liquid, logos, and UX
Hi team. I am trying to add a condition that if a product price or variant is at $0.00, text saying "Coming Soon!" is displayed.
I am using the latest Debut theme and have followed a few threads. I think I am close, but keep getting an error.
Here is the code I have changed in the product.price liquid snippet. I am REALLY new to coding, so any assistance would be awesome.
Jason
Hi Jason!
You are pretty close to the solution but there's a few mistakes made. I'll try and break this down into parts first. There's a quick solution but I'm mindful to just not give you the answer without trying to nudge you there first. If you do get stuck that's ok.
Part 1: Liquid tags
What has tripped you up is that there is a surrounding {%- liquid -%} tag. You'll notice that Liquid within that tag doesn't need the braces anymore. Notice how the lines above don't have those?
Take your {%endif%} and just make it endif.
well really it should be made...
endif
%}
...since that will close the Liquid tag properly (see part 3 below)
Part 2: Logic statement is broken
You've added your code into an existing logic block (being the if statement). It reads as:
That's not a valid flow.
Part 3: Liquid Tag isn't closed.
Now that {% endif %} could have tripped you up here too but it does need a %} to close it off properly
Part 4: Money vs a string
Warning only. Do note that some themes will expect the price to be an actual price vs some other string. Not sure what your theme will do but it's possible something will break. Try it and see!
If you need to see the complete code just pop a reply and I'll give it. Since I am a little lazy (efficient) it would help if you pasted the code instead of that screenshot so it's easier for me to tweak.
Are you ready to take your business to the next level? Look no further than the latest ...
By SarahF_Shopify Apr 15, 2024We’re keeping the ball rolling to make sure you’re always ahead of the game. So buckle ...
By JasonH Apr 8, 2024Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024