You've already forked wc-bootstrap
52 lines
1.7 KiB
Twig
52 lines
1.7 KiB
Twig
|
|
{#
|
||
|
|
# Variation Add to Cart Button (Bootstrap 5 Override)
|
||
|
|
#
|
||
|
|
# Renders the quantity input and add-to-cart button for variable products
|
||
|
|
# after variation selection.
|
||
|
|
#
|
||
|
|
# Expected context:
|
||
|
|
# product - WC_Product_Variable object
|
||
|
|
#
|
||
|
|
# WooCommerce PHP equivalent: single-product/add-to-cart/variation-add-to-cart-button.php
|
||
|
|
#
|
||
|
|
# @package WcBootstrap
|
||
|
|
# @since 0.1.0
|
||
|
|
#}
|
||
|
|
|
||
|
|
<div class="woocommerce-variation-add-to-cart variations_button">
|
||
|
|
{{ do_action('woocommerce_before_add_to_cart_button') }}
|
||
|
|
|
||
|
|
<div class="d-flex align-items-end gap-3 mb-3">
|
||
|
|
{{ do_action('woocommerce_before_add_to_cart_quantity') }}
|
||
|
|
|
||
|
|
{% include 'global/quantity-input.html.twig' with {
|
||
|
|
input_id: 'quantity_' ~ product.get_id(),
|
||
|
|
input_name: 'quantity',
|
||
|
|
input_value: 1,
|
||
|
|
min_value: product.get_min_purchase_quantity()|default(1),
|
||
|
|
max_value: product.get_max_purchase_quantity()|default(0),
|
||
|
|
step: 1,
|
||
|
|
placeholder: '',
|
||
|
|
inputmode: 'numeric',
|
||
|
|
classes: 'qty',
|
||
|
|
readonly: false,
|
||
|
|
type: 'number',
|
||
|
|
args: { product_name: product.get_name() }
|
||
|
|
} %}
|
||
|
|
|
||
|
|
{{ do_action('woocommerce_after_add_to_cart_quantity') }}
|
||
|
|
|
||
|
|
<button type="submit"
|
||
|
|
class="btn btn-primary btn-lg single_add_to_cart_button"
|
||
|
|
disabled>
|
||
|
|
{{ product.single_add_to_cart_text() }}
|
||
|
|
</button>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<input type="hidden" name="add-to-cart" value="{{ product.get_id() }}" />
|
||
|
|
<input type="hidden" name="product_id" value="{{ product.get_id() }}" />
|
||
|
|
<input type="hidden" name="variation_id" class="variation_id" value="0" />
|
||
|
|
|
||
|
|
{{ do_action('woocommerce_after_add_to_cart_button') }}
|
||
|
|
</div>
|