Skip to content

Commit c7221d0

Browse files
committed
MAGETWO-35141: Sequence component pull request processing
1 parent 5a6f82a commit c7221d0

File tree

7 files changed

+56
-14
lines changed

7 files changed

+56
-14
lines changed

app/code/Magento/Sales/Model/Order/Email/Sender/CreditmemoCommentSender.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,21 @@ public function __construct(
4949
public function send(Creditmemo $creditmemo, $notify = true, $comment = '')
5050
{
5151
$order = $creditmemo->getOrder();
52+
if ($order->getShippingAddress()) {
53+
$formattedShippingAddress = $this->addressRenderer->format($order->getShippingAddress(), 'html');
54+
} else {
55+
$formattedShippingAddress = '';
56+
}
57+
$formattedBillingAddress = $this->addressRenderer->format($order->getBillingAddress(), 'html');
5258
$this->templateContainer->setTemplateVars(
5359
[
5460
'order' => $order,
5561
'creditmemo' => $creditmemo,
5662
'comment' => $comment,
5763
'billing' => $order->getBillingAddress(),
5864
'store' => $order->getStore(),
59-
'formattedShippingAddress' => $this->addressRenderer->format($order->getShippingAddress(), 'html'),
60-
'formattedBillingAddress' => $this->addressRenderer->format($order->getBillingAddress(), 'html'),
65+
'formattedShippingAddress' => $formattedShippingAddress,
66+
'formattedBillingAddress' => $formattedBillingAddress,
6167
]
6268
);
6369

app/code/Magento/Sales/Model/Order/Email/Sender/CreditmemoSender.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ public function __construct(
6767
public function send(Creditmemo $creditmemo, $notify = true, $comment = '')
6868
{
6969
$order = $creditmemo->getOrder();
70+
if ($order->getShippingAddress()) {
71+
$formattedShippingAddress = $this->addressRenderer->format($order->getShippingAddress(), 'html');
72+
} else {
73+
$formattedShippingAddress = '';
74+
}
75+
$formattedBillingAddress = $this->addressRenderer->format($order->getBillingAddress(), 'html');
7076
$this->templateContainer->setTemplateVars(
7177
[
7278
'order' => $creditmemo->getOrder(),
@@ -75,8 +81,8 @@ public function send(Creditmemo $creditmemo, $notify = true, $comment = '')
7581
'billing' => $order->getBillingAddress(),
7682
'payment_html' => $this->getPaymentHtml($order),
7783
'store' => $order->getStore(),
78-
'formattedShippingAddress' => $this->addressRenderer->format($order->getShippingAddress(), 'html'),
79-
'formattedBillingAddress' => $this->addressRenderer->format($order->getBillingAddress(), 'html'),
84+
'formattedShippingAddress' => $formattedShippingAddress,
85+
'formattedBillingAddress' => $formattedBillingAddress,
8086
]
8187
);
8288

app/code/Magento/Sales/Model/Order/Email/Sender/InvoiceCommentSender.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,21 @@ public function __construct(
4949
public function send(Invoice $invoice, $notify = true, $comment = '')
5050
{
5151
$order = $invoice->getOrder();
52+
if ($order->getShippingAddress()) {
53+
$formattedShippingAddress = $this->addressRenderer->format($order->getShippingAddress(), 'html');
54+
} else {
55+
$formattedShippingAddress = '';
56+
}
57+
$formattedBillingAddress = $this->addressRenderer->format($order->getBillingAddress(), 'html');
5258
$this->templateContainer->setTemplateVars(
5359
[
5460
'order' => $order,
5561
'invoice' => $invoice,
5662
'comment' => $comment,
5763
'billing' => $order->getBillingAddress(),
5864
'store' => $order->getStore(),
59-
'formattedShippingAddress' => $this->addressRenderer->format($order->getShippingAddress(), 'html'),
60-
'formattedBillingAddress' => $this->addressRenderer->format($order->getBillingAddress(), 'html'),
65+
'formattedShippingAddress' => $formattedShippingAddress,
66+
'formattedBillingAddress' => $formattedBillingAddress,
6167
]
6268
);
6369
return $this->checkAndSend($order, $notify);

app/code/Magento/Sales/Model/Order/Email/Sender/InvoiceSender.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ public function __construct(
6767
public function send(Invoice $invoice, $notify = true, $comment = '')
6868
{
6969
$order = $invoice->getOrder();
70+
if ($order->getShippingAddress()) {
71+
$formattedShippingAddress = $this->addressRenderer->format($order->getShippingAddress(), 'html');
72+
} else {
73+
$formattedShippingAddress = '';
74+
}
75+
$formattedBillingAddress = $this->addressRenderer->format($order->getBillingAddress(), 'html');
7076
$this->templateContainer->setTemplateVars(
7177
[
7278
'order' => $order,
@@ -75,8 +81,8 @@ public function send(Invoice $invoice, $notify = true, $comment = '')
7581
'billing' => $order->getBillingAddress(),
7682
'payment_html' => $this->getPaymentHtml($order),
7783
'store' => $order->getStore(),
78-
'formattedShippingAddress' => $this->addressRenderer->format($order->getShippingAddress(), 'html'),
79-
'formattedBillingAddress' => $this->addressRenderer->format($order->getBillingAddress(), 'html'),
84+
'formattedShippingAddress' => $formattedShippingAddress,
85+
'formattedBillingAddress' => $formattedBillingAddress,
8086
]
8187
);
8288
$result = $this->checkAndSend($order, $notify);

app/code/Magento/Sales/Model/Order/Email/Sender/OrderCommentSender.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,20 @@ public function __construct(
4747
*/
4848
public function send(Order $order, $notify = true, $comment = '')
4949
{
50+
if ($order->getShippingAddress()) {
51+
$formattedShippingAddress = $this->addressRenderer->format($order->getShippingAddress(), 'html');
52+
} else {
53+
$formattedShippingAddress = '';
54+
}
55+
$formattedBillingAddress = $this->addressRenderer->format($order->getBillingAddress(), 'html');
5056
$this->templateContainer->setTemplateVars(
5157
[
5258
'order' => $order,
5359
'comment' => $comment,
5460
'billing' => $order->getBillingAddress(),
5561
'store' => $order->getStore(),
56-
'formattedShippingAddress' => $this->addressRenderer->format($order->getShippingAddress(), 'html'),
57-
'formattedBillingAddress' => $this->addressRenderer->format($order->getBillingAddress(), 'html'),
62+
'formattedShippingAddress' => $formattedShippingAddress,
63+
'formattedBillingAddress' => $formattedBillingAddress,
5864
]
5965
);
6066
return $this->checkAndSend($order, $notify);

app/code/Magento/Sales/Model/Order/Email/Sender/ShipmentCommentSender.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,21 @@ public function __construct(
4949
public function send(Shipment $shipment, $notify = true, $comment = '')
5050
{
5151
$order = $shipment->getOrder();
52+
if ($order->getShippingAddress()) {
53+
$formattedShippingAddress = $this->addressRenderer->format($order->getShippingAddress(), 'html');
54+
} else {
55+
$formattedShippingAddress = '';
56+
}
57+
$formattedBillingAddress = $this->addressRenderer->format($order->getBillingAddress(), 'html');
5258
$this->templateContainer->setTemplateVars(
5359
[
5460
'order' => $order,
5561
'shipment' => $shipment,
5662
'comment' => $comment,
5763
'billing' => $order->getBillingAddress(),
5864
'store' => $order->getStore(),
59-
'formattedShippingAddress' => $this->addressRenderer->format($order->getShippingAddress(), 'html'),
60-
'formattedBillingAddress' => $this->addressRenderer->format($order->getBillingAddress(), 'html'),
65+
'formattedShippingAddress' => $formattedShippingAddress,
66+
'formattedBillingAddress' => $formattedBillingAddress,
6167
]
6268
);
6369
return $this->checkAndSend($order, $notify);

app/code/Magento/Sales/Model/Order/Email/Sender/ShipmentSender.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ public function __construct(
6767
public function send(Shipment $shipment, $notify = true, $comment = '')
6868
{
6969
$order = $shipment->getOrder();
70+
if ($order->getShippingAddress()) {
71+
$formattedShippingAddress = $this->addressRenderer->format($order->getShippingAddress(), 'html');
72+
} else {
73+
$formattedShippingAddress = '';
74+
}
75+
$formattedBillingAddress = $this->addressRenderer->format($order->getBillingAddress(), 'html');
7076
$this->templateContainer->setTemplateVars(
7177
[
7278
'order' => $order,
@@ -75,8 +81,8 @@ public function send(Shipment $shipment, $notify = true, $comment = '')
7581
'billing' => $order->getBillingAddress(),
7682
'payment_html' => $this->getPaymentHtml($order),
7783
'store' => $order->getStore(),
78-
'formattedShippingAddress' => $this->addressRenderer->format($order->getShippingAddress(), 'html'),
79-
'formattedBillingAddress' => $this->addressRenderer->format($order->getBillingAddress(), 'html'),
84+
'formattedShippingAddress' => $formattedShippingAddress,
85+
'formattedBillingAddress' => $formattedBillingAddress,
8086
]
8187
);
8288
$result = $this->checkAndSend($order, $notify);

0 commit comments

Comments
 (0)