Skip to content

Commit

Permalink
Consistant hooks for review order/cart totals - Closes woocommerce#2076.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikejolley committed Dec 29, 2012
1 parent b11b121 commit 4988e0f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
8 changes: 8 additions & 0 deletions templates/cart/totals.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,15 @@

<?php if ( $woocommerce->cart->needs_shipping() && $woocommerce->cart->show_shipping() && ( $available_methods || get_option( 'woocommerce_enable_shipping_calc' ) == 'yes' ) ) : ?>

<?php do_action( 'woocommerce_cart_totals_before_shipping' ); ?>

<tr class="shipping">
<th><?php _e( 'Shipping', 'woocommerce' ); ?></th>
<td><?php woocommerce_get_template( 'cart/shipping-methods.php', array( 'available_methods' => $available_methods ) ); ?></td>
</tr>

<?php do_action( 'woocommerce_cart_totals_after_shipping' ); ?>

<?php endif ?>

<?php foreach ( $woocommerce->cart->get_fees() as $fee ) : ?>
Expand Down Expand Up @@ -119,6 +123,8 @@

<?php endif; ?>

<?php do_action( 'woocommerce_cart_totals_before_order_total' ); ?>

<tr class="total">
<th><strong><?php _e( 'Order Total', 'woocommerce' ); ?></strong></th>
<td>
Expand All @@ -143,6 +149,8 @@
</td>
</tr>

<?php do_action( 'woocommerce_cart_totals_after_order_total' ); ?>

</tbody>
</table>

Expand Down
9 changes: 6 additions & 3 deletions templates/checkout/review-order.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@

<?php endif; ?>

<?php do_action( 'woocommerce_before_order_total' ); ?>
<?php do_action( 'woocommerce_review_order_before_order_total' ); ?>

<tr class="total">
<th><strong><?php _e( 'Order Total', 'woocommerce' ); ?></strong></th>
Expand Down Expand Up @@ -155,10 +155,13 @@
</td>
</tr>

<?php do_action( 'woocommerce_after_order_total' ); ?>
<?php do_action( 'woocommerce_review_order_after_order_total' ); ?>

</tfoot>
<tbody>
<?php
do_action( 'woocommerce_review_order_before_cart_contents' );

if (sizeof($woocommerce->cart->get_cart())>0) :
foreach ($woocommerce->cart->get_cart() as $item_id => $values) :
$_product = $values['data'];
Expand All @@ -172,7 +175,7 @@
endforeach;
endif;

do_action( 'woocommerce_cart_contents_review_order' );
do_action( 'woocommerce_review_order_after_cart_contents' );
?>
</tbody>
</table>
Expand Down

0 comments on commit 4988e0f

Please sign in to comment.