From f6d6fec5aabe382d09ee131d4b7d134bc1bc1fc7 Mon Sep 17 00:00:00 2001 From: reindertvetter Date: Mon, 17 Oct 2016 15:24:20 +0200 Subject: [PATCH] hot fix version 1.7.14 --- .../community/TIG/MyParcel2014/Model/Api/MyParcel.php | 6 ++++-- .../TIG/MyParcel2014/Model/Observer/SavePgAddress.php | 8 ++++++-- app/code/community/TIG/MyParcel2014/etc/config.xml | 3 ++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/app/code/community/TIG/MyParcel2014/Model/Api/MyParcel.php b/app/code/community/TIG/MyParcel2014/Model/Api/MyParcel.php index 4e445d0e..9998a0a4 100755 --- a/app/code/community/TIG/MyParcel2014/Model/Api/MyParcel.php +++ b/app/code/community/TIG/MyParcel2014/Model/Api/MyParcel.php @@ -537,7 +537,6 @@ protected function _getConsignmentData(TIG_MyParcel2014_Model_Shipment $myParcel $shippingAddress = $myParcelShipment->getShippingAddress(); $streetData = $helper->getStreetData($shippingAddress); $email = $myParcelShipment->getOrder()->getCustomerEmail(); - $phone = $order->getBillingAddress()->getTelephone(); $data = array( 'recipient' => array( @@ -550,12 +549,15 @@ protected function _getConsignmentData(TIG_MyParcel2014_Model_Shipment $myParcel 'number_suffix' => trim($streetData['housenumberExtension']), 'city' => trim($shippingAddress->getCity()), 'email' => $email, - 'phone' => $phone, ), 'options' => $this->_getOptionsData($myParcelShipment), ); if ($myParcelShipment->getShippingAddress()->getCountry() != 'NL') { + $phone = $order->getBillingAddress()->getTelephone(); + if ($phone) + $data['recipient']['phone'] = $phone; + $data['recipient']['street'] = trim(str_replace(' ', ' ', implode(' ', $streetData))); unset($data['recipient']['number']); unset($data['recipient']['number_suffix']); diff --git a/app/code/community/TIG/MyParcel2014/Model/Observer/SavePgAddress.php b/app/code/community/TIG/MyParcel2014/Model/Observer/SavePgAddress.php index b77ea733..7e303590 100755 --- a/app/code/community/TIG/MyParcel2014/Model/Observer/SavePgAddress.php +++ b/app/code/community/TIG/MyParcel2014/Model/Observer/SavePgAddress.php @@ -92,10 +92,14 @@ public function copyAddressToOrder(Varien_Event_Observer $observer) return $this; } - $price = $helper->calculatePrice(); $address = $quote->getShippingAddress(); - $extraShippingPrice = $price - (float)$address->getBaseShippingInclTax(); + if (strpos($address->getShippingMethod(), 'myparcel') !== false) { + $price = $helper->calculatePrice(); + $extraShippingPrice = $price - (float)$address->getBaseShippingInclTax(); + } else { + $extraShippingPrice = 0; + } $address->setShippingAmount($address->getShippingAmount() + $extraShippingPrice); $address->setBaseShippingAmount($address->getBaseShippingAmount() + $extraShippingPrice); diff --git a/app/code/community/TIG/MyParcel2014/etc/config.xml b/app/code/community/TIG/MyParcel2014/etc/config.xml index bc56318f..9ea9fe77 100755 --- a/app/code/community/TIG/MyParcel2014/etc/config.xml +++ b/app/code/community/TIG/MyParcel2014/etc/config.xml @@ -1,7 +1,8 @@ - 1.7.12 + + 1.7.14