Skip to content

Commit 018345d

Browse files
committed
Merge remote-tracking branch 'remotes/origin/MAGETWO-52015' into PR-4
2 parents 07d60c2 + 66d7fb2 commit 018345d

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

app/code/Magento/Bundle/Model/Product/Price.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,9 @@ public function getFinalPrice($qty, $product)
183183
$finalPrice = $this->_applyOptionsPrice($product, $qty, $finalPrice);
184184
$finalPrice += $this->getTotalBundleItemsPrice($product, $qty);
185185

186+
$finalPrice = max(0, $finalPrice);
186187
$product->setFinalPrice($finalPrice);
187-
return max(0, $product->getData('final_price'));
188+
return $finalPrice;
188189
}
189190

190191
/**

app/code/Magento/Catalog/Block/Product/ListProduct.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ protected function _getProductCollection()
122122
}
123123
}
124124
$this->_productCollection = $layer->getProductCollection();
125+
$this->_productCollection->addOptionsToResult();
125126

126127
$this->prepareSortableFieldsByCategory($layer->getCurrentCategory());
127128

app/code/Magento/Catalog/Model/Product.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,6 @@ class Product extends \Magento\Catalog\Model\AbstractModel implements
142142
*/
143143
protected $optionInstance;
144144

145-
/**
146-
* @var bool
147-
*/
148-
protected $optionsInitialized = false;
149-
150145
/**
151146
* @var array
152147
*/
@@ -1901,6 +1896,7 @@ public function addOption(Product\Option $option)
19011896
{
19021897
$options = (array)$this->getData('options');
19031898
$options[] = $option;
1899+
$option->setProduct($this);
19041900
$this->setData('options', $options);
19051901
return $this;
19061902
}

app/code/Magento/Eav/Model/ResourceModel/CreateHandler.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
/**
1616
* Class CreateHandler
17+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1718
*/
1819
class CreateHandler implements AttributeInterface
1920
{
@@ -87,6 +88,7 @@ protected function getAttributes($entityType)
8788
* @return array
8889
* @throws \Exception
8990
* @throws \Magento\Framework\Exception\ConfigurationMismatchException
91+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
9092
*/
9193
public function execute($entityType, $entityData, $arguments = [])
9294
{
@@ -100,6 +102,7 @@ public function execute($entityType, $entityData, $arguments = [])
100102
continue;
101103
}
102104
if (isset($entityData[$attribute->getAttributeCode()])
105+
&& !is_array($entityData[$attribute->getAttributeCode()])
103106
&& !$attribute->isValueEmpty($entityData[$attribute->getAttributeCode()])
104107
) {
105108
$this->attributePersistor->registerInsert(

0 commit comments

Comments
 (0)