{# # Cart Page (Bootstrap 5 Override) # # Main cart page with items table and totals sidebar. # Layout: col-lg-8 (items) + col-lg-4 (totals). # # Expected context: # cart_items - Array from WC()->cart->get_cart(), each with: # .key - Cart item key # .product - WC_Product object # .product_id - Product ID # .product_name - Filtered product name # .permalink - Product URL # .quantity - Quantity # .subtotal - Line subtotal HTML # .price - Unit price HTML # .thumbnail - Product thumbnail HTML # .item_data_html - Variation data HTML # .remove_url - Remove item URL # .visible - Whether item is visible # .css_class - Item CSS class # # WooCommerce PHP equivalent: cart/cart.php # # @package WcBootstrap # @since 0.1.0 #} {{ do_action('woocommerce_before_cart') }}
{# Cart items table #}
{{ do_action('woocommerce_before_cart_table') }}
{{ do_action('woocommerce_before_cart_contents') }} {% if cart_items is defined %} {% for item in cart_items %} {% if item.visible is not defined or item.visible %} {% endif %} {% endfor %} {% endif %} {{ do_action('woocommerce_cart_contents') }} {{ do_action('woocommerce_after_cart_contents') }}
{{ __('Thumbnail') }} {{ __('Product') }} {{ __('Price') }} {{ __('Quantity') }} {{ __('Subtotal') }} {{ __('Remove') }}
{% if item.permalink %} {{ item.thumbnail|raw }} {% else %} {{ item.thumbnail|raw }} {% endif %} {% if item.permalink %} {{ item.product_name|esc_html }} {% else %} {{ item.product_name|esc_html }} {% endif %} {{ item.item_data_html|default('')|raw }} {{ item.price|raw }} {% include 'global/quantity-input.html.twig' with { input_id: 'quantity_' ~ item.key, input_name: 'cart[' ~ item.key ~ '][qty]', input_value: item.quantity, min_value: 0, max_value: item.product.get_max_purchase_quantity()|default(0), step: 1, placeholder: '', inputmode: 'numeric', classes: 'qty', readonly: false, type: 'number', args: { product_name: item.product_name } } %} {{ item.subtotal|raw }}
{% if wc_coupons_enabled() %}
{{ do_action('woocommerce_cart_coupon') }}
{% endif %} {{ do_action('woocommerce_cart_actions') }} {{ wp_nonce_field('woocommerce-cart', 'woocommerce-cart-nonce') }}
{{ do_action('woocommerce_after_cart_table') }}
{# Cart totals sidebar #}
{{ do_action('woocommerce_cart_collaterals') }}
{{ do_action('woocommerce_after_cart') }}