A Pair of Useful Shipping Related Actions

This commit is contained in:
justinstern 2013-12-30 18:59:09 -05:00
parent ee6c7c6d4c
commit 9a2b801e7b
2 changed files with 3 additions and 1 deletions

View File

@ -38,6 +38,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
<p class="last">
<input type="text" class="shipping_cost wc_input_price" name="shipping_cost[<?php echo $item_id ? $item_id : 'new][]'; ?>]" placeholder="<?php echo wc_format_localized_price( 0 ); ?>" value="<?php echo esc_attr( wc_format_localized_price( $shipping_cost ) ); ?>" />
</p>
<?php do_action( 'woocommerce_admin_order_totals_after_shipping_item', $item_id ); ?>
<a href="#" class="delete_total_row">&times;</a>
<div class="clear"></div>
</div>
</div>

View File

@ -320,6 +320,7 @@ class WC_Checkout {
if ( $item_id ) {
wc_add_order_item_meta( $item_id, 'method_id', $method->id );
wc_add_order_item_meta( $item_id, 'cost', wc_format_decimal( $method->cost ) );
do_action( 'woocommerce_add_shipping_order_item', $order_id, $item_id, $i );
}
}
}