Skip to content

Commit 282cf5c

Browse files
author
vnayda
committed
MAGETWO-59950: Configurable product option price is displayed incorrectly per website - for 2.0.x
- fix builds
1 parent 5795865 commit 282cf5c

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@ public function process(Select $select)
5050

5151
$select->joinLeft(
5252
['status_global_attr' => $statusAttribute->getBackendTable()],
53-
"status_global_attr.entity_id = " . self::PRODUCT_RELATION_ALIAS . ".entity_id"
53+
"status_global_attr.entity_id = " . self::PRODUCT_RELATION_ALIAS . ".child_id"
5454
. ' AND status_global_attr.attribute_id = ' . (int)$statusAttribute->getAttributeId()
5555
. ' AND status_global_attr.store_id = ' . Store::DEFAULT_STORE_ID,
5656
[]
5757
);
5858

5959
$select->joinLeft(
6060
['status_attr' => $statusAttribute->getBackendTable()],
61-
"status_attr.entity_id = " . self::PRODUCT_RELATION_ALIAS . ".entity_id"
61+
"status_attr.entity_id = " . self::PRODUCT_RELATION_ALIAS . ".child_id"
6262
. ' AND status_attr.attribute_id = ' . (int)$statusAttribute->getAttributeId()
6363
. ' AND status_attr.store_id = ' . $this->storeResolver->getCurrentStoreId(),
6464
[]

app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Product/StatusBaseSelectProcessorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public function testProcess()
8080
->with(
8181
['status_global_attr' => $backendTable],
8282
"status_global_attr.entity_id = "
83-
. BaseSelectProcessorInterface::PRODUCT_RELATION_ALIAS . ".entity_id"
83+
. BaseSelectProcessorInterface::PRODUCT_RELATION_ALIAS . ".child_id"
8484
. " AND status_global_attr.attribute_id = {$attributeId}"
8585
. ' AND status_global_attr.store_id = ' . Store::DEFAULT_STORE_ID,
8686
[]
@@ -90,7 +90,7 @@ public function testProcess()
9090
->method('joinLeft')
9191
->with(
9292
['status_attr' => $backendTable],
93-
"status_attr.entity_id = " . BaseSelectProcessorInterface::PRODUCT_RELATION_ALIAS . ".entity_id"
93+
"status_attr.entity_id = " . BaseSelectProcessorInterface::PRODUCT_RELATION_ALIAS . ".child_id"
9494
. " AND status_attr.attribute_id = {$attributeId}"
9595
. " AND status_attr.store_id = {$currentStoreId}",
9696
[]

app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Indexer/Price/Configurable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ protected function _applyConfigurableOption()
211211
. ' AND status_attr.store_id = ' . $this->storeResolver->getCurrentStoreId(),
212212
[]
213213
)->where(
214-
'product_status.value=' . ProductStatus::STATUS_ENABLED
214+
'IFNULL(status_attr.value, status_global_attr.value) = ?', ProductStatus::STATUS_ENABLED
215215
)->group(
216216
['l.parent_id', 'i.customer_group_id', 'i.website_id', 'l.product_id']
217217
);

dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/ResourceModel/Product/Indexer/Price/ConfigurableTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use Magento\TestFramework\Helper\Bootstrap;
1515

1616
/**
17-
* @magentoAppArea adminhtml
17+
* @magentoAppIsolation enabled
1818
*/
1919
class ConfigurableTest extends \PHPUnit_Framework_TestCase
2020
{

0 commit comments

Comments
 (0)