Skip to content

Commit

Permalink
0.7.4: #85
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrii-fediuk committed Dec 13, 2017
1 parent e94bb75 commit f79097a
Show file tree
Hide file tree
Showing 3 changed files with 114 additions and 41 deletions.
5 changes: 4 additions & 1 deletion ConfigProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ protected function config() {return
* @return array(string => mixed)
*/
private function option($id) {$s = $this->s(); return [$id => [
'enable' => $s->b("$id/enable") && $s->applicableForQuote($id)
'enable' =>
$s->b("$id/enable")
&& $s->applicableForQuoteByMinMaxTotal($id)
&& $s->applicableForQuoteByCountry($id)
/**
* 2017-12-13
* 1) "Provide an ability to the Magento backend users (merchants)
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mage2pro/alphacommercehub"
,"version": "0.7.3"
,"version": "0.7.4"
,"description": "AlphaCommerceHub integration with Magento 2"
,"type": "magento2-module"
,"homepage": "https://mage2.pro/c/extensions/alphacommercehub"
Expand All @@ -11,7 +11,7 @@
"homepage": "https://mage2.pro/users/dmitry_fedyuk",
"role": "Developer"
}]
,"require": {"mage2pro/core": ">=3.4.11"}
,"require": {"mage2pro/core": ">=3.5.0"}
,"autoload": {"files": ["registration.php"], "psr-4": {"Dfe\\AlphaCommerceHub\\": ""}}
,"keywords": [
"3D Secure"
Expand Down
146 changes: 108 additions & 38 deletions etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -310,44 +310,6 @@ So the `sortOrder` value is 1920. -->
<config_path>df_payment/alpha_commerce_hub/dsd</config_path>
<validate>validate-length maximum-length-22</validate>
</field>
<field
id='country_restriction'
translate='label'
type='select'
sortOrder='33'
showInDefault='1'
showInWebsite='1'
showInStore='1'
>
<config_path>df_payment/alpha_commerce_hub/country_restriction</config_path>
<label>Country Restriction</label>
<source_model>Df\Config\Source\NoWhiteBlack</source_model>
<depends><field id='enable'>1</field></depends>
</field>
<field
id='countries'
translate='label'
type='Df\Framework\Form\Element\Multiselect'
sortOrder='34'
showInDefault='1'
showInWebsite='1'
showInStore='1'
>
<label>Countries</label>
<source_model>Magento\Directory\Model\Config\Source\Country</source_model>
<can_be_empty>1</can_be_empty>
<comment><![CDATA[Customers from which countries can (or can not) use the method?]]></comment>
<config_path>df_payment/alpha_commerce_hub/countries</config_path>
<depends>
<field id='enable'>1</field>
<!--
2016-03-08
«The negative syntax for a backend config field <depends> condition»
https://mage2.pro/t/329
-->
<field id='country_restriction' negative='1'>0</field>
</depends>
</field>
</group>
<group
id='CC'
Expand Down Expand Up @@ -443,6 +405,42 @@ So the `sortOrder` value is 1920. -->
<label>Maximum Order Total</label>
<validate>validate-number validate-greater-than-zero</validate>
</field>
<field
id='country_restriction'
translate='label'
type='select'
sortOrder='7'
showInDefault='1'
showInWebsite='1'
showInStore='1'
>
<label>Country Restriction</label>
<source_model>Df\Config\Source\NoWhiteBlack</source_model>
<depends><field id='enable'>1</field></depends>
</field>
<field
id='countries'
translate='label'
type='Df\Framework\Form\Element\Multiselect'
sortOrder='8'
showInDefault='1'
showInWebsite='1'
showInStore='1'
>
<label>Countries</label>
<source_model>Magento\Directory\Model\Config\Source\Country</source_model>
<can_be_empty>1</can_be_empty>
<comment><![CDATA[Customers from which countries can (or can not) use the bank card payment option?]]></comment>
<depends>
<field id='enable'>1</field>
<!--
2016-03-08
«The negative syntax for a backend config field <depends> condition»
https://mage2.pro/t/329
-->
<field id='country_restriction' negative='1'>0</field>
</depends>
</field>
<group
id='3ds'
showInDefault='1' showInStore='1' showInWebsite='1'
Expand Down Expand Up @@ -602,6 +600,42 @@ So the `sortOrder` value is 1920. -->
<label>Maximum Order Total</label>
<validate>validate-number validate-greater-than-zero</validate>
</field>
<field
id='country_restriction'
translate='label'
type='select'
sortOrder='6'
showInDefault='1'
showInWebsite='1'
showInStore='1'
>
<label>Country Restriction</label>
<source_model>Df\Config\Source\NoWhiteBlack</source_model>
<depends><field id='enable'>1</field></depends>
</field>
<field
id='countries'
translate='label'
type='Df\Framework\Form\Element\Multiselect'
sortOrder='7'
showInDefault='1'
showInWebsite='1'
showInStore='1'
>
<label>Countries</label>
<source_model>Magento\Directory\Model\Config\Source\Country</source_model>
<can_be_empty>1</can_be_empty>
<comment><![CDATA[Customers from which countries can (or can not) use the PayPal payment option?]]></comment>
<depends>
<field id='enable'>1</field>
<!--
2016-03-08
«The negative syntax for a backend config field <depends> condition»
https://mage2.pro/t/329
-->
<field id='country_restriction' negative='1'>0</field>
</depends>
</field>
</group>
<group
id='PO'
Expand Down Expand Up @@ -672,6 +706,42 @@ So the `sortOrder` value is 1920. -->
<label>Maximum Order Total</label>
<validate>validate-number validate-greater-than-zero</validate>
</field>
<field
id='country_restriction'
translate='label'
type='select'
sortOrder='6'
showInDefault='1'
showInWebsite='1'
showInStore='1'
>
<label>Country Restriction</label>
<source_model>Df\Config\Source\NoWhiteBlack</source_model>
<depends><field id='enable'>1</field></depends>
</field>
<field
id='countries'
translate='label'
type='Df\Framework\Form\Element\Multiselect'
sortOrder='7'
showInDefault='1'
showInWebsite='1'
showInStore='1'
>
<label>Countries</label>
<source_model>Magento\Directory\Model\Config\Source\Country</source_model>
<can_be_empty>1</can_be_empty>
<comment><![CDATA[Customers from which countries can (or can not) use the POLi Payments option?]]></comment>
<depends>
<field id='enable'>1</field>
<!--
2016-03-08
«The negative syntax for a backend config field <depends> condition»
https://mage2.pro/t/329
-->
<field id='country_restriction' negative='1'>0</field>
</depends>
</field>
</group>
</group>
</section>
Expand Down

0 comments on commit f79097a

Please sign in to comment.