Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
I updated from the Order Printer app legacy version and my templates seemed to be fine. But I noticed something odd with line item variants and discounts, which may end up being a syntax error (for all I know, I'm no whiz at this!).
When there's more than 1 line item with a variant, and more than 1 of those line items are discounted, for some reason only ONE of the discounted variants is has the original price displayed crossed out.
I think the problem lies between lines 60 and 73, but I don't what's wrong or know how to fix it. It's like only the first line item is affected, and I need to affect all of them. I hope someone can help - thank you in advance!
Solved! Go to the solution
This is an accepted solution.
Thank you for taking the time to check it for me, Roy! Much appreciated.
Weirdly, after cleaning up and lining up my code better throughout the template it seems to be fixed now...! 🤔
I think the main issue may be the migration from legacy, period. It could just be a bit glitchy, since my old invoice template was pretty heavily customized to begin with, and maybe it had trouble migrating the changes. But rather than remove this post I'll leave it here and mark it solved, as others might find the code for crossed-out variants useful. Because again, it's working just fine now so I guess my code for this section was actually good the whole time!
Hey @artofadornment
Good going there! The code logic in the screenshot looks correct if its coming from this chunk of code. It checks if the line item's variant has compare at price and if it does then strike it using the <s> tag otherwise keep the cell blank.
So my question is, are you sure that this is coming from that specific line of code? Can you add some text and see if its being reflected?
Let's connect and grow your Shopify business together!
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- Connect with me at: roy.solution.partner@gmail.com ( CRO | Site Speed Optimization | Custom Development )
This is an accepted solution.
Thank you for taking the time to check it for me, Roy! Much appreciated.
Weirdly, after cleaning up and lining up my code better throughout the template it seems to be fixed now...! 🤔
I think the main issue may be the migration from legacy, period. It could just be a bit glitchy, since my old invoice template was pretty heavily customized to begin with, and maybe it had trouble migrating the changes. But rather than remove this post I'll leave it here and mark it solved, as others might find the code for crossed-out variants useful. Because again, it's working just fine now so I guess my code for this section was actually good the whole time!
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025