All things Shopify and commerce
Some customer adds the products to their cart, and they forget after adding them. But after sometimes they come back to the site and check their cart but some products have been sold out.
So we have to find a solution for the out-of-stock products automatically removed from the cart.
Solved! Go to the solution
This is an accepted solution.
Hey Ramiz,
We are not sure if an app can solve the problem, but definitely, with small coding customization, this can be achieved. The logic for the same will be " As soon as the customer reaches cart page - check the products - check their real-time inventory - list/unlist products accordingly ". The UX can be adjusted by a loader but this should solve the problem for you.
Hope this helps 🙂
This is an accepted solution.
Hey Ramiz,
We are not sure if an app can solve the problem, but definitely, with small coding customization, this can be achieved. The logic for the same will be " As soon as the customer reaches cart page - check the products - check their real-time inventory - list/unlist products accordingly ". The UX can be adjusted by a loader but this should solve the problem for you.
Hope this helps 🙂
hy Marmeto thanks for suggetion but in this task i need to autohide soldout product can u pls suggest me any code
finally i got solution of this problem basically i use this condition on remove button and by using document.getElementById we can auto remove only soldout product from cart only not collection so firstly
1.
<p class="remove">
{% if item.variant.available == false %}
<a href="/cart/change?line={{ forloop.index }}&quantity=0" id="rm-link-{{ forloop.index }}" class="text-link text-link--accent" aria-label="{{ 'cart.label.remove' | t: product: item.title }}" data-cart-remove data-role="product-remove">{{ 'cart.general.remove' | t }}</a>
{% endif %}
</p>
2.
<script>
document.getElementById('rm-link-1').click();
</script>
where i should put this code ?
As 2024 wraps up, the dropshipping landscape is already shifting towards 2025's trends....
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024In today’s interview, we sat down with @BSS-Commerce to discuss practical strategies f...
By JasonH Nov 13, 2024