6 declare(strict_types=1);
22 private $catalogConfig;
27 private $storeManager;
32 private $sortbyAttributeSource;
40 \
Magento\Catalog\Model\Config $catalogConfig,
41 \
Magento\Store\Model\StoreManagerInterface $storeManager,
42 \
Magento\Catalog\Model\Category\Attribute\Source\Sortby $sortbyAttributeSource
44 $this->catalogConfig = $catalogConfig;
46 $this->sortbyAttributeSource = $sortbyAttributeSource;
54 $sortFieldsOptions = $this->sortbyAttributeSource->getAllOptions();
62 'default' => $this->catalogConfig->getProductListDefaultSortBy($this->storeManager->getStore()->getId()),
63 'options' => $sortFieldsOptions,
__construct(\Magento\Catalog\Model\Config $catalogConfig, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Category\Attribute\Source\Sortby $sortbyAttributeSource)
resolve(Field $field, $context, ResolveInfo $info, array $value=null, array $args=null)
foreach( $_productCollection as $_product)() ?>" class $info