Skip to content

Commit

Permalink
magento#14020-Cart-Sales-Rule-with-negated-condition-over-special-pri…
Browse files Browse the repository at this point in the history
…ce-does-not-work-for-configurable-products.

Revert "Removed dependency to configurable product"

This reverts commit d2a0de8.
  • Loading branch information
novikor committed Jul 4, 2018
1 parent d2a0de8 commit fae98c0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/code/Magento/SalesRule/Model/Rule/Condition/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
*/
namespace Magento\SalesRule\Model\Rule\Condition;

use Magento\ConfigurableProduct\Model\Product\Type\Configurable;

/**
* Product rule condition data model
*
Expand Down Expand Up @@ -45,7 +47,7 @@ protected function getProductToValidate(\Magento\Framework\Model\AbstractModel $
$attrCode = $this->getAttribute();

/* Check for attributes which are not available for configurable products */
if ($product->isComposite() && !$product->hasData($attrCode)) {
if ($product->getTypeId() == Configurable::TYPE_CODE && !$product->hasData($attrCode)) {
/** @var \Magento\Catalog\Api\Data\ProductInterface $childProduct */
$childProduct = current($model->getChildren())->getProduct();
if ($childProduct->hasData($attrCode)) {
Expand Down

0 comments on commit fae98c0

Please sign in to comment.