{# # My Account Orders (Bootstrap 5 Override) # # Shows orders table on the account page with Bootstrap table styling. # HPOS compatible: uses WC_Order methods only. # # Expected context: # has_orders - boolean # customer_orders - object with .orders array and .max_num_pages # current_page - current pagination page number # wp_button_class - WP theme button class # # WooCommerce PHP equivalent: myaccount/orders.php # # @package WcBootstrap # @since 0.1.0 #} {{ do_action('woocommerce_before_account_orders', has_orders) }} {% if has_orders %}
{% for column_id, column_name in wc_get_account_orders_columns() %} {% endfor %} {% for customer_order in customer_orders.orders %} {% set order = wc_get_order(customer_order) %} {% set item_count = order.get_item_count() - order.get_item_count_refunded() %} {% for column_id, column_name in wc_get_account_orders_columns() %} {% if column_id == 'order-number' %} {% elseif column_id == 'order-date' %} {% elseif column_id == 'order-status' %} {% elseif column_id == 'order-total' %} {% elseif column_id == 'order-actions' %} {% else %} {% endif %} {% endfor %} {% endfor %}
{{ column_name|esc_html }}
#{{ order.get_order_number()|esc_html }} {% set status = order.get_status() %} {% if status == 'completed' %} {{ wc_get_order_status_name(status)|esc_html }} {% elseif status == 'processing' %} {{ wc_get_order_status_name(status)|esc_html }} {% elseif status == 'on-hold' %} {{ wc_get_order_status_name(status)|esc_html }} {% elseif status == 'cancelled' or status == 'failed' or status == 'refunded' %} {{ wc_get_order_status_name(status)|esc_html }} {% else %} {{ wc_get_order_status_name(status)|esc_html }} {% endif %} {{ _n('%1$s for %2$s item', '%1$s for %2$s items', item_count)|format(order.get_formatted_order_total(), item_count)|wp_kses_post }} {% set actions = wc_get_account_orders_actions(order) %} {% if actions is not empty %}
{% for key, action in actions %} {{ action.name|esc_html }} {% endfor %}
{% endif %}
{{ do_action('woocommerce_my_account_my_orders_column_' ~ column_id, order) }}
{{ do_action('woocommerce_before_account_orders_pagination') }} {% if customer_orders.max_num_pages > 1 %} {% endif %} {% else %} {% endif %} {{ do_action('woocommerce_after_account_orders', has_orders) }}