Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Block/Success.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ private function getLineItems(): array
if ($this->notBundleProduct($item) && $this->notConfigurableChild($item)) {
$qty = (int) $item->getQtyOrdered();
$sku = $item->getSku();
$price = $item->getBaseRowTotal() - $item->getBaseDiscountAmount();
$price = $item->getBaseRowTotalInclTax() - $item->getBaseDiscountAmount();

$items[] = [
'item' => $sku,
Expand Down
25 changes: 25 additions & 0 deletions CustomerData/ItemPool.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

namespace Emartech\Emarsys\CustomerData;

use Magento\Checkout\CustomerData\ItemPool as OriginalItemPool;
use Magento\Quote\Model\Quote\Item;

class ItemPool extends OriginalItemPool
{

/**
* Extend getItemData method to add product_price_gross_value
*
* @param OriginalItemPool $subject
* @param array $result
* @param Item $item
*
* @return array
*/
public function afterGetItemData(OriginalItemPool $subject, $result, Item $item)
{
$result['product_price_incl_tax'] = (float) $item->getPriceInclTax();
return $result;
}
}
4 changes: 2 additions & 2 deletions dev/testv2/.npmrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
always-auth=true
@itg-commerce:registry=https://gitlab.itg.cloud/api/v4/projects/295/packages/npm/
//gitlab.itg.cloud/api/v4/projects/295/packages/npm/:_authToken=${NPM_TOKEN}
@itg-commerce:registry=https://gitlab.itg.cloud/api/v4/projects/227/packages/npm/
//gitlab.itg.cloud/api/v4/projects/227/packages/npm/:_authToken=${NPM_TOKEN}
2 changes: 1 addition & 1 deletion dev/testv2/cypress/integration/web-extend.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ describe('Web extend scripts', function () {
expect(orderData.items).to.be.eql([
{
item: '24-MB02',
price: 118,
price: 127.74,
quantity: 2
}
]);
Expand Down
2 changes: 1 addition & 1 deletion dev/testv2/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions etc/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@
<type name="Magento\Customer\CustomerData\Customer">
<plugin name="emartech_customerplugin" type="Emartech\Emarsys\CustomerData\Customer" />
</type>
<type name="Magento\Checkout\CustomerData\ItemPool">
<plugin name="emartech_checkout_itempool_plugin" type="Emartech\Emarsys\CustomerData\ItemPool"/>
</type>
<type name="Magento\Newsletter\Model\Subscriber">
<plugin name="emarsys_newsletter" type="\Emartech\Emarsys\Events\CustomerPlugin" sortOrder="1" disabled="false"/>
</type>
Expand Down