Skip to content

Commit

Permalink
Ensure store-scoped values are selected before default (OpenMage#2966)
Browse files Browse the repository at this point in the history
Co-authored-by: Fabrizio Balliano <fabrizio.balliano@gmail.com>
Co-authored-by: Colin Mollenhour <colin@mollenhour.com>
  • Loading branch information
3 people authored May 12, 2023
1 parent d39d289 commit 4da40b1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/code/core/Mage/Catalog/Model/Resource/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ protected function _getLoadAttributesSelect($object, $table)
->from(['attr_table' => $table], [])
->where("attr_table.{$this->getEntityIdField()} = ?", $object->getId())
->where('attr_table.store_id IN (?)', $storeIds);
if (count($storeIds) > 1) {
$select->order('attr_table.store_id ASC');
}
if ($setId) {
$select->join(
['set_table' => $this->getTable('eav/entity_attribute')],
Expand Down

0 comments on commit 4da40b1

Please # to comment.