added tiptip for order totals

This commit is contained in:
claudiosmweb 2014-07-18 20:27:10 -03:00
parent e0aeacb734
commit 794548e923
3 changed files with 22 additions and 16 deletions

View File

@ -21,6 +21,20 @@ jQuery( function ( $ ) {
$( '#woocommerce-order-items' ).unblock();
}
/**
* Run TipTip
*/
function runTipTip() {
$( '#tiptip_holder' ).removeAttr( 'style' );
$( '#tiptip_arrow' ).removeAttr( 'style' );
$( '.tips' ).tipTip({
'attribute': 'data-tip',
'fadeIn': 50,
'fadeOut': 50,
'delay': 200
});
}
/**
* Load order items
*
@ -42,6 +56,7 @@ jQuery( function ( $ ) {
success: function( response ) {
$( '#woocommerce-order-items .inside' ).empty();
$( '#woocommerce-order-items .inside' ).append( response );
runTipTip();
removeOrderItemsLoading();
}
});
@ -541,6 +556,7 @@ jQuery( function ( $ ) {
success: function( response ) {
$( '#woocommerce-order-items .inside' ).empty();
$( '#woocommerce-order-items .inside' ).append( response );
runTipTip();
removeOrderItemsLoading();
}
});
@ -744,16 +760,7 @@ jQuery( function ( $ ) {
if ( !--count ) {
$( 'select#add_item_id, #add_item_id_chosen .chosen-choices' ).css( 'border-color', '' ).val( '' );
$( '#tiptip_holder' ).removeAttr( 'style' );
$( '#tiptip_arrow' ).removeAttr( 'style' );
$( '.tips' ).tipTip({
'attribute': 'data-tip',
'fadeIn': 50,
'fadeOut': 50,
'delay': 200
});
runTipTip();
$( 'select#add_item_id' ).trigger( 'chosen:updated' );
removeOrderItemsLoading();
}

File diff suppressed because one or more lines are too long

View File

@ -71,19 +71,19 @@ if ( ! defined( 'ABSPATH' ) ) {
<div class="wc-order-data-row wc-order-totals-items wc-order-items-editable">
<table class="wc-order-totals">
<tr>
<td class="label"><?php _e( 'Shipping', 'woocommerce' ); ?>:</td>
<td class="label"><?php _e( 'Shipping', 'woocommerce' ); ?> <span class="tips" data-tip="<?php _e( 'This is the shipping and handling total costs for the order.', 'woocommerce' ); ?>">[?]</span>:</td>
<td class="total"><?php echo wc_price( $order->get_total_shipping() ); ?></td>
<td width="1%"></td>
</tr>
<?php if ( 'yes' == get_option( 'woocommerce_calc_taxes' ) ) : ?>
<tr>
<td class="label"><?php _e( 'Taxes', 'woocommerce' ); ?>:</td>
<td class="label"><?php _e( 'Taxes', 'woocommerce' ); ?> <span class="tips" data-tip="<?php _e( 'This is the total taxes for this order.', 'woocommerce' ); ?>">[?]</span>:</td>
<td class="total"><?php echo wc_price( $order->get_total_tax() ); ?></td>
<td width="1%"></td>
</tr>
<?php endif; ?>
<tr>
<td class="label"><?php _e( 'Order Discount', 'woocommerce' ); ?>:</td>
<td class="label"><?php _e( 'Order Discount', 'woocommerce' ); ?> <span class="tips" data-tip="<?php _e( 'This is the total discount applied after tax.', 'woocommerce' ); ?>">[?]</span>:</td>
<td class="total">
<div class="view"><?php echo wc_price( $order->get_total_discount() ); ?></div>
<div class="edit" style="display: none;">
@ -139,9 +139,8 @@ if ( ! defined( 'ABSPATH' ) ) {
<button type="button" class="button add-order-shipping"><?php _e( 'Add shipping cost', 'woocommerce' ); ?></button>
<button type="button" class="button cancel-action"><?php _e( 'Cancel', 'woocommerce' ); ?></button>
<button type="button" class="button button-primary save-action"><?php _e( 'Save', 'woocommerce' ); ?></button>
<button type="button" class="button button-primary calculate-action"><?php _e( 'Calculate Total and Save', 'woocommerce' ); ?></button>
</div>
<div class="wc-order-data-row wc-order-refund-items" style="display:none;">
<div class="wc-order-data-row wc-order-refund-items" style="display: none;">
<table class="wc-order-totals">
<tr>
<td class="label"><label for="restock_refunded_items"><?php _e( 'Restock refunded items', 'woocommerce' ); ?>:</label></td>