diff --git a/admin/writepanels/writepanel-order_data.php b/admin/writepanels/writepanel-order_data.php index 79252e856fe..2c9628e5362 100644 --- a/admin/writepanels/writepanel-order_data.php +++ b/admin/writepanels/writepanel-order_data.php @@ -290,7 +290,7 @@ function woocommerce_order_items_meta_box($post) { - + @@ -303,7 +303,7 @@ function woocommerce_order_items_meta_box($post) {

- '.__('Choose an item…', 'woothemes').''; @@ -502,7 +502,7 @@ function woocommerce_process_shop_order_meta( $post_id, $post ) { if (!isset($item_cost[$i])) continue; if (!isset($item_tax_rate[$i])) continue; - $ex_tax = woocommerce_clean($item_cost[$i]) / ((woocommerce_clean($item_tax_rate[$i])/100)+1); + //$ex_tax = woocommerce_clean($item_cost[$i]) / (($item_tax_rate[$i]/100)+1); $order_items[] = apply_filters('update_order_item', array( 'id' => htmlspecialchars(stripslashes($item_id[$i])), @@ -510,7 +510,6 @@ function woocommerce_process_shop_order_meta( $post_id, $post ) { 'name' => htmlspecialchars(stripslashes($item_name[$i])), 'qty' => (int) $item_quantity[$i], 'cost' => number_format(woocommerce_clean($item_cost[$i]), 2, '.', ''), - 'cost_ex_tax' => number_format(woocommerce_clean($ex_tax[$i]), 2, '.', ''), 'taxrate' => number_format(woocommerce_clean($item_tax_rate[$i]), 4, '.', ''), )); diff --git a/assets/js/write-panels.js b/assets/js/write-panels.js index d56a7ba4e66..268ddee1eaf 100644 --- a/assets/js/write-panels.js +++ b/assets/js/write-panels.js @@ -58,9 +58,9 @@ jQuery( function($){ if (itemTax && itemTax>0) { - taxRate = itemTax/100 + 1; + taxRate = itemTax/100; - itemTaxAmount = ((itemCost - (itemCost / taxRate)) * 100 ); + itemTaxAmount = ((itemCost * taxRate) * 100 ); itemTaxAmount = itemTaxAmount.toFixed(2); @@ -76,7 +76,7 @@ jQuery( function($){ } } - subtotal = itemTotal - tax; + subtotal = itemTotal; total = parseFloat(subtotal) + parseFloat(tax) - parseFloat(discount) + parseFloat(shipping) + parseFloat(shipping_tax); @@ -93,7 +93,7 @@ jQuery( function($){ jQuery('button.add_shop_order_item').click(function(){ - var item_id = jQuery('select.item_id').val(); + var item_id = jQuery('select.add_item_id').val(); if (item_id) { @@ -101,7 +101,7 @@ jQuery( function($){ var data = { action: 'woocommerce_add_order_item', - item_to_add: jQuery('select.item_id').val(), + item_to_add: jQuery('select.add_item_id').val(), security: params.add_order_item_nonce }; @@ -109,12 +109,12 @@ jQuery( function($){ jQuery('table.woocommerce_order_items tbody#order_items_list').append( response ); jQuery('table.woocommerce_order_items').unblock(); - jQuery('select.item_id').css('border-color', '').val(''); + jQuery('select.add_item_id').css('border-color', '').val(''); }); } else { - jQuery('select.item_id').css('border-color', 'red'); + jQuery('select.add_item_id').css('border-color', 'red'); } }); diff --git a/classes/checkout.class.php b/classes/checkout.class.php index 1bb76c9a050..6a758ea6d96 100644 --- a/classes/checkout.class.php +++ b/classes/checkout.class.php @@ -544,8 +544,7 @@ class woocommerce_checkout { 'variation_id' => $values['variation_id'], 'name' => $_product->get_title(), 'qty' => (int) $values['quantity'], - 'cost' => $_product->get_price(), - 'cost_ex_tax' => $_product->get_price_excluding_tax(), + 'cost' => $_product->get_price_excluding_tax(), 'taxrate' => $rate )); diff --git a/classes/order.class.php b/classes/order.class.php index a8d04f6538a..ca29c9a5fbd 100644 --- a/classes/order.class.php +++ b/classes/order.class.php @@ -192,7 +192,7 @@ class woocommerce_order { endif; - $return .= ' - ' . strip_tags(woocommerce_price( $item['cost_ex_tax']*$item['qty'], array('ex_tax_label' => 1 ))); + $return .= ' - ' . strip_tags(woocommerce_price( $item['cost']*$item['qty'], array('ex_tax_label' => 1 ))); if (isset($_product->variation_data)) : $return .= PHP_EOL . woocommerce_get_formatted_variation( $_product->variation_data, true ); diff --git a/shortcodes/shortcode-my_account.php b/shortcodes/shortcode-my_account.php index 44b9ccecdb4..840d603880b 100644 --- a/shortcodes/shortcode-my_account.php +++ b/shortcodes/shortcode-my_account.php @@ -508,7 +508,7 @@ function woocommerce_view_order() { echo ' '.$item['qty'].' - '.woocommerce_price( $item['cost_ex_tax']*$item['qty'], array('ex_tax_label' => 1) ).' + '.woocommerce_price( $item['cost']*$item['qty'], array('ex_tax_label' => 1) ).' '; endforeach; endif;