Help with - Product Add to cart button redirect to Cart Drawer

Hi All,

I’m trying to redirect my Add to Cart to the Cart drawer.

  1. This is the code from my Product Page Dawn theme but when I paste it into my card-product.liquid it shows Sold Out and not Add to Cart although I have quantities in stock.
{%- if product.selected_or_first_available_variant.available -%} {{ 'products.product.add_to_cart' | t }} {%- else -%} {{ 'products.product.sold_out' | t }} {%- endif -%}
  1. I have also this code which shows the Add to Cart button on but when I click on it, the product is added to the Cart and I get redirected to the Cart Page.

{% if card_product.variants.size > 1 and card_product.available %}
View options
{% elsif card_product.available %}

{% else %} Sold out {%- endif -%}

Anyone has a solution to this?

Thanks.