Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typo in SQL join when joining custom option prices for price indexer #19546

Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ public function modifyPrice(IndexTableStructure $priceTable, array $entityIds =
}

/**
* Check if custom options exist.
*
* @param IndexTableStructure $priceTable
* @return bool
* @throws \Exception
Expand Down Expand Up @@ -154,6 +156,8 @@ private function checkIfCustomOptionsExist(IndexTableStructure $priceTable): boo
}

/**
* Get connection.
*
* @return \Magento\Framework\DB\Adapter\AdapterInterface
*/
private function getConnection()
Expand Down Expand Up @@ -211,7 +215,7 @@ private function getSelectForOptionsWithMultipleValues(string $sourceTable): Sel
} else {
$select->joinLeft(
['otps' => $this->getTable('catalog_product_option_type_price')],
'otps.option_type_id = otpd.option_type_id AND otpd.store_id = cwd.default_store_id',
'otps.option_type_id = otpd.option_type_id AND otps.store_id = cwd.default_store_id',
[]
);

Expand Down Expand Up @@ -373,6 +377,8 @@ private function getSelectAggregated(string $sourceTable): Select
}

/**
* Get select for update.
*
* @param string $sourceTable
* @return \Magento\Framework\DB\Select
*/
Expand Down Expand Up @@ -402,6 +408,8 @@ private function getSelectForUpdate(string $sourceTable): Select
}

/**
* Get table name.
*
* @param string $tableName
* @return string
*/
Expand All @@ -411,6 +419,8 @@ private function getTable(string $tableName): string
}

/**
* Is price scope global.
*
* @return bool
*/
private function isPriceGlobal(): bool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

/**
* Default Product Type Price Indexer Resource model
*
* For correctly work need define product type id
*
* @api
Expand Down Expand Up @@ -208,6 +209,8 @@ public function reindexEntity($entityIds)
}

/**
* Reindex prices.
*
* @param null|int|array $entityIds
* @return \Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\DefaultPrice
*/
Expand Down Expand Up @@ -604,7 +607,7 @@ protected function _applyCustomOption()
[]
)->joinLeft(
['otps' => $this->getTable('catalog_product_option_type_price')],
'otps.option_type_id = otpd.option_type_id AND otpd.store_id = cs.store_id',
'otps.option_type_id = otpd.option_type_id AND otps.store_id = cs.store_id',
[]
)->group(
['i.entity_id', 'i.customer_group_id', 'i.website_id', 'o.option_id']
Expand Down Expand Up @@ -802,6 +805,8 @@ public function getIdxTable($table = null)
}

/**
* Check if product exists.
*
* @return bool
*/
protected function hasEntity()
Expand All @@ -823,6 +828,8 @@ protected function hasEntity()
}

/**
* Get total tier price expression.
*
* @param \Zend_Db_Expr $priceExpression
* @return \Zend_Db_Expr
*/
Expand Down Expand Up @@ -863,6 +870,8 @@ private function getTotalTierPriceExpression(\Zend_Db_Expr $priceExpression)
}

/**
* Get tier price expression for table.
*
* @param string $tableAlias
* @param \Zend_Db_Expr $priceExpression
* @return \Zend_Db_Expr
Expand Down