Skip to content

Commit 4110942

Browse files
committed
MAGE-1374 Restore changes introduced on PR #1781
1 parent fb74bdb commit 4110942

File tree

1 file changed

+30
-5
lines changed

1 file changed

+30
-5
lines changed

Helper/ConfigHelper.php

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -310,11 +310,7 @@ public function getAlgoliaCookieDuration($storeId = null)
310310
*/
311311
public function getProductAdditionalAttributes($storeId = null)
312312
{
313-
$attributes = $this->serializer->unserialize($this->configInterface->getValue(
314-
self::PRODUCT_ATTRIBUTES,
315-
ScopeInterface::SCOPE_STORE,
316-
$storeId
317-
));
313+
$attributes = $this->getProductAttributesList($storeId);
318314

319315
$facets = $this->serializer->unserialize($this->configInterface->getValue(
320316
self::FACETS,
@@ -520,6 +516,35 @@ public function useVirtualReplica(?int $storeId = null): bool
520516
));
521517
}
522518

519+
/**
520+
* @param $attributes
521+
* @param $attributeName
522+
* @return bool
523+
*/
524+
public function isAttributeInList($attributes, $attributeName): bool
525+
{
526+
foreach ($attributes as $attr) {
527+
if ($attr['attribute'] === $attributeName) {
528+
return true;
529+
}
530+
}
531+
532+
return false;
533+
}
534+
535+
/**
536+
* @param $storeId
537+
* @return mixed
538+
*/
539+
public function getProductAttributesList($storeId = null)
540+
{
541+
return $this->serializer->unserialize($this->configInterface->getValue(
542+
self::PRODUCT_ATTRIBUTES,
543+
ScopeInterface::SCOPE_STORE,
544+
$storeId
545+
));
546+
}
547+
523548
// --- Categories --- //
524549
/**
525550
* @param $storeId

0 commit comments

Comments
 (0)