Skip to content

Commit

Permalink
hot fix version 1.7.14
Browse files Browse the repository at this point in the history
  • Loading branch information
reindertvetter committed Oct 17, 2016
1 parent b3e2910 commit f6d6fec
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
6 changes: 4 additions & 2 deletions app/code/community/TIG/MyParcel2014/Model/Api/MyParcel.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion app/code/community/TIG/MyParcel2014/etc/config.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?xml version="1.0"?>
<config>
<modules>
<TIG_MyParcel2014><version>1.7.12</version>
<TIG_MyParcel2014>
<version>1.7.14</version>
</TIG_MyParcel2014>
</modules>
<global>
Expand Down

0 comments on commit f6d6fec

Please sign in to comment.