App reviews, troubleshooting, and recommendations
I know this cant be done using liquid because I have already tried. They want new items to appear first which contain a certain product tag and the on sale items to appear last in every custom collection on the site.
I started creating a standalone app and plan to query the active products in the collection, reorder them, and then organize them using collectionReorderProducts in the GraphQL Admin API. The only thing I am worried about is there are up to 3k products in each collection and dont want to hit the rate limit.
Other than that it seems to be possible but they said they reached out to multiple agencies that said it couldnt be done. Am I wrong or can this be done?
You should be able to do it in liquid. Or at least in javascript!
I know i'm coming in to this with no context of what you've done so far, but here is my guess at what you can do with liquid.
Note: This is not working with any filtering off tags yet. That can be added later.
{% assign products = collection.products %}
{% assign sorted_products = products | sort: 'created_at' | reverse %}
{% if sorted_products != blank %}
<div class="product-list">
{% for product in sorted_products %}
<div class="product-item">
<a href="{{ product.url }}">
<div class="product-image">
<img src="{{ product.featured_image | img_url: 'medium' }}" alt="{{ product.title }}">
</div>
<div class="product-title">{{ product.title }}</div>
</a>
</div>
{% endfor %}
</div>
{% else %}
<p>No products found.</p>
{% endif %}
Let me know if this is anything close to what you have tried. I'm always looking for tricky code things that need a solution! 😂
No liquid/JS wont work. Just because it was created/published at a certain date in my case doesn't mean that its new... JS is too slow and the pagination makes it impossible for either of those options. The only solution I think its to create a server to schedule sorts at night with the API.
You're right on this one. Definitely stay away from javascript based sorting methods. When stores want to use dynamic sorting, it's time to do it through an app.
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