/templates/checkout/review-order.php

  1. <?php 
  2. /** 
  3. * Review order table 
  4. * 
  5. * This template can be overridden by copying it to yourtheme/woocommerce/checkout/review-order.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. * @author WooThemes 
  15. * @package WooCommerce/Templates 
  16. * @version 2.3.0 
  17. */ 
  18.  
  19. if ( ! defined( 'ABSPATH' ) ) { 
  20. exit; 
  21. ?> 
  22. <table class="shop_table woocommerce-checkout-review-order-table"> 
  23. <thead> 
  24. <tr> 
  25. <th class="product-name"><?php _e( 'Product', 'woocommerce' ); ?></th> 
  26. <th class="product-total"><?php _e( 'Total', 'woocommerce' ); ?></th> 
  27. </tr> 
  28. </thead> 
  29. <tbody> 
  30. <?php 
  31. do_action( 'woocommerce_review_order_before_cart_contents' ); 
  32.  
  33. foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) { 
  34. $_product = apply_filters( 'woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key ); 
  35.  
  36. if ( $_product && $_product->exists() && $cart_item['quantity'] > 0 && apply_filters( 'woocommerce_checkout_cart_item_visible', true, $cart_item, $cart_item_key ) ) { 
  37. ?> 
  38. <tr class="<?php echo esc_attr( apply_filters( 'woocommerce_cart_item_class', 'cart_item', $cart_item, $cart_item_key ) ); ?>"> 
  39. <td class="product-name"> 
  40. <?php echo apply_filters( 'woocommerce_cart_item_name', $_product->get_name(), $cart_item, $cart_item_key ) . ' '; ?> 
  41. <?php echo apply_filters( 'woocommerce_checkout_cart_item_quantity', ' <strong class="product-quantity">' . sprintf( '× %s', $cart_item['quantity'] ) . '</strong>', $cart_item, $cart_item_key ); ?> 
  42. <?php echo WC()->cart->get_item_data( $cart_item ); ?> 
  43. </td> 
  44. <td class="product-total"> 
  45. <?php echo apply_filters( 'woocommerce_cart_item_subtotal', WC()->cart->get_product_subtotal( $_product, $cart_item['quantity'] ), $cart_item, $cart_item_key ); ?> 
  46. </td> 
  47. </tr> 
  48. <?php 
  49.  
  50. do_action( 'woocommerce_review_order_after_cart_contents' ); 
  51. ?> 
  52. </tbody> 
  53. <tfoot> 
  54.  
  55. <tr class="cart-subtotal"> 
  56. <th><?php _e( 'Subtotal', 'woocommerce' ); ?></th> 
  57. <td><?php wc_cart_totals_subtotal_html(); ?></td> 
  58. </tr> 
  59.  
  60. <?php foreach ( WC()->cart->get_coupons() as $code => $coupon ) : ?> 
  61. <tr class="cart-discount coupon-<?php echo esc_attr( sanitize_title( $code ) ); ?>"> 
  62. <th><?php wc_cart_totals_coupon_label( $coupon ); ?></th> 
  63. <td><?php wc_cart_totals_coupon_html( $coupon ); ?></td> 
  64. </tr> 
  65. <?php endforeach; ?> 
  66.  
  67. <?php if ( WC()->cart->needs_shipping() && WC()->cart->show_shipping() ) : ?> 
  68.  
  69. <?php do_action( 'woocommerce_review_order_before_shipping' ); ?> 
  70.  
  71. <?php wc_cart_totals_shipping_html(); ?> 
  72.  
  73. <?php do_action( 'woocommerce_review_order_after_shipping' ); ?> 
  74.  
  75. <?php endif; ?> 
  76.  
  77. <?php foreach ( WC()->cart->get_fees() as $fee ) : ?> 
  78. <tr class="fee"> 
  79. <th><?php echo esc_html( $fee->name ); ?></th> 
  80. <td><?php wc_cart_totals_fee_html( $fee ); ?></td> 
  81. </tr> 
  82. <?php endforeach; ?> 
  83.  
  84. <?php if ( wc_tax_enabled() && 'excl' === WC()->cart->tax_display_cart ) : ?> 
  85. <?php if ( 'itemized' === get_option( 'woocommerce_tax_total_display' ) ) : ?> 
  86. <?php foreach ( WC()->cart->get_tax_totals() as $code => $tax ) : ?> 
  87. <tr class="tax-rate tax-rate-<?php echo sanitize_title( $code ); ?>"> 
  88. <th><?php echo esc_html( $tax->label ); ?></th> 
  89. <td><?php echo wp_kses_post( $tax->formatted_amount ); ?></td> 
  90. </tr> 
  91. <?php endforeach; ?> 
  92. <?php else : ?> 
  93. <tr class="tax-total"> 
  94. <th><?php echo esc_html( WC()->countries->tax_or_vat() ); ?></th> 
  95. <td><?php wc_cart_totals_taxes_total_html(); ?></td> 
  96. </tr> 
  97. <?php endif; ?> 
  98. <?php endif; ?> 
  99.  
  100. <?php do_action( 'woocommerce_review_order_before_order_total' ); ?> 
  101.  
  102. <tr class="order-total"> 
  103. <th><?php _e( 'Total', 'woocommerce' ); ?></th> 
  104. <td><?php wc_cart_totals_order_total_html(); ?></td> 
  105. </tr> 
  106.  
  107. <?php do_action( 'woocommerce_review_order_after_order_total' ); ?> 
  108.  
  109. </tfoot> 
  110. </table> 
.