Fixed order tax saving and dupe key generation
This commit is contained in:
parent
1630a4edd4
commit
064685064e
|
@ -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'] ));
|
||||
|
|
|
@ -274,5 +274,4 @@ function woocommerce_order_downloads_save( $post_id, $post ) {
|
|||
|
||||
endif;
|
||||
|
||||
update_post_meta( $post_id, '_order_taxes', $order_taxes );
|
||||
}
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue