Cutoff date for displaying customer orders on account page

Solved
rusgoodman
Tourist
5 1 1

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!

0 Likes
rusgoodman
Tourist
5 1 1

This is an accepted solution.

This has been solved, I've discovered my issue. I was putting the code in the wrong place.

0 Likes