Skip to content

Commit 168e65a

Browse files
committed
Created Source Model for Analytics region
1 parent e360b68 commit 168e65a

File tree

2 files changed

+21
-7
lines changed

2 files changed

+21
-7
lines changed

Model/Source/AnalyticsRegion.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
namespace Algolia\AlgoliaSearch\Model\Source;
4+
5+
use Magento\Framework\Option\ArrayInterface;
6+
7+
class AnalyticsRegion implements ArrayInterface
8+
{
9+
public function toOptionArray()
10+
{
11+
return [
12+
['value' => 'us', 'label' => __('United States')],
13+
['value' => 'de', 'label' => __('Europe (Germany)')],
14+
];
15+
}
16+
}

etc/adminhtml/system.xml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,13 @@
111111
</field>
112112
</group>
113113
<group id="algolia_cookie_configuration" translate="label" type="text" sortOrder="70" showInDefault="1" showInWebsite="1" showInStore="1">
114-
<label>Algolia Cookie Configuration</label>
114+
<label>Algolia Cookie Configuration</label>
115115
<attribute type="expanded">1</attribute>
116116
<comment>
117117
<![CDATA[
118118
If your Magento cookie settings, specifically <b>General > Web > Default Cookie Settings > Cookie Restriction Mode</b> is set to "No," we will consider it as Implicit Cookie Consent. In this case, the useCookie will be set to True by default for all insight events. Conversely, if <b>Cookie Restriction Mode is set to 'Yes,'</b> Insight events will not be allowed without explicit cookie consent.
119119
]]>
120-
</comment>
120+
</comment>
121121
<field id="default_consent_cookie_name" translate="label comment" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
122122
<label>Consent Cookie Name</label>
123123
<comment>
@@ -1170,7 +1170,7 @@
11701170
<field id="customer_groups_enable" translate="label comment" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
11711171
<label>Enable Customer Groups</label>
11721172
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
1173-
<backend_model>Algolia\AlgoliaSearch\Model\Backend\Replica</backend_model>
1173+
<backend_model>Algolia\AlgoliaSearch\Model\Backend\Replica</backend_model>
11741174
<comment>
11751175
<![CDATA[
11761176
Do you want to take into account customer groups and display the price of the logged-in group instead of the default price?
@@ -1259,11 +1259,9 @@
12591259
If your Algolia plan allows a higher record size limit, you can customize the record size limit.]]>
12601260
</comment>
12611261
</field>
1262-
<field id="analytics_region" translate="label comment" type="text" sortOrder="96" showInDefault="1">
1262+
<field id="analytics_region" translate="label comment" type="select" sortOrder="96" showInDefault="1">
12631263
<label>Analytics Region</label>
1264-
<comment>
1265-
<![CDATA[Default value is 'us']]>
1266-
</comment>
1264+
<source_model>Algolia\AlgoliaSearch\Model\Source\AnalyticsRegion</source_model>
12671265
</field>
12681266
</group>
12691267
<group id="queue" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">

0 commit comments

Comments
 (0)