Skip to content

Commit

Permalink
Version 1.2.1
Browse files Browse the repository at this point in the history
Support for Magento v2.4.4 and PHP v8.0
  • Loading branch information
jordanroper authored Jun 30, 2022
1 parent 9550149 commit 2a65b29
Show file tree
Hide file tree
Showing 38 changed files with 946 additions and 482 deletions.
134 changes: 68 additions & 66 deletions Block/ConfigurationSettingsInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,92 +15,94 @@

/**
* Interface ConfigurationSettingsInterface
* @package Bloomreach\Connector\Block
* package Bloomreach\Connector\Block
*/
interface ConfigurationSettingsInterface
{
/**
* Store config path constants for settings tab
* Store config path public constants for settings tab
*/
const SETTINGS_GENERAL_PATH = 'bloomreach_settings/general';
const SETTINGS_ACC_ID = self::SETTINGS_GENERAL_PATH . '/accountid';
const SETTINGS_AUTH_KEY = self::SETTINGS_GENERAL_PATH . '/auth_key';
const SETTINGS_DOMAIN_KEY = self::SETTINGS_GENERAL_PATH . '/domain_key';
const SETTINGS_TRACKING_COOKIE = self::SETTINGS_GENERAL_PATH . '/tracking_cookie';
const SETTINGS_SEARCH_ENDPOINT = self::SETTINGS_GENERAL_PATH . '/search_endpoint';
const SETTINGS_AUTOSUGGEST_ENDPOINT = self::SETTINGS_GENERAL_PATH . '/autosuggest_endpoint';
public const SETTINGS_GENERAL_PATH = 'bloomreach_settings/general';
public const SETTINGS_ACC_ID = self::SETTINGS_GENERAL_PATH . '/accountid';
public const SETTINGS_AUTH_KEY = self::SETTINGS_GENERAL_PATH . '/auth_key';
public const SETTINGS_DOMAIN_KEY = self::SETTINGS_GENERAL_PATH . '/domain_key';
public const SETTINGS_TRACKING_COOKIE = self::SETTINGS_GENERAL_PATH . '/tracking_cookie';
public const SETTINGS_SEARCH_ENDPOINT = self::SETTINGS_GENERAL_PATH . '/search_endpoint';
public const SETTINGS_AUTOSUGGEST_ENDPOINT = self::SETTINGS_GENERAL_PATH . '/autosuggest_endpoint';

/**
* Store config path constants for settings endpoint tab
* Store config path public constants for settings endpoint tab
*/
const SETTINGS_APIURL_PATH = 'bloomreach_settings/api_url';
const SETTINGS_ENDPOINT_AUTOSUGGEST = self::SETTINGS_APIURL_PATH . '/autosuggest_endpoint';
const SETTINGS_ENDPOINT_SEARCH = self::SETTINGS_APIURL_PATH . '/search_endpoint';
const SETTINGS_ENDPOINT_CATEGORY = self::SETTINGS_APIURL_PATH . '/category_endpoint';
const SETTINGS_ENDPOINT_WIDGETS = self::SETTINGS_APIURL_PATH . '/widgets_endpoint';
public const SETTINGS_APIURL_PATH = 'bloomreach_settings/api_url';
public const SETTINGS_ENDPOINT_AUTOSUGGEST = self::SETTINGS_APIURL_PATH . '/autosuggest_endpoint';
public const SETTINGS_ENDPOINT_SEARCH = self::SETTINGS_APIURL_PATH . '/search_endpoint';
public const SETTINGS_ENDPOINT_CATEGORY = self::SETTINGS_APIURL_PATH . '/category_endpoint';
public const SETTINGS_ENDPOINT_WIDGETS = self::SETTINGS_APIURL_PATH . '/widgets_endpoint';

/**
* Store config path constant for Search Tab- Auto suggest
* Store config path public constant for Search Tab- Auto suggest
*/
const SEARCH_AUTOSUGGEST_PATH = 'bloomreach_search/autosuggest';
const SEARCH_ENABLED = self::SEARCH_AUTOSUGGEST_PATH . '/enabled';
const SEARCH_CSS_SELECTOR = self::SEARCH_AUTOSUGGEST_PATH . '/css_selector';
const SEARCH_SUGGESTED_TERM = self::SEARCH_AUTOSUGGEST_PATH . '/suggested_terms';
const SEARCH_SUGGESTED_PRODUCTS = self::SEARCH_AUTOSUGGEST_PATH . '/suggested_products';
const SEARCH_SUGGESTED_COLLECTION = self::SEARCH_AUTOSUGGEST_PATH . '/suggested_collection';
const SEARCH_CUSTOM_CSS = self::SEARCH_AUTOSUGGEST_PATH . '/custom_css';
const SEARCH_TEMPLATE_MAIN = self::SEARCH_AUTOSUGGEST_PATH . '/main_template_text';
public const SEARCH_AUTOSUGGEST_PATH = 'bloomreach_search/autosuggest';
public const SEARCH_ENABLED = self::SEARCH_AUTOSUGGEST_PATH . '/enabled';
public const SEARCH_CSS_SELECTOR = self::SEARCH_AUTOSUGGEST_PATH . '/css_selector';
public const SEARCH_SUGGESTED_TERM = self::SEARCH_AUTOSUGGEST_PATH . '/suggested_terms';
public const SEARCH_SUGGESTED_PRODUCTS = self::SEARCH_AUTOSUGGEST_PATH . '/suggested_products';
public const SEARCH_SUGGESTED_COLLECTION = self::SEARCH_AUTOSUGGEST_PATH . '/suggested_collection';
public const SEARCH_CUSTOM_CSS = self::SEARCH_AUTOSUGGEST_PATH . '/custom_css';
public const SEARCH_TEMPLATE_MAIN = self::SEARCH_AUTOSUGGEST_PATH . '/main_template_text';

/**
* Store config path constant for Search Tab- Site Search
* Store config path public constant for Search Tab- Site Search
*/
const SITESEARCH_PATH = 'bloomreach_search/sitesearch';
const SITESEARCH_ENABLED = self::SITESEARCH_PATH . '/enabled';
const SITESEARCH_CSS_SELECTOR = self::SITESEARCH_PATH . '/css_selector';
const SITESEARCH_ITEM_PER_PAGE = self::SITESEARCH_PATH . '/items_per_page';
const SITESEARCH_SHOW_VARIANTS = self::SITESEARCH_PATH . '/show_variants';
const SITESEARCH_SHOW_FACETS = self::SITESEARCH_PATH . '/show_facets';
const SITESEARCH_NO_OF_FACETS = self::SITESEARCH_PATH . '/no_of_facets';
const SITESEARCH_NO_OF_FACET_OPTIONS = self::SITESEARCH_PATH . '/no_of_facet_options';
const SITESEARCH_INFINITE_SCROLL = self::SITESEARCH_PATH . '/infinite_scroll';
const SITESEARCH_CUSTOM_CSS = self::SITESEARCH_PATH . '/custom_css';
const SITESEARCH_FIELD_LIST = self::SITESEARCH_PATH . '/field_list';
const SITESEARCH_TEMPLATE_MAIN = self::SITESEARCH_PATH . '/main_template_text';
const SITESEARCH_TEMPLATE_PRODUCTLIST = self::SITESEARCH_PATH . '/productlist_template_text';
public const SITESEARCH_PATH = 'bloomreach_search/sitesearch';
public const SITESEARCH_ENABLED = self::SITESEARCH_PATH . '/enabled';
public const SITESEARCH_CSS_SELECTOR = self::SITESEARCH_PATH . '/css_selector';
public const SITESEARCH_ITEM_PER_PAGE = self::SITESEARCH_PATH . '/items_per_page';
public const SITESEARCH_SHOW_VARIANTS = self::SITESEARCH_PATH . '/show_variants';
public const SITESEARCH_SHOW_FACETS = self::SITESEARCH_PATH . '/show_facets';
public const SITESEARCH_NO_OF_FACETS = self::SITESEARCH_PATH . '/no_of_facets';
public const SITESEARCH_NO_OF_FACET_OPTIONS = self::SITESEARCH_PATH . '/no_of_facet_options';
public const SITESEARCH_INFINITE_SCROLL = self::SITESEARCH_PATH . '/infinite_scroll';
public const SITESEARCH_CUSTOM_CSS = self::SITESEARCH_PATH . '/custom_css';
public const SITESEARCH_FIELD_LIST = self::SITESEARCH_PATH . '/field_list';
public const SITESEARCH_TEMPLATE_MAIN = self::SITESEARCH_PATH . '/main_template_text';
public const SITESEARCH_TEMPLATE_PRODUCTLIST = self::SITESEARCH_PATH . '/productlist_template_text';

/**
* Store config path constant for Collections Tab
* Store config path public constant for Collections Tab
*/
const COLLECTIONS_PATH = 'bloomreach_collections/general';
const COLLECTIONS_ENABLED = self::COLLECTIONS_PATH . '/enabled';
const COLLECTIONS_CSS_SELECTOR = self::COLLECTIONS_PATH . '/css_selector';
const COLLECTIONS_ITEMS_PER_PAGE = self::COLLECTIONS_PATH . '/items_per_page';
const COLLECTIONS_SHOW_FACETS = self::COLLECTIONS_PATH . '/show_facets';
const COLLECTIONS_NO_OF_FACETS = self::COLLECTIONS_PATH . '/no_of_facets';
const COLLECTIONS_NO_OF_FACET_OPTIONS = self::COLLECTIONS_PATH . '/no_of_facet_options';
const COLLECTIONS_SHOW_VARIANTS = self::COLLECTIONS_PATH . '/show_variants';
const COLLECTIONS_INFINITE_SCROLL = self::COLLECTIONS_PATH . '/infinite_scroll';
const COLLECTIONS_CUSTOM_CSS = self::COLLECTIONS_PATH . '/custom_css';
const COLLECTIONS_TEMPLATE_MAIN = self::COLLECTIONS_PATH . '/main_template_text';
const COLLECTIONS_TEMPLATE_PRODUCTLIST = self::COLLECTIONS_PATH . '/productlist_template_text';
const COLLECTIONS_FIELD_LIST = self::COLLECTIONS_PATH . '/field_list';
public const COLLECTIONS_PATH = 'bloomreach_collections/general';
public const COLLECTIONS_ENABLED = self::COLLECTIONS_PATH . '/enabled';
public const COLLECTIONS_CSS_SELECTOR = self::COLLECTIONS_PATH . '/css_selector';
public const COLLECTIONS_ITEMS_PER_PAGE = self::COLLECTIONS_PATH . '/items_per_page';
public const COLLECTIONS_SHOW_FACETS = self::COLLECTIONS_PATH . '/show_facets';
public const COLLECTIONS_NO_OF_FACETS = self::COLLECTIONS_PATH . '/no_of_facets';
public const COLLECTIONS_NO_OF_FACET_OPTIONS = self::COLLECTIONS_PATH . '/no_of_facet_options';
public const COLLECTIONS_SHOW_VARIANTS = self::COLLECTIONS_PATH . '/show_variants';
public const COLLECTIONS_INFINITE_SCROLL = self::COLLECTIONS_PATH . '/infinite_scroll';
public const COLLECTIONS_CUSTOM_CSS = self::COLLECTIONS_PATH . '/custom_css';
public const COLLECTIONS_TEMPLATE_MAIN = self::COLLECTIONS_PATH . '/main_template_text';
public const COLLECTIONS_TEMPLATE_PRODUCTLIST = self::COLLECTIONS_PATH . '/productlist_template_text';
public const COLLECTIONS_FIELD_LIST = self::COLLECTIONS_PATH . '/field_list';

/**
* Store config path constant for Recommendations Tab
* Store config path public constant for Recommendations Tab
*/
const RECOMM_PATH = 'bloomreach_recommendations/general';
const PIXEL_PATH = 'bloomreach_settings/pixel';
const RECOMM_PIXEL_ENABLED = self::PIXEL_PATH . '/enable_pixel';
const RECOMM_WIDGET_ENABLED = self::RECOMM_PATH . '/enable_recommendations';
const RECOMM_FIELD_LIST = self::RECOMM_PATH . '/field_list';
public const RECOMM_PATH = 'bloomreach_recommendations/general';
public const PIXEL_PATH = 'bloomreach_settings/pixel';
public const RECOMM_PIXEL_ENABLED = self::PIXEL_PATH . '/enable_pixel';
public const RECOMM_WIDGET_ENABLED = self::RECOMM_PATH . '/enable_recommendations';
public const RECOMM_FIELD_LIST = self::RECOMM_PATH . '/field_list';
public const RECOMM_CUSTOM_CSS = self::RECOMM_PATH . '/custom_css';
public const RECOMM_TEMPLATE_TEXT = self::RECOMM_PATH . '/template_text';

const STAGING_API_ENDPOINT_WIDGET = 'https://pathways-staging.dxpapi.com/api/v2/widgets/';
const STAGING_API_ENDPOINT_AUTOSUGGEST = 'https://staging-suggest.dxpapi.com/api/v1/suggest/';
const STAGING_API_ENDPOINT_SEARCH = 'https://staging-core.dxpapi.com/api/v1/core/';
const STAGING_API_ENDPOINT_COLLECTION = 'https://staging-core.dxpapi.com/api/v1/core/';
public const STAGING_API_ENDPOINT_WIDGET = 'https://pathways-staging.dxpapi.com/api/v2/widgets/';
public const STAGING_API_ENDPOINT_AUTOSUGGEST = 'https://staging-suggest.dxpapi.com/api/v2/suggest/';
public const STAGING_API_ENDPOINT_SEARCH = 'https://staging-core.dxpapi.com/api/v1/core/';
public const STAGING_API_ENDPOINT_COLLECTION = 'https://staging-core.dxpapi.com/api/v1/core/';

const PRODUCTION_API_ENDPOINT_WIDGET = 'https://pathways.dxpapi.com/api/v2/widgets/';
const PRODUCTION_API_ENDPOINT_AUTOSUGGEST = 'https://suggest.dxpapi.com/api/v1/suggest/';
const PRODUCTION_API_ENDPOINT_SEARCH = 'https://core.dxpapi.com/api/v1/core/';
const PRODUCTION_API_ENDPOINT_COLLECTION = 'https://core.dxpapi.com/api/v1/core/';
public const PRODUCTION_API_ENDPOINT_WIDGET = 'https://pathways.dxpapi.com/api/v2/widgets/';
public const PRODUCTION_API_ENDPOINT_AUTOSUGGEST = 'https://suggest.dxpapi.com/api/v2/suggest/';
public const PRODUCTION_API_ENDPOINT_SEARCH = 'https://core.dxpapi.com/api/v1/core/';
public const PRODUCTION_API_ENDPOINT_COLLECTION = 'https://core.dxpapi.com/api/v1/core/';
}
12 changes: 10 additions & 2 deletions Block/System/Config/Form/Field/AddApiCta.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@

/**
* Class AddApiCta
* @package Bloomreach\Connector\Block\System\Config\Form\Field
* package Bloomreach\Connector\Block\System\Config\Form\Field
*/
class AddApiCta extends CtaButtonAbstract
{
/**
* Initialise class variables after constructor call
*
* @return void
*/
public function _afterConstruct()
Expand All @@ -42,15 +43,22 @@ public function getButtonUrl()

/**
* Get additional text after button
*
* @return string
*/
public function getAfterButtonAdditionalText()
{
return '<a href="#"><span>' . __('Learn More') . '</span></a>';
}

/**
* Get additional text before button
*
* @return string
*/
public function getBeforeButtonAdditionalText()
{
return __("We are excited for you to get started with industry leading Search, Merchandising, & Recommendations! To begin, go to the Settings tab and enter your API credentials.");
return __("We are excited for you to get started with industry leading Search, Merchandising,
& Recommendations! To begin, go to the Settings tab and enter your API credentials.");
}
}
5 changes: 3 additions & 2 deletions Block/System/Config/Form/Field/ContactCta.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

/**
* Class ContactNote
* @package Bloomreach\Connector\Block\System\Config\Form\Field
* package Bloomreach\Connector\Block\System\Config\Form\Field
*/
class ContactCta extends Field
{
Expand All @@ -31,7 +31,8 @@ class ContactCta extends Field
protected function _getElementHtml(AbstractElement $element)
{
$html = __("We're here to you be successful, reach out with any questions.");
$html .= "<br/>" . __("Most questions can be addressed to your onboarding team of account specialists. If other questions arise, feel free to reach out to our global team.");
$html .= "<br/>" . __("Most questions can be addressed to your onboarding team of account specialists.
If other questions arise, feel free to reach out to our global team.");
$html .= "<br/><a href='tel:+1 (847) 444 4779'>+1 (877) 414 4776</a>";
$html .= "<br/>" . __('82 Pioneer way,');
$html .= "<br/>" . __('Mountain View, CA');
Expand Down
21 changes: 21 additions & 0 deletions Block/System/Config/Form/Field/CtaButtonAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,15 @@ abstract class CtaButtonAbstract extends Field
* @var string
*/
protected $_template = 'Bloomreach_Connector::system/config/field/cta_button.phtml';

/**
* @var string
*/
protected $_buttonId;

/**
* @var string
*/
protected $_buttonLabel;

/**
Expand All @@ -44,6 +52,7 @@ public function __construct(

/**
* Initialise class variables after constructor call
*
* @return void
*/
abstract public function _afterConstruct();
Expand All @@ -62,6 +71,7 @@ public function render(AbstractElement $element)

/**
* Return Button Id
*
* @return string
*/
public function getButtonId()
Expand All @@ -71,6 +81,7 @@ public function getButtonId()

/**
* Return Button Label
*
* @return string
*/
public function getButtonLabel()
Expand All @@ -96,11 +107,21 @@ protected function _getElementHtml(AbstractElement $element)
*/
abstract public function getButtonUrl();

/**
* Return button text
*
* @return string
*/
public function getAfterButtonAdditionalText()
{
return '';
}

/**
* Return button text
*
* @return string
*/
public function getBeforeButtonAdditionalText()
{
return '';
Expand Down
3 changes: 2 additions & 1 deletion Block/System/Config/Form/Field/EndPointCta.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@

/**
* Class EndPointCta
* @package Bloomreach\Connector\Block\System\Config\Form\Field
* package Bloomreach\Connector\Block\System\Config\Form\Field
*/
class EndPointCta extends CtaButtonAbstract
{
/**
* Initialise class variables after constructor call
*
* @return void
*/
public function _afterConstruct()
Expand Down
8 changes: 7 additions & 1 deletion Block/System/Config/Form/Field/EnterpriseCta.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@

/**
* Class MarketingCta
* @package Bloomreach\Connector\Block\System\Config\Form\Field
* package Bloomreach\Connector\Block\System\Config\Form\Field
*/
class EnterpriseCta extends CtaButtonAbstract
{
/**
* Initialise class variables after constructor call
*
* @return void
*/
public function _afterConstruct()
Expand All @@ -40,6 +41,11 @@ public function getButtonUrl()
return 'https://www.bloomreach.com/en/products/bloomreach-experience/search';
}

/**
* Get additional text before button
*
* @return string
*/
public function getBeforeButtonAdditionalText()
{
return __("Bloomreach's AI-driven Search for eCommerce allows your teams to create a sophisticated search and product discovery experience that drives conversions and revenue. Our set of AI-driven merchandising tools to help you make impactful and effective changes that convert more traffic.");
Expand Down
3 changes: 2 additions & 1 deletion Block/System/Config/Form/Field/IndexingCta.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@

/**
* Class IndexingCta
* @package Bloomreach\Connector\Block\System\Config\Form\Field
* package Bloomreach\Connector\Block\System\Config\Form\Field
*/
class IndexingCta extends CtaButtonAbstract
{
/**
* Initialise class variables after constructor call
*
* @return void
*/
public function _afterConstruct()
Expand Down
11 changes: 9 additions & 2 deletions Block/System/Config/Form/Field/MerchandisingCta.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@

/**
* Class MerchandisingCta
* @package Bloomreach\Connector\Block\System\Config\Form\Field
* package Bloomreach\Connector\Block\System\Config\Form\Field
*/
class MerchandisingCta extends CtaButtonAbstract
{
/**
* Initialise class variables after constructor call
*
* @return void
*/
public function _afterConstruct()
Expand All @@ -40,8 +41,14 @@ public function getButtonUrl()
return 'https://tools.bloomreach.com/navapp/commerce/tools/RankingManager/category';
}

/**
* Get additional text before button
*
* @return string
*/
public function getBeforeButtonAdditionalText()
{
return __('Identify top performing collections(Categories) and improve product ranking. Bloomreach must be enabled on Collection(Category) to benefit from Merchandising adjustment.');
return __('Identify top performing collections(Categories) and improve product ranking.
Bloomreach must be enabled on Collection(Category) to benefit from Merchandising adjustment.');
}
}
8 changes: 7 additions & 1 deletion Block/System/Config/Form/Field/OptimizeCta.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@

/**
* Class OptimizeCta
* @package Bloomreach\Connector\Block\System\Config\Form\Field
* package Bloomreach\Connector\Block\System\Config\Form\Field
*/
class OptimizeCta extends CtaButtonAbstract
{
/**
* Initialise class variables after constructor call
*
* @return void
*/
public function _afterConstruct()
Expand All @@ -40,6 +41,11 @@ public function getButtonUrl()
return 'https://documentation.bloomreach.com/user-guides/search-and-merchandising/product-grid-merchandising/product-grid-merchandising.html';
}

/**
* Get additional text before button
*
* @return string
*/
public function getBeforeButtonAdditionalText()
{
return __('Do more with less data by leveraging already trained algorithms to optimize the search result out of the box. Automatically optimize customer journeys based on query and performance data of your storefront. Optimize every search query for your business goals.');
Expand Down
Loading

0 comments on commit 2a65b29

Please sign in to comment.