Liquid, JavaScript, themes, sales channels
I feel like I'm so close on this because if I don't include any of the if statements then I can print the variables on the successful check out screen. Can you please help me to see what I'm missing here? Thanks
P.S. yes I have the actual product ID number in there correctly but I added it as 1234567890 for now. I've also checked that ?ref is set on the permalink url when they click a link on my website.
<script>
Shopify.Checkout.OrderStatus.addContentBox (
{% for line in checkout.line_items %}
{% if line_item.product_id == 1234567890 %}
{% if landing_site_ref %}
'<h2>Success Message!</h2>',
'<p style="color: red; font-weight: bold">Update your account now by
<a href="http://example.com/script.php?email={{ checkout.email }}&ref={{ landing_site_ref }}">clicking here</a></p>'
)
{% endif %}
{% endif %}
{% endfor %}
</script>
I found a bit of mistake in the script with where I showed the order status content box
Still isn't working though
<script>
{% for line in checkout.line_items %}
{% if line_item.product_id == 1234567890 %}
{% unless landing_site_ref == blank %}
Shopify.Checkout.OrderStatus.addContentBox (
'<h2>Success Message!</h2>',
'<p style="color: red; font-weight: bold">Update your account now by
<a href="http://example.com/script.php?email={{ checkout.email }}&ref={{ landing_site_ref }}">clicking here</a></p>'
)
{% endunless %}
{% endif %}
{% endfor %}
</script>
Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024Digital marketers and app developers have tracked activity in apps and websites for yea...
By Ollie Mar 13, 2024February was an exciting month with Shopify Editions, informative webinars, and more! F...
By JasonH Mar 7, 2024