Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
141 commits
Select commit Hold shift + click to select a range
dac8bfb
MAGETWO-55937: [Complex product/Grouped productsl] Tax Amount and Cus…
stkorf Jul 27, 2017
b884072
Merge branch 'MAGETWO-55937' into 'SPRINT-40'
kalashnikau-uladzimir Jul 28, 2017
82da025
MAGETWO-55937: [Complex product/Grouped productsl] Tax Amount and Cus…
isxam Jul 31, 2017
bf31af2
Merge branch 'MAGETWO-55937-namespace' into 'SPRINT-40'
isxam Jul 31, 2017
46d5d76
Merge remote-tracking branch 'magento-ce/2.2-develop' into SPRINT-40
nikshostko Aug 1, 2017
586f2f7
Merge remote-tracking branch 'magento-ce/2.2-develop' into SPRINT-40
nikshostko Aug 2, 2017
1d62708
Merge remote-tracking branch 'magento-ce/2.2-develop' into SPRINT-40
nikshostko Aug 2, 2017
ca62b64
Merge remote-tracking branch 'magento-ce/2.2-develop' into SPRINT-40
nikshostko Aug 3, 2017
35e92f5
Merge remote-tracking branch 'magento-ce/2.2-develop' into SPRINT-40
nikshostko Aug 4, 2017
395fb47
Merge remote-tracking branch 'magento-epam/2.2-develop' into 2.2-deve…
vital5p Aug 7, 2017
d380f15
Merge branch '2.2-develop_SPRINT-40_v01' into 'SPRINT-40'
isxam Aug 7, 2017
6ddca8c
MAGETWO-55937: [Complex product/Grouped productsl] Tax Amount and Cus…
vital5p Aug 9, 2017
e0f3721
Merge branch 'SPRINT-40-fix-unit' into 'SPRINT-40'
isxam Aug 9, 2017
3ce1791
MAGETWO-55937: [Complex product/Grouped productsl] Tax Amount and Cus…
vital5p Aug 10, 2017
48503c0
Merge branch 'CR-746-fix' into 'SPRINT-40'
isxam Aug 10, 2017
5ca86e1
MAGETWO-71528: Add an ability to call methods through objects in emai…
isxam Aug 11, 2017
5547939
Merge branch 'mainline-2.2-develop' into 'SPRINT-41'
isxam Aug 14, 2017
5284f02
Merge branch 'SPRINT-41' into 'MAGETWO-71366-fx'
isxam Aug 14, 2017
bfc0ccf
MAGETWO-71595: Issue while loading product options for bundle product…
kirylbakun Aug 15, 2017
1d8b402
Merge branch 'MAGETWO-71595' into 'SPRINT-41'
isxam Aug 16, 2017
9de3b46
MAGETWO-64085: [GitHub] Static versioning and styles minification bre…
anthoula Aug 16, 2017
fbbf375
MAGETWO-71595: Issue while loading product options for bundle product…
kirylbakun Aug 17, 2017
247f793
MAGETWO-67037: core_config_data table is not populated correctly when…
p-bystritsky Aug 17, 2017
fcd06a3
Merge branch 'MAGETWO-71595-unit-tests' into 'SPRINT-41'
isxam Aug 17, 2017
33b824f
MAGETWO-67037: core_config_data table is not populated correctly when…
p-bystritsky Aug 17, 2017
9842136
MAGETWO-70540: Edit bundle product from shopping cart work unexpected
nmalevanec Aug 17, 2017
1daabff
Merge branch '2.2-develop' into MAGETWO-67037
p-bystritsky Aug 17, 2017
f9696ce
MAGETWO-67037: core_config_data table is not populated correctly when…
p-bystritsky Aug 17, 2017
eef82fd
MAGETWO-67092: Table salesrule_product_attribute is not populated whe…
p-bystritsky Aug 17, 2017
39cbc85
MAGETWO-67092: Table salesrule_product_attribute is not populated whe…
p-bystritsky Aug 17, 2017
f245f6d
MAGETWO-67092: Table salesrule_product_attribute is not populated whe…
p-bystritsky Aug 17, 2017
b268498
MAGETWO-67092: Table salesrule_product_attribute is not populated whe…
p-bystritsky Aug 17, 2017
849d1e3
MAGETWO-67092: Table salesrule_product_attribute is not populated whe…
p-bystritsky Aug 17, 2017
5c2d208
MAGETWO-70540: Edit bundle product from shopping cart work unexpected
nmalevanec Aug 18, 2017
ee3811d
Merge branch '2.2-develop' into MAGETWO-70540
nmalevanec Aug 18, 2017
c4a799a
Merge branch 'SPRINT-40' into 'SPRINT-41'
isxam Aug 18, 2017
ca98f4e
Merge branch '2.2-develop_SPRINT-41_V1' into 'SPRINT-41'
isxam Aug 18, 2017
31a6fed
MAGETWO-71551: Inconsistent quote information after upgrade on 2.2
krissyhiserote Aug 18, 2017
143cfb0
MAGETWO-70540: Edit bundle product from shopping cart work unexpected
nmalevanec Aug 21, 2017
1c51421
MAGETWO-70540: Edit bundle product from shopping cart work unexpected
nmalevanec Aug 21, 2017
df2f289
Merge branch '2.2-develop' into MAGETWO-70540
nmalevanec Aug 21, 2017
a5f0a26
Merge branch '2.2-develop_SPRINT-41_V1' into 'SPRINT-41'
kalashnikau-uladzimir Aug 21, 2017
daa8a3a
Merge branch '2.2-develop_SPRINT-41_V1' into 'SPRINT-41'
vital5p Aug 21, 2017
083147c
MAGETWO-71013: Export missing configurable variations when exporting …
tjwiebell Aug 21, 2017
9d563cb
MAGETWO-71013: Export missing configurable variations when exporting …
tjwiebell Aug 21, 2017
427c2c3
MAGETWO-71415 [The system grids] Mass actions process only 20 element…
Aug 21, 2017
718522b
Merge branch '2.2-develop' of github.com:magento-jackalopes/magento2c…
Aug 21, 2017
5cf1f0b
Merge branch 'MAGETWO-71366-fx' into 'SPRINT-41'
kalashnikau-uladzimir Aug 22, 2017
7f87458
Merge remote-tracking branch 'origin/MAGETWO-70540' into 2.2-develop-…
RomaKis Aug 22, 2017
32a9f93
Merge remote-tracking branch 'origin/MAGETWO-67092' into 2.2-develop-…
RomaKis Aug 22, 2017
2281c89
Merge remote-tracking branch 'origin/MAGETWO-67037' into 2.2-develop-…
RomaKis Aug 22, 2017
db7ceef
MAGETWO-67092: Table salesrule_product_attribute is not populated whe…
p-bystritsky Aug 22, 2017
ad13633
Merge branch 'MAGETWO-67092' into 2.2-develop-pr10
p-bystritsky Aug 22, 2017
4047ddf
MAGETWO-71639: Parent ID is hardcoded as "1" in the \Magento\Setup\Fi…
isxam Aug 22, 2017
9d7ab32
Merge branch '2.2-develop_SPRINT-41_V1' into 'SPRINT-41'
vital5p Aug 22, 2017
e3314d1
Merge branch 'MAGETWO-71639' into 'SPRINT-41'
kalashnikau-uladzimir Aug 22, 2017
c8808af
MAGETWO-71415 [The system grids] Mass actions process only 20 element…
Aug 22, 2017
f1d1005
Merge branch '2.2-develop' of github.com:magento-jackalopes/magento2c…
Aug 22, 2017
0bca27c
MAGETWO-71415 [The system grids] Mass actions process only 20 element…
Aug 22, 2017
6524ee6
Merge branch '2.2-develop' of github.com:magento/magento2ce into SPRI…
vital5p Aug 23, 2017
9f71bed
Static versioning and styles minification break email fonts styles #8241
xmav Aug 23, 2017
2b572a6
Merge branch '2.2-develop_SPRINT-41' into 'SPRINT-41'
vital5p Aug 23, 2017
dfb83aa
MAGETWO-71749: Impossible get Tracking information when 2nd Shippin…
tjwiebell Aug 23, 2017
81b041e
Merge remote-tracking branch 'mainline/2.2-develop' into MAGETWO-7101…
tjwiebell Aug 23, 2017
795b6b8
Static versioning and styles minification break email fonts styles #8241
xmav Aug 23, 2017
8ce6ab7
MAGETWO-71896: Static versioning and styles minification break email …
miguelbalparda Aug 23, 2017
ca56c0a
Merge remote-tracking branch 'mainline/2.2-develop' into MAGETWO-64085
cpartica Aug 23, 2017
6ec532d
MAGETWO-71562: Search by attribute is not working with Elasticsearch
danmooney2 Aug 23, 2017
8733f8c
MAGETWO-64085: Static versioning and styles minification break email …
cpartica Aug 23, 2017
ff986bd
MAGETWO-64085: [GitHub] Static versioning and styles minification bre…
cpartica Aug 24, 2017
066836e
MAGETWO-71708: [Staging] Cannot create staging update for product wit…
Aug 24, 2017
234899d
MAGETWO-71013: Export missing configurable variations when exporting …
tjwiebell Aug 24, 2017
7bdd785
Merge remote-tracking branch 'mainline/2.2-develop' into MAGETWO-7155…
krissyhiserote Aug 24, 2017
e8e230c
MAGETWO-71013: Export missing configurable variations when exporting …
tjwiebell Aug 24, 2017
48da96d
MAGETWO-71415 [The system grids] Mass actions process only 20 element…
Aug 25, 2017
65cc2b7
Merge remote-tracking branch 'upstream/2.2-develop' into MAGETWO-7170…
Aug 25, 2017
4015fc8
MAGETWO-71826: @api annotation is missing for Magento\Framework\Conve…
Aug 25, 2017
bb56248
Merge remote-tracking branch 'mainline/2.2-develop' into MAGETWO-7174…
tjwiebell Aug 25, 2017
cc4ed13
Merge branch 'MAGETWO-71826-api-annotation-missing' into pr-aug25
tjwiebell Aug 25, 2017
0779107
Merge remote-tracking branch 'mainline/2.2-develop' into MAGETWO-7101…
tjwiebell Aug 25, 2017
e42476e
Merge branch 'MAGETWO-71013-export-missing-headers-bwc' into pr-aug25
tjwiebell Aug 25, 2017
65fef25
Merge remote-tracking branch 'mainline/2.2-develop' into MAGETWO-7155…
tjwiebell Aug 25, 2017
368043f
Merge branch 'MAGETWO-71551-quote-version-bump' into pr-aug25
tjwiebell Aug 25, 2017
0788e64
MAGETWO-71708: [Staging] Cannot create staging update for product wit…
Aug 25, 2017
627019b
MAGETWO-64085: Static versioning and styles minification break email …
cpartica Aug 25, 2017
d88aeeb
Merge remote-tracking branch 'mainline/2.2-develop' into MAGETWO-64085
cpartica Aug 25, 2017
360ef42
Merge branch '2.2-develop' into 2.2-develop-pr10
RomaKis Aug 28, 2017
1c20c94
Merge remote-tracking branch 'origin/2.2-develop-pr10' into 2.2-devel…
RomaKis Aug 28, 2017
333471e
MAGETWO-71841: Caching issue with tier prices
Aug 28, 2017
6df5857
MAGETWO-70603: Impossible add gift options on order level if use secu…
irenelagno Aug 28, 2017
d3db46b
MAGETWO-71841: Caching issue with tier prices
Aug 28, 2017
cc3aafb
Merge branch '2.2-develop' of github.com:magento/magento2ce into SPRI…
vital5p Aug 28, 2017
3532719
Merge branch 'SPRINT-41_2.2-develop' into 'SPRINT-41'
vital5p Aug 28, 2017
59a6784
Merge pull request #1438 from magento-tsg/2.2-develop-pr10
VladimirZaets Aug 29, 2017
7b5d42a
MAGETWO-64085: Static versioning and styles minification break email …
cpartica Aug 29, 2017
4dbeed5
MAGETWO-64085: Static versioning and styles minification break email …
cpartica Aug 29, 2017
6ff2486
Merge remote-tracking branch 'mainline/2.2-develop' into MAGETWO-64085
cpartica Aug 29, 2017
947b583
Merge remote-tracking branch 'mainline/2.2-develop' into pr-aug25
pdohogne-magento Aug 29, 2017
10e896d
MAGETWO-64085: Static versioning and styles minification break email …
cpartica Aug 29, 2017
d4e302a
MAGETWO-64085: Static versioning and styles minification break email …
cpartica Aug 29, 2017
4d9d6b0
Merge pull request #1437 from magento-jackalopes/pr-aug25
pdohogne-magento Aug 29, 2017
64298b3
Merge branch '2.2-develop' of github.com:magento/magento2ce into SPRI…
vital5p Aug 30, 2017
07f9a10
Merge remote-tracking branch 'south/MAGETWO-71841' into bugs
irenelagno Aug 30, 2017
fe9e95d
Merge remote-tracking branch 'austin/MAGETWO-70603' into bugs
irenelagno Aug 30, 2017
4ecb6a5
Merge remote-tracking branch 'jackalopes/MAGETWO-71415' into pr-aug29
cpartica Aug 30, 2017
3cac42e
Merge remote-tracking branch 'okapis/MAGETWO-64085' into pr-aug29
cpartica Aug 30, 2017
ae1d7c7
Merge remote-tracking branch 'jackalopes/MAGETWO-71708-unique-attribu…
cpartica Aug 30, 2017
17cc643
Merge remote-tracking branch 'okapis/MAGETWO-71562-Search-by-attribut…
cpartica Aug 30, 2017
edb0ea3
Merge pull request #1442 from magento-okapis/pr-aug29
cpartica Aug 30, 2017
b27fd75
MAGETWO-70603: Impossible add gift options on order level if use secu…
irenelagno Aug 31, 2017
fe0a5c7
Merge branch 'main_2.2-develop' into bugs
irenelagno Aug 31, 2017
dd4a94d
merge magento/2.2-develop into magento-epam/SPRINT-41
Aug 31, 2017
28d4287
Merge pull request #1446 from magento-epam/SPRINT-41
dvoskoboinikov Aug 31, 2017
c102785
Merge branch 'main_2.2-develop' into bugs
irenelagno Sep 1, 2017
093e742
#10738
nowszy Sep 1, 2017
f757b46
Merge pull request #1449 from magento-honey-badgers/bugs
Sep 1, 2017
6a2c35b
MAGETWO-72226: Fix for translated attribute label comparisson. #10739
ishakhsuvarov Sep 1, 2017
d59a428
Fix minor type "consturctor" > "constructor"
jissereitsma Sep 3, 2017
ba33ebc
Remove unnecessary comment.
RakeshJesadiya Sep 3, 2017
a3fe637
phpDocumentor Return tag must be an int
Sep 4, 2017
028d1a8
MAGETWO-72258: Fix minor type 'consturctor' > 'constructor' #10755
ishakhsuvarov Sep 4, 2017
ff6edf0
MAGETWO-72260: Remove unnecessary comment. #10759
ishakhsuvarov Sep 4, 2017
85f49bf
MAGETWO-72258: Fix minor type "consturctor" > "constructor" magento/m…
ishakhsuvarov Sep 4, 2017
c785afb
Set (bool) before function
Sep 4, 2017
9e82159
MAGETWO-72259: phpDocumentor Return tag must be an int #10760
orlangur Sep 4, 2017
df07d6c
Merge remote-tracking branch 'mainline/2.2-develop' into MAGETWO-72261
slavvka Sep 4, 2017
b10dced
MAGETWO-71896: Static versioning and styles minification break email …
ishakhsuvarov Sep 4, 2017
4b09ffd
MAGETWO-71896: Merge branch 'develop' of github.com:magento/magento2 …
ishakhsuvarov Sep 4, 2017
0594ecd
MAGETWO-72260: Remove unnecessary comment. #10759
ishakhsuvarov Sep 4, 2017
5013d52
MAGETWO-72259: phpDocumentor Return tag must be an int #10760
ishakhsuvarov Sep 4, 2017
547ca4d
MAGETWO-72258: Fix minor type "consturctor" > "constructor" #10755
ishakhsuvarov Sep 4, 2017
c20b2e9
MAGETWO-72226: Fix for translated attribute label comparisson. #10739
ishakhsuvarov Sep 4, 2017
5feecfc
MAGETWO-71896: Static versioning and styles minification break email …
ishakhsuvarov Sep 4, 2017
e05217d
Merge pull request #1454 from magento-borg/MAGETWO-72261
slavvka Sep 4, 2017
bb5e7b9
Merge branch 'develop' of github.com:magento/magento2ce into develop-prs
ishakhsuvarov Sep 4, 2017
58694a6
MAGETWO-71896: Merge branch 'develop' of github.com:magento/magento2c…
ishakhsuvarov Sep 4, 2017
dfa6f87
MAGETWO-71896: Static versioning and styles minification break email …
ishakhsuvarov Sep 4, 2017
4271168
MAGETWO-71896: Merge branch 'MAGETWO-71896-PR-10638' of github.com:ma…
ishakhsuvarov Sep 4, 2017
c2810e0
Merge pull request #1453 from magento-engcom/develop-prs
ishakhsuvarov Sep 4, 2017
073fb79
Merge remote-tracking branch 'mainline/develop' into merge-mainline
Sep 5, 2017
7a6e3e1
MSI: update composer lock
Sep 5, 2017
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
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public function getDefaultValues()
*/
protected function _getSelectedOptions()
{
if (is_null($this->_selectedOptions)) {
if ($this->_selectedOptions === null) {
$this->_selectedOptions = [];

/** @var \Magento\Bundle\Model\Option $option */
Expand All @@ -152,17 +152,29 @@ protected function _getSelectedOptions()
$selectionId = $this->getProduct()->getPreconfiguredValues()->getData(
'bundle_option/' . $option->getId()
);
if ($selectionId && $option->getSelectionById($selectionId)) {
$this->_selectedOptions = $selectionId;
} elseif (!$option->getRequired()) {
$this->_selectedOptions = 'None';
}
$this->assignSelection($option, $selectionId);
}
}

return $this->_selectedOptions;
}

/**
* Set selected options.
*
* @param \Magento\Bundle\Model\Option $option
* @param mixed $selectionId
* @return void
*/
protected function assignSelection(\Magento\Bundle\Model\Option $option, $selectionId)
{
if ($selectionId && $option->getSelectionById($selectionId)) {
$this->_selectedOptions = $selectionId;
} elseif (!$option->getRequired()) {
$this->_selectedOptions = 'None';
}
}

/**
* Define if selection is selected
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,20 @@ class Multi extends \Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Optio
* @var string
*/
protected $_template = 'catalog/product/view/type/bundle/option/multi.phtml';

/**
* @inheritdoc
*/
protected function assignSelection(\Magento\Bundle\Model\Option $option, $selectionId)
{
if (is_array($selectionId)) {
foreach ($selectionId as $id) {
if ($id && $option->getSelectionById($id)) {
$this->_selectedOptions[] = $id;
}
}
} else {
parent::assignSelection($option, $selectionId);
}
}
}
4 changes: 2 additions & 2 deletions app/code/Magento/Bundle/Model/Product/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ protected function _prepareProduct(\Magento\Framework\DataObject $buyRequest, $p
$options
);

$optionsCollection->appendSelections($selections, false, $_appendAllSelections);
$optionsCollection->appendSelections($selections, true, $_appendAllSelections);

$selections = $selections->getItems();
} else {
Expand All @@ -704,7 +704,7 @@ protected function _prepareProduct(\Magento\Framework\DataObject $buyRequest, $p
->getOptionsIds($product);
$selectionCollection = $product->getTypeInstance()
->getSelectionsCollection($optionIds, $product);
$options = $optionCollection->appendSelections($selectionCollection, false, $_appendAllSelections);
$options = $optionCollection->appendSelections($selectionCollection, true, $_appendAllSelections);

$selections = $this->mergeSelectionsWithOptions($options, $selections);
}
Expand Down
13 changes: 9 additions & 4 deletions app/code/Magento/Bundle/Test/Unit/Model/Product/TypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ public function testPrepareForCartAdvancedWithoutOptions()
->willReturn($productType);
$optionCollection->expects($this->any())
->method('appendSelections')
->with($selectionCollection, true, true)
->willReturn([$option]);
$productType->expects($this->once())
->method('setStoreFilter');
Expand Down Expand Up @@ -433,7 +434,8 @@ function ($key) use ($optionCollection, $selectionCollection) {
->method('getItemById')
->willReturn($option);
$optionCollection->expects($this->once())
->method('appendSelections');
->method('appendSelections')
->with($selectionCollection, true, true);
$productType->expects($this->once())
->method('setStoreFilter');
$buyRequest->expects($this->once())
Expand Down Expand Up @@ -668,7 +670,8 @@ function ($key) use ($optionCollection, $selectionCollection) {
->method('getItemById')
->willReturn($option);
$optionCollection->expects($this->once())
->method('appendSelections');
->method('appendSelections')
->with($selectionCollection, true, true);
$productType->expects($this->once())
->method('setStoreFilter');
$buyRequest->expects($this->once())
Expand Down Expand Up @@ -891,7 +894,8 @@ function ($key) use ($optionCollection, $selectionCollection) {
->method('getItemById')
->willReturn($option);
$optionCollection->expects($this->once())
->method('appendSelections');
->method('appendSelections')
->with($selectionCollection, true, true);
$productType->expects($this->once())
->method('setStoreFilter');
$buyRequest->expects($this->once())
Expand Down Expand Up @@ -1169,7 +1173,8 @@ function ($key) use ($optionCollection, $selectionCollection) {
}
);
$optionCollection->expects($this->once())
->method('appendSelections');
->method('appendSelections')
->with($selectionCollection, true, true);
$productType->expects($this->once())
->method('setStoreFilter');
$buyRequest->expects($this->once())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
<?php
$product = $block->getProduct();
$helper = $this->helper('Magento\Catalog\Helper\Output');
$stripSelection = $product->getConfigureMode() ? true : false;
$options = $block->decorateArray($block->getOptions($stripSelection));
?>
<?php $options = $block->decorateArray($block->getOptions()); ?>
<?php if ($product->isSaleable()):?>
<?php if (count($options)): ?>
<script type="text/x-magento-init">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ public function getProductAttributeValue($product, $attribute)
['select', 'boolean', 'multiselect']
)
) {
//$value = $attribute->getSource()->getOptionText($product->getData($attribute->getAttributeCode()));
$value = $attribute->getFrontend()->getValue($product);
} else {
$value = $product->getData($attribute->getAttributeCode());
Expand Down
15 changes: 13 additions & 2 deletions app/code/Magento/Catalog/Pricing/Price/TierPrice.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Magento\Framework\Pricing\Price\AbstractPrice;
use Magento\Framework\Pricing\Price\BasePriceProviderInterface;
use Magento\Framework\Pricing\PriceInfoInterface;
use Magento\Customer\Model\Group\RetrieverInterface as CustomerGroupRetrieverInterface;

/**
* @api
Expand All @@ -30,6 +31,7 @@ class TierPrice extends AbstractPrice implements TierPriceInterface, BasePricePr

/**
* @var Session
* @deprecated
*/
protected $customerSession;

Expand Down Expand Up @@ -57,30 +59,39 @@ class TierPrice extends AbstractPrice implements TierPriceInterface, BasePricePr
*/
protected $groupManagement;

/**
* @var CustomerGroupRetrieverInterface
*/
private $customerGroupRetriever;

/**
* @param Product $saleableItem
* @param float $quantity
* @param CalculatorInterface $calculator
* @param \Magento\Framework\Pricing\PriceCurrencyInterface $priceCurrency
* @param Session $customerSession
* @param GroupManagementInterface $groupManagement
* @param CustomerGroupRetrieverInterface|null $customerGroupRetriever
*/
public function __construct(
Product $saleableItem,
$quantity,
CalculatorInterface $calculator,
\Magento\Framework\Pricing\PriceCurrencyInterface $priceCurrency,
Session $customerSession,
GroupManagementInterface $groupManagement
GroupManagementInterface $groupManagement,
CustomerGroupRetrieverInterface $customerGroupRetriever = null
) {
$quantity = floatval($quantity) ? $quantity : 1;
parent::__construct($saleableItem, $quantity, $calculator, $priceCurrency);
$this->customerSession = $customerSession;
$this->groupManagement = $groupManagement;
$this->customerGroupRetriever = $customerGroupRetriever
?? \Magento\Framework\App\ObjectManager::getInstance()->get(CustomerGroupRetrieverInterface::class);
if ($saleableItem->hasCustomerGroupId()) {
$this->customerGroup = (int) $saleableItem->getCustomerGroupId();
} else {
$this->customerGroup = (int) $this->customerSession->getCustomerGroupId();
$this->customerGroup = (int) $this->customerGroupRetriever->getCustomerGroupId();
}
}

Expand Down
34 changes: 21 additions & 13 deletions app/code/Magento/Catalog/Test/Unit/Pricing/Price/TierPriceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,47 +25,52 @@ class TierPriceTest extends \PHPUnit\Framework\TestCase
*
* @var int
*/
protected $customerGroup = Group::NOT_LOGGED_IN_ID;
private $customerGroup = Group::NOT_LOGGED_IN_ID;

/**
* @var \PHPUnit_Framework_MockObject_MockObject
*/
protected $priceInfo;
private $priceInfo;

/**
* @var \PHPUnit_Framework_MockObject_MockObject
*/
protected $product;
private $product;

/**
* @var float
*/
protected $quantity = 3.;
private $quantity = 3.;

/**
* @var \PHPUnit_Framework_MockObject_MockObject
*/
protected $calculator;
private $calculator;

/**
* @var \PHPUnit_Framework_MockObject_MockObject
*/
protected $session;
private $session;

/**
* @var TierPrice
*/
protected $model;
private $model;

/**
* @var \Magento\Framework\Pricing\PriceCurrencyInterface|\PHPUnit_Framework_MockObject_MockObject
*/
protected $priceCurrencyMock;
private $priceCurrencyMock;

/**
* @var \PHPUnit_Framework_MockObject_MockObject
*/
protected $groupManagement;
private $groupManagement;

/**
* @var \Magento\Customer\Model\Group\RetrieverInterface|\PHPUnit_Framework_MockObject_MockObject
*/
private $customerGroupRetriever;

/**
* Initialize base dependencies
Expand All @@ -76,11 +81,12 @@ protected function setUp()

$this->product = $this->createPartialMock(\Magento\Catalog\Model\Product::class, ['getPriceInfo', 'hasCustomerGroupId', 'getCustomerGroupId', 'getResource', '__wakeup']);
$this->product->expects($this->any())->method('getPriceInfo')->will($this->returnValue($this->priceInfo));

$this->customerGroupRetriever = $this->getMockBuilder(\Magento\Customer\Model\Group\RetrieverInterface::class)
->disableOriginalConstructor()->getMock();
$this->session = $this->createMock(\Magento\Customer\Model\Session::class);
$this->session->expects($this->any())->method('getCustomerGroupId')
->will($this->returnValue($this->customerGroup));

$this->customerGroupRetriever = $this->createMock(\Magento\Customer\Model\Group\RetrieverInterface::class);
$this->calculator = $this->createMock(\Magento\Framework\Pricing\Adjustment\Calculator::class);
$this->groupManagement = $this->createMock(\Magento\Customer\Api\GroupManagementInterface::class);

Expand All @@ -92,7 +98,8 @@ protected function setUp()
$this->calculator,
$this->priceCurrencyMock,
$this->session,
$this->groupManagement
$this->groupManagement,
$this->customerGroupRetriever
);
}

Expand Down Expand Up @@ -218,7 +225,8 @@ public function testGetterStoredTierPrices()
$this->calculator,
$this->priceCurrencyMock,
$this->session,
$this->groupManagement
$this->groupManagement,
$this->customerGroupRetriever
);
$group = $this->createMock(\Magento\Customer\Model\Data\Group::class);
$group->expects($this->once())->method('getId')->willReturn(GroupManagement::CUST_GROUP_ALL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ if ($_attributeType && $_attributeType == 'text') {

<?php if ($_attributeValue): ?>
<div class="product attribute <?= /* @escapeNotVerified */ $_className ?>">
<?php if ($_attributeLabel != 'none'): ?><strong class="type"><?= /* @escapeNotVerified */ $_attributeLabel ?></strong><?php endif; ?>
<?php if ($_attributeLabel != __('none')): ?><strong class="type"><?= /* @escapeNotVerified */ $_attributeLabel ?></strong><?php endif; ?>
<div class="value" <?= /* @escapeNotVerified */ $_attributeAddAttribute ?>><?= /* @escapeNotVerified */ $_attributeValue ?></div>
</div>
<?php endif; ?>
Loading