Preorder code fix help

Tourist
12 0 2

Hi I got this problem where when I try this alternative source and tried it, it actually works but the problem is that I can't add it onto the cart. Maybe there's a way to merge this two code to make things possible. Thank you

Alternative source

<div class="product-single__add-to-cart{% if section.settings.add_to_cart_button_size == 'large' %} product-single__add-to-cart--full-width{% endif %}">
<button type="submit" name="add" id="AddToCart--{{ 'Pre-order' | json | remove: '"' }}" class="btn btn--add-to-cart"{% unless current_variant.available %} disabled="disabled"{% endunless %}>
<span class="btn__text">
{% if current_variant.available %}
{{ 'Pre-order' | json }}
{% else %}
{{ 'products.product.sold_out' | t }}
{% endif %}
</span>
</button>

Original
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<meta itemprop="priceCurrency" content="{{ shop.currency }}">
<link itemprop="availability" href="http://schema.org/{% if product.available %}InStock{% else %}OutOfStock{% endif %}">
{% capture product_form_config %}{ "money_format": {{ shop.money_format | json }}, "enable_history": true, "sold_out": {{ "products.product.sold_out" | t | json }}, "unavailable": {{ "products.product.unavailable" | t | json }}, "button": {{ 'products.product.add_to_cart' | t | json }} }{% endcapture %}
{% include 'product-form' type: section %}
<div class="clear"></div>

0 Likes