You've already forked wc-bootstrap
76 lines
3.2 KiB
Twig
76 lines
3.2 KiB
Twig
|
|
{#
|
||
|
|
# Thank You / Order Confirmation (Bootstrap 5 Override)
|
||
|
|
#
|
||
|
|
# HPOS compatible: uses WC_Order object methods only, no $post global.
|
||
|
|
#
|
||
|
|
# Expected context:
|
||
|
|
# order - WC_Order object (or null on failure)
|
||
|
|
#
|
||
|
|
# WooCommerce PHP equivalent: checkout/thankyou.php
|
||
|
|
#
|
||
|
|
# @package WcBootstrap
|
||
|
|
# @since 0.1.0
|
||
|
|
#}
|
||
|
|
|
||
|
|
{{ do_action('woocommerce_before_thankyou') }}
|
||
|
|
|
||
|
|
{% if order is defined and order %}
|
||
|
|
{% if order.has_status('failed') %}
|
||
|
|
<div class="alert alert-danger mb-4" role="alert">
|
||
|
|
<p class="mb-0">
|
||
|
|
{{ __('Unfortunately your order cannot be processed as the originating bank/merchant has declined your transaction. Please attempt your purchase again.') }}
|
||
|
|
</p>
|
||
|
|
</div>
|
||
|
|
<p>
|
||
|
|
<a href="{{ order.get_checkout_payment_url()|esc_url }}" class="btn btn-outline-primary">
|
||
|
|
{{ __('Pay') }}
|
||
|
|
</a>
|
||
|
|
</p>
|
||
|
|
{% else %}
|
||
|
|
<div class="alert alert-success mb-4" role="alert">
|
||
|
|
<i class="bi bi-check-circle me-2" aria-hidden="true"></i>
|
||
|
|
{% include 'checkout/order-received.html.twig' with { order: order } %}
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="card shadow-sm mb-4">
|
||
|
|
<div class="card-header">
|
||
|
|
<h2 class="h5 mb-0">{{ __('Order details') }}</h2>
|
||
|
|
</div>
|
||
|
|
<ul class="list-group list-group-flush">
|
||
|
|
<li class="list-group-item d-flex justify-content-between">
|
||
|
|
<span class="text-body-secondary">{{ __('Order number:') }}</span>
|
||
|
|
<strong>{{ order.get_order_number() }}</strong>
|
||
|
|
</li>
|
||
|
|
<li class="list-group-item d-flex justify-content-between">
|
||
|
|
<span class="text-body-secondary">{{ __('Date:') }}</span>
|
||
|
|
<strong>{{ order.get_date_created().date_i18n(wc_date_format()) }}</strong>
|
||
|
|
</li>
|
||
|
|
{% if order.get_billing_email() %}
|
||
|
|
<li class="list-group-item d-flex justify-content-between">
|
||
|
|
<span class="text-body-secondary">{{ __('Email:') }}</span>
|
||
|
|
<strong>{{ order.get_billing_email()|esc_html }}</strong>
|
||
|
|
</li>
|
||
|
|
{% endif %}
|
||
|
|
<li class="list-group-item d-flex justify-content-between">
|
||
|
|
<span class="text-body-secondary">{{ __('Total:') }}</span>
|
||
|
|
<strong>{{ order.get_formatted_order_total()|raw }}</strong>
|
||
|
|
</li>
|
||
|
|
{% if order.get_payment_method_title() %}
|
||
|
|
<li class="list-group-item d-flex justify-content-between">
|
||
|
|
<span class="text-body-secondary">{{ __('Payment method:') }}</span>
|
||
|
|
<strong>{{ order.get_payment_method_title()|esc_html }}</strong>
|
||
|
|
</li>
|
||
|
|
{% endif %}
|
||
|
|
</ul>
|
||
|
|
</div>
|
||
|
|
{% endif %}
|
||
|
|
|
||
|
|
{{ do_action('woocommerce_thankyou_' ~ order.get_payment_method(), order.get_id()) }}
|
||
|
|
{{ do_action('woocommerce_thankyou', order.get_id()) }}
|
||
|
|
{% else %}
|
||
|
|
<div class="alert alert-success mb-4" role="alert">
|
||
|
|
<i class="bi bi-check-circle me-2" aria-hidden="true"></i>
|
||
|
|
{% include 'checkout/order-received.html.twig' %}
|
||
|
|
</div>
|
||
|
|
{% endif %}
|