</div><!--#info-settlement-box--> <?php } ?> </div><!--#order-information--> <?php do_action('wc2_action_admin_order_postbox_container2_4', $data, $this->mode); ?> <div id="order-cart" class="postbox"> <h3><span><?php _e('明細', 'wc2'); ?> </span></h3> <div class="inside"> <?php $cart_items = wc2_get_admin_order_cart_row($order_id, $cart); ob_start(); ?> <table id="order-cart-table"> <thead> <tr> <th scope="row" class="num"><?php _e('No.', 'wc2'); ?> </th> <th class="thumbnail"></th> <th class="name"><?php _e('Items', 'wc2'); ?> </th> <th class="price"><?php
function order_edit_ajax() { //wc2_log(print_r($_POST,true),"test.log"); if ($_POST['action'] != 'order_edit_ajax') { die(0); } $res = false; $_POST = WC2_Utils::stripslashes_deep_post($_POST); switch ($_POST['mode']) { case 'add2cart': $slug = apply_filters('wc2_filter_cart_slug', 'cart'); $general_options = wc2_get_option('general'); $add_cart = array(); $item_id = isset($_POST['item_id']) ? $_POST['item_id'] : 0; $sku_id = isset($_POST['sku_id']) ? $_POST['sku_id'] : 0; $quantity = isset($_POST['quantity']) ? $_POST['quantity'] : 1; $cart_row = isset($_POST['cart_row']) ? $_POST['cart_row'] : 1; $item_sku_data = wc2_get_item_sku_data($item_id, $sku_id); $price = $item_sku_data['sku_price']; $price = apply_filters('wc2_filter_admin_order_add2cart_price', $price, $quantity, $item_id, $sku_id, $slug); if (empty($general_options['tax_rate'])) { $tax = 0; } else { $materials = array('total_price' => $price * $quantity, 'discount' => 0, 'shipping_charge' => 0, 'cod_fee' => 0); $tax = wc2_internal_tax($materials); } $add_cart['group_id'] = 0; $add_cart['row_index'] = $cart_row; $add_cart['post_id'] = $item_sku_data['item_post_id']; $add_cart['item_id'] = $item_id; $add_cart['item_code'] = $item_sku_data['item_code']; $add_cart['item_name'] = $item_sku_data['item_name']; $add_cart['sku_id'] = $sku_id; $add_cart['sku_code'] = $item_sku_data['sku_code']; $add_cart['sku_name'] = $item_sku_data['sku_name']; $add_cart['price'] = $price; $add_cart['cprice'] = $item_sku_data['sku_costprice']; $add_cart['quantity'] = $quantity; $add_cart['unit'] = $item_sku_data['sku_unit']; $add_cart['tax'] = $tax; $add_cart['destination_id'] = 0; $add_cart['meta_type'] = apply_filters('wc2_filter_admin_order_add2cart_meta_type', array(), $quantity, $item_id, $sku_id, $slug); $add_cart['meta_key'] = apply_filters('wc2_filter_admin_order_add2cart_meta_key', array(), $quantity, $item_id, $sku_id, $slug); $add_cart = apply_filters('wc2_filter_admin_order_add2cart', $add_cart, $slug); $res = wc2_add_order_cart_data($_POST['order_id'], $add_cart); if (!$res) { die($res); } $cart = wc2_get_order_cart_data($_POST['order_id']); //*** LI CUSTOMIZE >>> //$res = wc2_get_admin_order_cart_row( $_POST['order_id'], $cart ); $cart_row = wc2_get_admin_order_cart_row($_POST['order_id'], $cart); $order_history_form = li_get_order_history_form($_POST['order_id']); $res = 'OK' . WC2_SPLIT . $cart_row . WC2_SPLIT . $order_history_form; $shipping_charge = li_get_delivery_shipping_charge($_POST['delivery_method'], $_POST['delivery_pref'], $cart); $order_modified = wc2_get_today_datetime_format(); $update_query = " shipping_charge = " . $shipping_charge . ", order_modified = '" . $order_modified . "'"; wc2_update_order_data_value($_POST['order_id'], $update_query); //*** LI CUSTOMIZE <<< break; case 'cart_remove': $res = wc2_remove_order_cart_data($_POST['order_id'], $_POST['cart_id']); if (!$res) { die($res); } $cart = wc2_get_order_cart_data($_POST['order_id']); //*** LI CUSTOMIZE >>> //$res = wc2_get_admin_order_cart_row( $_POST['order_id'], $cart ); $cart_row = wc2_get_admin_order_cart_row($_POST['order_id'], $cart); $order_history_form = li_get_order_history_form($_POST['order_id']); $res = 'OK' . WC2_SPLIT . $cart_row . WC2_SPLIT . $order_history_form; $shipping_charge = li_get_delivery_shipping_charge($_POST['delivery_method'], $_POST['delivery_pref'], $cart); $order_modified = wc2_get_today_datetime_format(); $update_query = " shipping_charge = " . $shipping_charge . ", order_modified = '" . $order_modified . "'"; wc2_update_order_data_value($_POST['order_id'], $update_query); //*** LI CUSTOMIZE <<< break; case 'mail_completion': case 'mail_order': case 'mail_change': case 'mail_receipt': case 'mail_estimate': case 'mail_cancel': case 'mail_other': $res = wc2_ordermail_admin($_POST['order_id']); break; case 'sendmail': $res = wc2_send_ordermail_admin(); break; case 'get_add_item': $res = wc2_get_add_item($_POST['item_code']); break; case 'get_select_item': $res = wc2_get_select_item($_POST['cat_id']); break; case 'checkpost': $res = wc2_update_order_check($_POST['order_id'], $_POST['checked']); break; case 'get_member': $res = wc2_get_member_neworder($_POST['email']); break; case 'recalculation': $res = wc2_order_recalculation($_POST['order_id'], $_POST['member_id'], $_POST['item_ids'], $_POST['skus'], $_POST['prices'], $_POST['quantities'], $_POST['usedpoint'], $_POST['shipping_charge'], $_POST['cod_fee']); break; } $res = apply_filters('wc2_filter_admin_order_edit_ajax', $res); //wc2_log($res,"test.log"); die($res); }