Hi community!
We have a store where many products are made to order and we want to display a custom availability message:
- on the product page above the Add to Cart / Buy Now buttons (DONE via theme product template (Impulse theme))
- in cart drawer under each cart item product title (NOT WORKING).
So I am trying to display a metafield value under each product title in the cart drawer using the following in cart-item.liquid:
<div class="cart__item-details">
<div class="cart__item-title">
<a href="{{ product.url }}" class="cart__item-name">
{{ product.product.title }}
</a>
**{{ item.product.metafields.custom.product_availability.value }} xxx**
The metafield value does not display. The ‘xxx’ displays exactly where we want the metafield data to display.
If I change cart type to ‘page’ and edit main-cart.liquid then I can get the metafield value to display successfully like this:
<div data-products class="cart__page-col">
{% for item in cart.items %}
{%- render 'cart-item', product: item -%}
**{{ item.product.metafields.custom.product_availability.value }}**
{%- endfor -%}
</div>
However it renders the metafield value in a weird place as appears below, not inside, the item rendered section. It appears in between each product in the cart.
We would much prefer to keep cart drawer though anyway. But next best option would be to revert to cart page if we can work out how to display the metafield value just under the cart item title.
Is it actually possible to display metafield values within Cart Drawer? Or are we doing it wrong?
Thank you!