Skip to content

Commit 0ced2c2

Browse files
author
Oleksii Korshenko
authored
MAGETWO-81969: Download link does not get rendered in invoice email #11024
2 parents 3d6f738 + edc0d67 commit 0ced2c2

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

app/code/Magento/Downloadable/Block/Sales/Order/Email/Items/Downloadable.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@ public function __construct(
7070
public function getLinks()
7171
{
7272
$this->_purchased = $this->_purchasedFactory->create()->load(
73-
$this->getItem()->getId(),
73+
$this->getItem()->getOrderItemId(),
7474
'order_item_id'
7575
);
7676
$purchasedLinks = $this->_itemsFactory->create()->addFieldToFilter(
7777
'order_item_id',
78-
$this->getItem()->getId()
78+
$this->getItem()->getOrderItemId()
7979
);
8080
$this->_purchased->setPurchasedItems($purchasedLinks);
8181

app/code/Magento/Downloadable/Test/Unit/Block/Sales/Order/Email/Items/DownloadableTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function testGetLinks()
5959
{
6060
$item = $this->getMockBuilder(\Magento\Sales\Model\Order\Item::class)
6161
->disableOriginalConstructor()
62-
->setMethods(['getId'])
62+
->setMethods(['getOrderItemId'])
6363
->getMock();
6464
$linkPurchased = $this->getMockBuilder(\Magento\Downloadable\Model\Link\Purchased::class)
6565
->disableOriginalConstructor()
@@ -73,12 +73,12 @@ public function testGetLinks()
7373

7474
$this->block->setData('item', $item);
7575
$this->purchasedFactory->expects($this->once())->method('create')->willReturn($linkPurchased);
76-
$linkPurchased->expects($this->once())->method('load')->with('itemId', 'order_item_id')->willReturnSelf();
77-
$item->expects($this->any())->method('getId')->willReturn('itemId');
76+
$linkPurchased->expects($this->once())->method('load')->with('orderItemId', 'order_item_id')->willReturnSelf();
77+
$item->expects($this->any())->method('getOrderItemId')->willReturn('orderItemId');
7878
$this->itemsFactory->expects($this->once())->method('create')->willReturn($itemCollection);
7979
$itemCollection->expects($this->once())
8080
->method('addFieldToFilter')
81-
->with('order_item_id', 'itemId')
81+
->with('order_item_id', 'orderItemId')
8282
->willReturnSelf();
8383

8484
$this->assertEquals($linkPurchased, $this->block->getLinks());

0 commit comments

Comments
 (0)