Sold out product with suggested alternative

Is there a way to suggest another product with link when one product is low or sold out on the product page?

Hi,

You can do it with code, into product page you can check if the product is low or sold out you will show a link instead of button add to cart.

{% assign current_variant = product.selected_or_first_available_variant %}
  {% if current_variant.available %}
    {% if current_variant.inventory_quantity > 0 and current_variant.inventory_quantity <= 10 %}
   // show link
{% elsif current_variant.inventory_quantity > 10 %}
   // show add to cart
    {% endif %}
  {% endif %}
1 Like