Implement Phase 6 & 7: My Account and Order Details templates (Bootstrap 5, HPOS)

Phase 6 - My Account (15 templates):
- Account layout with sidebar navigation (list-group) and content area
- Orders table with status badges, pagination, and responsive design
- View order with order notes as list-group items
- Address cards with edit/add buttons
- Login/Register side-by-side card layout
- Account edit, password change, downloads, payment methods forms
- Lost/reset password forms and confirmation

Phase 7 - Order Details (5 templates):
- Order details table with items, totals, and customer note
- Line item rows with refund quantity display
- Customer billing/shipping address cards
- Order tracking form
- Order again button

All order templates use WC_Order object methods only (HPOS compatible).
Bootstrap 5 components: cards, tables, list-groups, badges, forms, alerts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-28 10:43:30 +01:00
parent 594d810439
commit 8b1793097c
22 changed files with 1377 additions and 20 deletions

View File

@@ -0,0 +1,49 @@
{#
# Edit Address Form (Bootstrap 5 Override)
#
# Address editing form with Bootstrap form styling.
#
# Expected context:
# load_address - Address type ('billing' or 'shipping'), or empty
# address - Array of address fields
#
# WooCommerce PHP equivalent: myaccount/form-edit-address.php
#
# @package WcBootstrap
# @since 0.1.0
#}
{% set page_title = load_address == 'billing' ? __('Billing address') : __('Shipping address') %}
{{ do_action('woocommerce_before_edit_account_address_form') }}
{% if not load_address %}
{% include 'myaccount/my-address.html.twig' %}
{% else %}
<form method="post" novalidate>
<h2 class="h4 mb-4">{{ apply_filters('woocommerce_my_account_edit_address_title', page_title, load_address) }}</h2>
<div class="woocommerce-address-fields">
{{ do_action('woocommerce_before_edit_address_form_' ~ load_address) }}
<div class="woocommerce-address-fields__field-wrapper">
{% for key, field in address %}
{{ woocommerce_form_field(key, field, wc_get_post_data_by_key(key, field.value)) }}
{% endfor %}
</div>
{{ do_action('woocommerce_after_edit_address_form_' ~ load_address) }}
<div class="mt-3">
<button type="submit" class="btn btn-primary" name="save_address" value="{{ __('Save address') }}">
<i class="bi bi-check-lg me-1" aria-hidden="true"></i>
{{ __('Save address') }}
</button>
{{ wp_nonce_field('woocommerce-edit_address', 'woocommerce-edit-address-nonce') }}
<input type="hidden" name="action" value="edit_address" />
</div>
</div>
</form>
{% endif %}
{{ do_action('woocommerce_after_edit_account_address_form') }}