Skip to content

Commit

Permalink
Merge pull request #1641 from algolia/epic/MAGE-978-multi-app-ids
Browse files Browse the repository at this point in the history
MAGE-978: Multi-Application IDs
  • Loading branch information
damcou authored Nov 14, 2024
2 parents 02a9ebd + 748020e commit 719c790
Show file tree
Hide file tree
Showing 35 changed files with 1,361 additions and 1,434 deletions.
3 changes: 0 additions & 3 deletions Block/Adminhtml/LandingPage/SearchConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ class SearchConfiguration extends \Magento\Backend\Block\Template
/** @var Data */
private $coreHelper;

/** @var int */
protected $planLevel;

/**
* @param Context $context
* @param SessionManagerInterface $backendSession
Expand Down
39 changes: 9 additions & 30 deletions Helper/AdapterHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,22 @@

use Algolia\AlgoliaSearch\Helper\Adapter\FiltersHelper;
use Algolia\AlgoliaSearch\Helper\Data as AlgoliaDataHelper;
use Algolia\AlgoliaSearch\Service\AlgoliaCredentialsManager;
use Magento\CatalogSearch\Helper\Data as CatalogSearchDataHelper;

class AdapterHelper
{
public const INSTANTSEARCH_ORDER_PARAM = 'sortBy';
public const BACKEND_ORDER_PARAM = 'product_list_order';

/** @var CatalogSearchDataHelper */
private $catalogSearchHelper;

/** @var AlgoliaDataHelper */
private $algoliaHelper;

/** @var FiltersHelper */
private $filtersHelper;

/** @var ConfigHelper */
private $configHelper;

/**
* @param CatalogSearchDataHelper $catalogSearchHelper
* @param AlgoliaDataHelper $algoliaHelper
* @param FiltersHelper $filtersHelper
* @param ConfigHelper $configHelper
*/
public function __construct(
CatalogSearchDataHelper $catalogSearchHelper,
AlgoliaDataHelper $algoliaHelper,
FiltersHelper $filtersHelper,
ConfigHelper $configHelper
) {
$this->catalogSearchHelper = $catalogSearchHelper;
$this->algoliaHelper = $algoliaHelper;
$this->filtersHelper = $filtersHelper;
$this->configHelper = $configHelper;
}
protected CatalogSearchDataHelper $catalogSearchHelper,
protected AlgoliaDataHelper $algoliaHelper,
protected FiltersHelper $filtersHelper,
protected ConfigHelper $configHelper,
protected AlgoliaCredentialsManager $algoliaCredentialsManager
)
{}

/**
* Get search result from Algolia
Expand Down Expand Up @@ -142,8 +122,7 @@ public function isAllowed()
$storeId = $this->getStoreId();

return
$this->configHelper->getApplicationID($storeId)
&& $this->configHelper->getAPIKey($storeId)
$this->algoliaCredentialsManager->checkCredentials($storeId)
&& $this->configHelper->isEnabledFrontEnd($storeId)
&& $this->configHelper->makeSeoRequest($storeId);
}
Expand Down
Loading

0 comments on commit 719c790

Please sign in to comment.