Skip to content

Commit

Permalink
fix api data
Browse files Browse the repository at this point in the history
  • Loading branch information
timoj committed Mar 27, 2018
1 parent 1d5e113 commit 6ccb8f1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions includes/wcwuunder-create.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ private function buildWuunderData($orderId)
}
if (count($dimensions) !== 3) {
$dimensions = array($defLength, $defWidth, $defHeight);
} else {
$dimensions = array();
}

$value = intval($order->get_subtotal() * 100);
Expand Down Expand Up @@ -114,7 +112,10 @@ public function generateBookingUrl()
if (isset($_REQUEST['order']) && $_REQUEST['action'] === "bookorder") {
$order_id = $_REQUEST['order'];
if (true) {
$postData = stripslashes_deep($_POST['data']);
$postData = array();
if (isset($_POST['data']))
$postData = stripslashes_deep($_POST['data']);

$bookingToken = uniqid();
update_post_meta($order_id, '_wuunder_label_booking_token', $bookingToken);

Expand Down Expand Up @@ -498,7 +499,7 @@ public function get_order_items($order_id)
$data['total_weight'] = $data['quantity'] * $data['weight'];

// Set item dimensions
$data['dimensions'] = $product->get_dimensions();
$data['dimensions'] = wc_format_dimensions($product->get_dimensions(false));

$data_list['products'][] = $data;
}
Expand Down

0 comments on commit 6ccb8f1

Please sign in to comment.