From fb4395c9820b185407530da7feebc26d3048e990 Mon Sep 17 00:00:00 2001 From: Mittows Date: Tue, 1 Oct 2019 16:56:42 +0200 Subject: [PATCH 1/4] fixed line ending fixed incorrect order value --- includes/wcwuunder-create.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/includes/wcwuunder-create.php b/includes/wcwuunder-create.php index afd80d4..50d504f 100644 --- a/includes/wcwuunder-create.php +++ b/includes/wcwuunder-create.php @@ -61,7 +61,7 @@ public function wcwp_sample_admin_notice__error() { */ private function wcwp_setBookingConfig($orderId ) { wcwp_log( 'info', 'Filling the booking config' ); - + $orderItems = $this->wcwp_get_order_items( $orderId ); $order = new WC_Order( $orderId ); @@ -101,14 +101,15 @@ private function wcwp_setBookingConfig($orderId ) { foreach ( $orderItems['products'] as $item ) { $totalWeight += $item['total_weight']; - $description .= '- ' . $item['quantity'] . 'x ' . $item['name'] . ' \r\n'; + $description .= '- ' . $item['quantity'] . 'x ' . $item['name'] . ' +'; } if ( 3 !== count( $dimensions ) ) { $dimensions = array( null, null, null ); } - $value = intval( $order->get_subtotal() * 100 ); + $value = intval( $order->get_total() * 100 ); $bookingToken = uniqid(); update_post_meta( $orderId, '_wuunder_label_booking_token', $bookingToken ); @@ -447,7 +448,7 @@ public function wcwp_add_listing_actions($order ) { $target = ' target="_blank" '; ?> href=" " class=" button tips " style="background:#8dcc00; height:2em; width:2em; padding:3px;" alt="" data-tip=""> <?php echo $data['title']; ?> From fbd96edf6103d4b86f363f50bdc188123bca04f8 Mon Sep 17 00:00:00 2001 From: Timo Janssen Date: Wed, 2 Oct 2019 09:42:01 +0200 Subject: [PATCH 2/4] fix newlines --- includes/wcwuunder-create.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/includes/wcwuunder-create.php b/includes/wcwuunder-create.php index 50d504f..4191a0e 100644 --- a/includes/wcwuunder-create.php +++ b/includes/wcwuunder-create.php @@ -101,8 +101,7 @@ private function wcwp_setBookingConfig($orderId ) { foreach ( $orderItems['products'] as $item ) { $totalWeight += $item['total_weight']; - $description .= '- ' . $item['quantity'] . 'x ' . $item['name'] . ' -'; + $description .= '- ' . $item['quantity'] . 'x ' . $item['name'] . "\r\n"; } if ( 3 !== count( $dimensions ) ) { From 4da5445320e4f899970e0343b35a94d0aba369f1 Mon Sep 17 00:00:00 2001 From: Mittows Date: Wed, 2 Oct 2019 13:56:40 +0200 Subject: [PATCH 3/4] Fixed order value --- includes/wcwuunder-create.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/wcwuunder-create.php b/includes/wcwuunder-create.php index 4191a0e..931d697 100644 --- a/includes/wcwuunder-create.php +++ b/includes/wcwuunder-create.php @@ -108,7 +108,7 @@ private function wcwp_setBookingConfig($orderId ) { $dimensions = array( null, null, null ); } - $value = intval( $order->get_total() * 100 ); + $value = intval(($order->get_total() + $order->get_total_discount() - $order->get_shipping_total()) * 100); $bookingToken = uniqid(); update_post_meta( $orderId, '_wuunder_label_booking_token', $bookingToken ); From c16422b516f2cb51919e5a9a214eabf3e701cddb Mon Sep 17 00:00:00 2001 From: TimD <45198517+Mittows@users.noreply.github.com> Date: Wed, 2 Oct 2019 14:01:35 +0200 Subject: [PATCH 4/4] Update CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5210917..d2105c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/). ### Fixed - Parcelshop locator wuunder production settings +- Order value +- Line ending description ## [2.7.4](https://github.com/kabisa/wuunder-webshopplugin-woocommerce/tag/2.7.4) - 2019-09-27