Liquid, JavaScript, themes, sales channels
I am trying to filter orders until a specific cutoff date on our member accounts page. Here is my approach:
{% paginate customer.orders by 20 %} {% assign ordersThresholdDate = '2020-04-07' | date: '%s' %} {% assign orderDate = order.created_at | date: '%s' %}
{% if orderDate >= ordersThresholdDate %} (display orders and such) {% endif %}
The part of the code I am having trouble with, spits out nothing:
{% assign orderDate = order.created_at | date: '%s' %}
It seems like the date filter doesn't work on this object variable at all, which doesn't make much sense to me... How can I get the value I am looking for, or is there a better method for what I am trying to do?
Thanks!
Solved! Go to the solution
This is an accepted solution.
This has been solved, I've discovered my issue. I was putting the code in the wrong place.
This is an accepted solution.
This has been solved, I've discovered my issue. I was putting the code in the wrong place.
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