Fixed order tax saving and dupe key generation

This commit is contained in:
Mike Jolley 2012-02-29 21:05:55 +00:00
parent 1630a4edd4
commit 064685064e
4 changed files with 5 additions and 4 deletions

View File

@ -621,7 +621,7 @@ function woocommerce_process_shop_order_meta( $post_id, $post ) {
$woocommerce_errors = array();
// Add key
add_post_meta( $post_id, '_order_key', uniqid('order_') );
add_post_meta( $post_id, '_order_key', uniqid('order_'), true );
// Update post data
update_post_meta( $post_id, '_billing_first_name', stripslashes( $_POST['_billing_first_name'] ));
@ -685,7 +685,7 @@ function woocommerce_process_shop_order_meta( $post_id, $post ) {
endif;
update_post_meta( $post_id, '_order_taxes', $order_taxes );
// Order items
$order_items = array();

View File

@ -274,5 +274,4 @@ function woocommerce_order_downloads_save( $post_id, $post ) {
endif;
update_post_meta( $post_id, '_order_taxes', $order_taxes );
}

View File

@ -86,7 +86,7 @@ jQuery( function($){
};
$.post( woocommerce_writepanel_params.ajax_url, data, function(response) {
result = jQuery.parseJSON( response );
$row.find('input.line_subtotal_tax').val( result.line_subtotal_tax );
$row.find('input.line_tax').val( result.line_tax );

View File

@ -733,6 +733,8 @@ function woocommerce_calc_line_taxes() {
$item_id = esc_attr($_POST['item_id']);
$tax_class = esc_attr($_POST['tax_class']);
if (!$item_id) return;
// Get product details
$_product = new WC_Product($item_id);
$item_tax_status = $_product->get_tax_status();