Skip to content

Commit df58a1e

Browse files
authored
Update Sorts Function
1 parent bc8ee3d commit df58a1e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Model/Backend/Sorts.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,12 @@ public function afterSave()
7474
if ($this->isValueChanged()) {
7575
try{
7676
$oldValue = $this->serializer->unserialize($this->getOldValue());
77+
$updatedValue = $this->serializer->unserialize($this->getValue());
78+
$sortingAttributes = array_merge($oldValue, $updatedValue);
7779
$storeIds = array_keys($this->storeManager->getStores());
7880
foreach ($storeIds as $storeId) {
7981
$indexName = $this->helper->getIndexName($this->productHelper->getIndexNameSuffix(), $storeId);
80-
$this->productHelper->handlingReplica($indexName, $storeId, $oldValue);
82+
$this->productHelper->handlingReplica($indexName, $storeId, $sortingAttributes);
8183
}
8284
} catch (AlgoliaException $e) {
8385
if ($e->getCode() !== 404) {

0 commit comments

Comments
 (0)