Order Printer App: Old Variant Price Not Crossed Out When More Discounted Line Items Present

Solved

Order Printer App: Old Variant Price Not Crossed Out When More Discounted Line Items Present

artofadornment
Excursionist
27 3 13

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.

 

invoice.png

 

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!

 

invoicecode1.png

Accepted Solution (1)
artofadornment
Excursionist
27 3 13

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!

View solution in original post

Replies 2 (2)

Roy-ロイ
Shopify Partner
91 19 35

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? 


Cheers, 
Roy

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 )

artofadornment
Excursionist
27 3 13

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!