File tree Expand file tree Collapse file tree 1 file changed +30
-5
lines changed Expand file tree Collapse file tree 1 file changed +30
-5
lines changed Original file line number Diff line number Diff line change @@ -310,11 +310,7 @@ public function getAlgoliaCookieDuration($storeId = null)
310
310
*/
311
311
public function getProductAdditionalAttributes ($ storeId = null )
312
312
{
313
- $ attributes = $ this ->serializer ->unserialize ($ this ->configInterface ->getValue (
314
- self ::PRODUCT_ATTRIBUTES ,
315
- ScopeInterface::SCOPE_STORE ,
316
- $ storeId
317
- ));
313
+ $ attributes = $ this ->getProductAttributesList ($ storeId );
318
314
319
315
$ facets = $ this ->serializer ->unserialize ($ this ->configInterface ->getValue (
320
316
self ::FACETS ,
@@ -520,6 +516,35 @@ public function useVirtualReplica(?int $storeId = null): bool
520
516
));
521
517
}
522
518
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
+
523
548
// --- Categories --- //
524
549
/**
525
550
* @param $storeId
You can’t perform that action at this time.
0 commit comments