fix(add_to_cart): show add_to_card button only if specific conditions are satisfied (#19007)

diff --git a/erpnext/templates/generators/item/item_add_to_cart.html b/erpnext/templates/generators/item/item_add_to_cart.html
index f4a31a7..2a70d8d 100644
--- a/erpnext/templates/generators/item/item_add_to_cart.html
+++ b/erpnext/templates/generators/item/item_add_to_cart.html
@@ -27,6 +27,7 @@
 			{% endif %}
 		</div>
 		{% endif %}
+		{% if product_info.price and (cart_settings.allow_items_not_in_stock or product_info.in_stock) %}
 		<div class="mt-3">
 			<a href="/cart"
 				class="btn btn-light btn-view-in-cart {% if not product_info.qty %}hidden{% endif %}"
@@ -41,6 +42,7 @@
 				{{ _("Add to Cart") }}
 			</button>
 		</div>
+		{% endif %}
 	</div>
 </div>
 
@@ -64,4 +66,4 @@
 	});
 </script>
 
-{% endif %}
\ No newline at end of file
+{% endif %}