| 1 |
<?php |
| 2 |
/** |
| 3 |
* Pay for order form |
| 4 |
* |
| 5 |
* This template can be overridden by copying it to yourtheme/woocommerce/checkout/form-pay.php. |
| 6 |
* |
| 7 |
* HOWEVER, on occasion WooCommerce will need to update template files and you |
| 8 |
* (the theme developer) will need to copy the new files to your theme to |
| 9 |
* maintain compatibility. We try to do this as little as possible, but it does |
| 10 |
* happen. When this occurs the version of the template file will be bumped and |
| 11 |
* the readme will list any important changes. |
| 12 |
* |
| 13 |
* @see https://woocommerce.com/document/template-structure/ |
| 14 |
* @package CartFlows |
| 15 |
* @version 8.2.0 |
| 16 |
*/ |
| 17 |
|
| 18 |
defined( 'ABSPATH' ) || exit; |
| 19 |
|
| 20 |
$totals = $order->get_order_item_totals(); // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited |
| 21 |
?> |
| 22 |
<div class="wcf-order-pay-wrap"> |
| 23 |
<form id="order_review" method="post"> |
| 24 |
|
| 25 |
<table class="shop_table"> |
| 26 |
<thead> |
| 27 |
<tr> |
| 28 |
<th class="product-name"><?php esc_html_e( 'Product', 'woocommerce' ); ?></th> |
| 29 |
<th class="product-quantity"><?php esc_html_e( 'Qty', 'woocommerce' ); ?></th> |
| 30 |
<th class="product-total"><?php esc_html_e( 'Totals', 'woocommerce' ); ?></th> |
| 31 |
</tr> |
| 32 |
</thead> |
| 33 |
<tbody> |
| 34 |
<?php if ( count( $order->get_items() ) > 0 ) : ?> |
| 35 |
<?php foreach ( $order->get_items() as $item_id => $item ) : ?> |
| 36 |
<?php |
| 37 |
if ( ! apply_filters( 'woocommerce_order_item_visible', true, $item ) ) { |
| 38 |
continue; |
| 39 |
} |
| 40 |
?> |
| 41 |
<tr class="<?php echo esc_attr( apply_filters( 'woocommerce_order_item_class', 'order_item', $item, $order ) ); ?>"> |
| 42 |
<td class="product-name"> |
| 43 |
<?php |
| 44 |
echo wp_kses_post( apply_filters( 'woocommerce_order_item_name', $item->get_name(), $item, false ) ); |
| 45 |
|
| 46 |
do_action( 'woocommerce_order_item_meta_start', $item_id, $item, $order, false ); |
| 47 |
|
| 48 |
wc_display_item_meta( $item ); |
| 49 |
|
| 50 |
do_action( 'woocommerce_order_item_meta_end', $item_id, $item, $order, false ); |
| 51 |
?> |
| 52 |
</td> |
| 53 |
<td class="product-quantity"><?php echo apply_filters( 'woocommerce_order_item_quantity_html', ' <strong class="product-quantity">' . sprintf( '× %s', esc_html( $item->get_quantity() ) ) . '</strong>', $item ); ?></td><?php // @codingStandardsIgnoreLine ?> |
| 54 |
<td class="product-subtotal"><?php echo $order->get_formatted_line_subtotal( $item ); ?></td><?php // @codingStandardsIgnoreLine ?> |
| 55 |
</tr> |
| 56 |
<?php endforeach; ?> |
| 57 |
<?php endif; ?> |
| 58 |
</tbody> |
| 59 |
<tfoot> |
| 60 |
<?php if ( $totals ) : ?> |
| 61 |
<?php foreach ( $totals as $total ) : ?> |
| 62 |
<tr> |
| 63 |
<th scope="row" colspan="2"><?php echo $total['label']; ?></th><?php // @codingStandardsIgnoreLine ?> |
| 64 |
<td class="product-total"><?php echo $total['value']; ?></td><?php // @codingStandardsIgnoreLine ?> |
| 65 |
</tr> |
| 66 |
<?php endforeach; ?> |
| 67 |
<?php endif; ?> |
| 68 |
</tfoot> |
| 69 |
</table> |
| 70 |
|
| 71 |
<?php |
| 72 |
/** |
| 73 |
* Triggered from within the checkout/form-pay.php template, immediately before the payment section. |
| 74 |
* |
| 75 |
* @since 8.2.0 |
| 76 |
*/ |
| 77 |
do_action( 'woocommerce_pay_order_before_payment' ); |
| 78 |
?> |
| 79 |
|
| 80 |
<div id="payment"> |
| 81 |
<?php if ( $order->needs_payment() ) : ?> |
| 82 |
<ul class="wc_payment_methods payment_methods methods"> |
| 83 |
<?php |
| 84 |
if ( ! empty( $available_gateways ) ) { |
| 85 |
foreach ( $available_gateways as $gateway ) { |
| 86 |
wc_get_template( 'checkout/payment-method.php', array( 'gateway' => $gateway ) ); |
| 87 |
} |
| 88 |
} else { |
| 89 |
echo '<li>'; |
| 90 |
wc_print_notice( apply_filters( 'woocommerce_no_available_payment_methods_message', esc_html__( 'Sorry, it seems that there are no available payment methods for your location. Please contact us if you require assistance or wish to make alternate arrangements.', 'woocommerce' ) ), 'notice' ); // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingHookComment |
| 91 |
echo '</li>'; |
| 92 |
} |
| 93 |
?> |
| 94 |
</ul> |
| 95 |
<?php endif; ?> |
| 96 |
<div class="form-row"> |
| 97 |
<input type="hidden" name="woocommerce_pay" value="1" /> |
| 98 |
|
| 99 |
<?php wc_get_template( 'checkout/terms.php' ); ?> |
| 100 |
|
| 101 |
<?php do_action( 'woocommerce_pay_order_before_submit' ); ?> |
| 102 |
|
| 103 |
<?php echo apply_filters( 'woocommerce_pay_order_button_html', '<button type="submit" class="button alt' . esc_attr( wc_wp_theme_get_element_class_name( 'button' ) ? ' ' . wc_wp_theme_get_element_class_name( 'button' ) : '' ) . '" id="place_order" value="' . esc_attr( $order_button_text ) . '" data-value="' . esc_attr( $order_button_text ) . '">' . esc_html( $order_button_text ) . '</button>' ); // @codingStandardsIgnoreLine ?> |
| 104 |
|
| 105 |
<?php do_action( 'woocommerce_pay_order_after_submit' ); ?> |
| 106 |
|
| 107 |
<?php wp_nonce_field( 'woocommerce-pay', 'woocommerce-pay-nonce' ); ?> |
| 108 |
</div> |
| 109 |
</div> |
| 110 |
</form> |
| 111 |
</div> |
| 112 |
|