cart-errors.php
6 years ago
form-billing.php
7 years ago
form-checkout.php
7 years ago
form-coupon.php
6 years ago
form-login.php
6 years ago
form-pay.php
6 years ago
form-shipping.php
7 years ago
order-receipt.php
7 years ago
payment-method.php
7 years ago
payment.php
7 years ago
review-order.php
6 years ago
terms.php
7 years ago
thankyou.php
6 years ago
form-pay.php
99 lines
| 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://docs.woocommerce.com/document/template-structure/ |
| 14 | * @package WooCommerce/Templates |
| 15 | * @version 3.4.0 |
| 16 | */ |
| 17 | |
| 18 | defined( 'ABSPATH' ) || exit; |
| 19 | |
| 20 | $totals = $order->get_order_item_totals(); // phpcs:ignore WordPress.WP.GlobalVariablesOverride.OverrideProhibited |
| 21 | ?> |
| 22 | <form id="order_review" method="post"> |
| 23 | |
| 24 | <table class="shop_table"> |
| 25 | <thead> |
| 26 | <tr> |
| 27 | <th class="product-name"><?php esc_html_e( 'Product', 'woocommerce' ); ?></th> |
| 28 | <th class="product-quantity"><?php esc_html_e( 'Qty', 'woocommerce' ); ?></th> |
| 29 | <th class="product-total"><?php esc_html_e( 'Totals', 'woocommerce' ); ?></th> |
| 30 | </tr> |
| 31 | </thead> |
| 32 | <tbody> |
| 33 | <?php if ( count( $order->get_items() ) > 0 ) : ?> |
| 34 | <?php foreach ( $order->get_items() as $item_id => $item ) : ?> |
| 35 | <?php |
| 36 | if ( ! apply_filters( 'woocommerce_order_item_visible', true, $item ) ) { |
| 37 | continue; |
| 38 | } |
| 39 | ?> |
| 40 | <tr class="<?php echo esc_attr( apply_filters( 'woocommerce_order_item_class', 'order_item', $item, $order ) ); ?>"> |
| 41 | <td class="product-name"> |
| 42 | <?php |
| 43 | echo apply_filters( 'woocommerce_order_item_name', esc_html( $item->get_name() ), $item, false ); // @codingStandardsIgnoreLine |
| 44 | |
| 45 | do_action( 'woocommerce_order_item_meta_start', $item_id, $item, $order, false ); |
| 46 | |
| 47 | wc_display_item_meta( $item ); |
| 48 | |
| 49 | do_action( 'woocommerce_order_item_meta_end', $item_id, $item, $order, false ); |
| 50 | ?> |
| 51 | </td> |
| 52 | <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 ?> |
| 53 | <td class="product-subtotal"><?php echo $order->get_formatted_line_subtotal( $item ); ?></td><?php // @codingStandardsIgnoreLine ?> |
| 54 | </tr> |
| 55 | <?php endforeach; ?> |
| 56 | <?php endif; ?> |
| 57 | </tbody> |
| 58 | <tfoot> |
| 59 | <?php if ( $totals ) : ?> |
| 60 | <?php foreach ( $totals as $total ) : ?> |
| 61 | <tr> |
| 62 | <th scope="row" colspan="2"><?php echo $total['label']; ?></th><?php // @codingStandardsIgnoreLine ?> |
| 63 | <td class="product-total"><?php echo $total['value']; ?></td><?php // @codingStandardsIgnoreLine ?> |
| 64 | </tr> |
| 65 | <?php endforeach; ?> |
| 66 | <?php endif; ?> |
| 67 | </tfoot> |
| 68 | </table> |
| 69 | |
| 70 | <div id="payment"> |
| 71 | <?php if ( $order->needs_payment() ) : ?> |
| 72 | <ul class="wc_payment_methods payment_methods methods"> |
| 73 | <?php |
| 74 | if ( ! empty( $available_gateways ) ) { |
| 75 | foreach ( $available_gateways as $gateway ) { |
| 76 | wc_get_template( 'checkout/payment-method.php', array( 'gateway' => $gateway ) ); |
| 77 | } |
| 78 | } else { |
| 79 | echo '<li class="woocommerce-notice woocommerce-notice--info woocommerce-info">' . 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' ) ) . '</li>'; // @codingStandardsIgnoreLine |
| 80 | } |
| 81 | ?> |
| 82 | </ul> |
| 83 | <?php endif; ?> |
| 84 | <div class="form-row"> |
| 85 | <input type="hidden" name="woocommerce_pay" value="1" /> |
| 86 | |
| 87 | <?php wc_get_template( 'checkout/terms.php' ); ?> |
| 88 | |
| 89 | <?php do_action( 'woocommerce_pay_order_before_submit' ); ?> |
| 90 | |
| 91 | <?php echo apply_filters( 'woocommerce_pay_order_button_html', '<button type="submit" class="button alt" id="place_order" value="' . esc_attr( $order_button_text ) . '" data-value="' . esc_attr( $order_button_text ) . '">' . esc_html( $order_button_text ) . '</button>' ); // @codingStandardsIgnoreLine ?> |
| 92 | |
| 93 | <?php do_action( 'woocommerce_pay_order_after_submit' ); ?> |
| 94 | |
| 95 | <?php wp_nonce_field( 'woocommerce-pay', 'woocommerce-pay-nonce' ); ?> |
| 96 | </div> |
| 97 | </div> |
| 98 | </form> |
| 99 |