cart-totals.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <?php
  2. /**
  3. * Cart totals
  4. *
  5. * @author WooThemes
  6. * @package WooCommerce/Templates
  7. * @version 2.3.6
  8. */
  9. if ( ! defined( 'ABSPATH' ) ) {
  10. exit;
  11. }
  12. ?>
  13. <div class="cart_totals <?php if ( WC()->customer->has_calculated_shipping() ) echo 'calculated_shipping'; ?>">
  14. <?php do_action( 'woocommerce_before_cart_totals' ); ?>
  15. <h2><?php esc_html_e( 'Cart totals', 'vamtam-consulting' ); ?></h2>
  16. <table cellspacing="0">
  17. <tr class="cart-subtotal">
  18. <th><?php esc_html_e( 'Subtotal', 'vamtam-consulting' ); ?></th>
  19. <td><?php wc_cart_totals_subtotal_html(); ?></td>
  20. </tr>
  21. <?php foreach ( WC()->cart->get_coupons() as $code => $coupon ) : ?>
  22. <tr class="cart-discount coupon-<?php echo esc_attr( $code ); ?>">
  23. <th><?php wc_cart_totals_coupon_label( $coupon ); ?></th>
  24. <td><?php wc_cart_totals_coupon_html( $coupon ); ?></td>
  25. </tr>
  26. <?php endforeach; ?>
  27. <?php if ( WC()->cart->needs_shipping() && WC()->cart->show_shipping() ) : ?>
  28. <?php do_action( 'woocommerce_cart_totals_before_shipping' ); ?>
  29. <?php wc_cart_totals_shipping_html(); ?>
  30. <?php do_action( 'woocommerce_cart_totals_after_shipping' ); ?>
  31. <?php elseif ( WC()->cart->needs_shipping() ) : ?>
  32. <tr class="shipping">
  33. <th><?php esc_html_e( 'Shipping', 'vamtam-consulting' ); ?></th>
  34. <td><?php woocommerce_shipping_calculator(); ?></td>
  35. </tr>
  36. <?php endif; ?>
  37. <?php foreach ( WC()->cart->get_fees() as $fee ) : ?>
  38. <tr class="fee">
  39. <th><?php echo esc_html( $fee->name ); ?></th>
  40. <td><?php wc_cart_totals_fee_html( $fee ); ?></td>
  41. </tr>
  42. <?php endforeach; ?>
  43. <?php if ( WC()->cart->tax_display_cart == 'excl' ) : ?>
  44. <?php if ( get_option( 'woocommerce_tax_total_display' ) == 'itemized' ) : ?>
  45. <?php foreach ( WC()->cart->get_tax_totals() as $code => $tax ) : ?>
  46. <tr class="tax-rate tax-rate-<?php echo esc_attr( sanitize_title( $code ) ); ?>">
  47. <th><?php echo esc_html( $tax->label ); ?></th>
  48. <td><?php echo wp_kses_post( $tax->formatted_amount ); ?></td>
  49. </tr>
  50. <?php endforeach; ?>
  51. <?php else : ?>
  52. <tr class="tax-total">
  53. <th><?php echo esc_html( WC()->countries->tax_or_vat() ); ?></th>
  54. <td><?php echo wc_cart_totals_taxes_total_html(); // xss ok ?></td>
  55. </tr>
  56. <?php endif; ?>
  57. <?php endif; ?>
  58. <?php do_action( 'woocommerce_cart_totals_before_order_total' ); ?>
  59. <tr class="order-total">
  60. <th><?php esc_html_e( 'Total', 'vamtam-consulting' ); ?></th>
  61. <td><?php wc_cart_totals_order_total_html(); ?></td>
  62. </tr>
  63. <?php do_action( 'woocommerce_cart_totals_after_order_total' ); ?>
  64. </table>
  65. <div class="wc-proceed-to-checkout">
  66. <input type="submit" class="button" name="update_cart" value="<?php esc_attr_e( 'Update cart', 'vamtam-consulting' ); ?>" />
  67. <?php do_action( 'woocommerce_proceed_to_checkout' ); ?>
  68. </div>
  69. <?php do_action( 'woocommerce_after_cart_totals' ); ?>
  70. </div>