Shopify themes, liquid, logos, and UX
I'm trying to display the number of unfulfilled orders our store currently has ahead of a customer who might be placing an order.
It should work out the number of orders with the status unfulfilled there are at the time they are browsing and show the number.
The code I have been testing is as follows but it is returning 0 orders everytime, it should be 77.
{% assign unfulfilled_orders = 0 %} {% for order in orders %} {% if order.fulfillment_status == 'unfulfilled' and order.created_at <= 'now' %} {% assign unfulfilled_orders = unfulfilled_orders | plus: 1 %} {% endif %} {% endfor %} The number of unfulfilled orders as of {{'now' | date: '%Y-%m-%d'}} is {{unfulfilled_orders}}.
hey, Benpellwall. I think the validation order.created_at probably shouldn't work, as 'now' usually only works with the filter. You can try to store {{ 'now | date: '%Y-%m-%d' }} in a variable and, then, see if it matches the way that order.created_at presents its date
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024