You've already forked wc-bootstrap
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:
57
templates/myaccount/my-address.html.twig
Normal file
57
templates/myaccount/my-address.html.twig
Normal file
@@ -0,0 +1,57 @@
|
||||
{#
|
||||
# My Addresses (Bootstrap 5 Override)
|
||||
#
|
||||
# Shows billing and shipping addresses as Bootstrap cards.
|
||||
#
|
||||
# WooCommerce PHP equivalent: myaccount/my-address.php
|
||||
#
|
||||
# @package WcBootstrap
|
||||
# @since 0.1.0
|
||||
#}
|
||||
|
||||
{% set customer_id = get_current_user_id() %}
|
||||
|
||||
{% if not wc_ship_to_billing_address_only() and wc_shipping_enabled() %}
|
||||
{% set get_addresses = apply_filters('woocommerce_my_account_get_addresses', {
|
||||
billing: __('Billing address'),
|
||||
shipping: __('Shipping address')
|
||||
}, customer_id) %}
|
||||
{% else %}
|
||||
{% set get_addresses = apply_filters('woocommerce_my_account_get_addresses', {
|
||||
billing: __('Billing address')
|
||||
}, customer_id) %}
|
||||
{% endif %}
|
||||
|
||||
<p class="text-body-secondary mb-4">
|
||||
{{ apply_filters('woocommerce_my_account_my_address_description', __('The following addresses will be used on the checkout page by default.')) }}
|
||||
</p>
|
||||
|
||||
<div class="row g-4">
|
||||
{% for name, address_title in get_addresses %}
|
||||
{% set address = wc_get_account_formatted_address(name) %}
|
||||
<div class="col-md-6">
|
||||
<div class="card h-100">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h3 class="h6 mb-0">{{ address_title|esc_html }}</h3>
|
||||
<a href="{{ wc_get_endpoint_url('edit-address', name)|esc_url }}" class="btn btn-sm btn-outline-primary">
|
||||
{% if address %}
|
||||
<i class="bi bi-pencil me-1" aria-hidden="true"></i>{{ __('Edit') }}
|
||||
{% else %}
|
||||
<i class="bi bi-plus me-1" aria-hidden="true"></i>{{ __('Add') }}
|
||||
{% endif %}
|
||||
</a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<address class="mb-0">
|
||||
{% if address %}
|
||||
{{ address|wp_kses_post }}
|
||||
{% else %}
|
||||
<span class="text-body-secondary">{{ __('You have not set up this type of address yet.') }}</span>
|
||||
{% endif %}
|
||||
</address>
|
||||
{{ do_action('woocommerce_my_account_after_my_address', name) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
Reference in New Issue
Block a user