@@ -465,12 +465,12 @@ |
||
465 | 465 | $minAmount = $this->getMinAmount(); |
466 | 466 | $finalPrice = $this->getFinalPrice(); |
467 | 467 | |
468 | - if (isset($maxAmount, $minAmount, $finalPrice) && $maxAmount!='0') { |
|
469 | - if ($finalPrice>=$minAmount && $finalPrice<=$maxAmount) { |
|
468 | + if (isset($maxAmount, $minAmount, $finalPrice) && $maxAmount != '0') { |
|
469 | + if ($finalPrice >= $minAmount && $finalPrice <= $maxAmount) { |
|
470 | 470 | $isValid = true; |
471 | 471 | } |
472 | - } elseif (isset($minAmount, $finalPrice) && $maxAmount=='0') { |
|
473 | - if ($finalPrice>=$minAmount) { |
|
472 | + } elseif (isset($minAmount, $finalPrice) && $maxAmount == '0') { |
|
473 | + if ($finalPrice >= $minAmount) { |
|
474 | 474 | $isValid = true; |
475 | 475 | } |
476 | 476 | } |
@@ -24,21 +24,21 @@ |
||
24 | 24 | * @var array $defaultConfigs |
25 | 25 | */ |
26 | 26 | public $defaultConfigs = array('PAGANTIS_TITLE'=>'Paga en cuotas', |
27 | - 'PAGANTIS_SIMULATOR_DISPLAY_TYPE'=>'pgSDK.simulator.types.SIMPLE', |
|
28 | - 'PAGANTIS_SIMULATOR_DISPLAY_SKIN'=>'pgSDK.simulator.skins.BLUE', |
|
29 | - 'PAGANTIS_SIMULATOR_DISPLAY_POSITION'=>'hookDisplayProductButtons', |
|
30 | - 'PAGANTIS_SIMULATOR_START_INSTALLMENTS'=>3, |
|
31 | - 'PAGANTIS_SIMULATOR_MAX_INSTALLMENTS'=>12, |
|
32 | - 'PAGANTIS_SIMULATOR_CSS_POSITION_SELECTOR'=>'default', |
|
33 | - 'PAGANTIS_SIMULATOR_DISPLAY_CSS_POSITION'=>'pgSDK.simulator.positions.INNER', |
|
34 | - 'PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR'=>'default', |
|
35 | - 'PAGANTIS_SIMULATOR_CSS_QUANTITY_SELECTOR'=>'default', |
|
36 | - 'PAGANTIS_FORM_DISPLAY_TYPE'=>0, |
|
37 | - 'PAGANTIS_DISPLAY_MIN_AMOUNT'=>1, |
|
38 | - 'PAGANTIS_DISPLAY_MAX_AMOUNT'=>0, |
|
39 | - 'PAGANTIS_URL_OK'=>'', |
|
40 | - 'PAGANTIS_URL_KO'=>'', |
|
41 | - 'PAGANTIS_TITLE_EXTRA' => 'Pay up to 12 comfortable installments with Pagantis. Completely online and sympathetic request, and the answer is immediate!' |
|
27 | + 'PAGANTIS_SIMULATOR_DISPLAY_TYPE'=>'pgSDK.simulator.types.SIMPLE', |
|
28 | + 'PAGANTIS_SIMULATOR_DISPLAY_SKIN'=>'pgSDK.simulator.skins.BLUE', |
|
29 | + 'PAGANTIS_SIMULATOR_DISPLAY_POSITION'=>'hookDisplayProductButtons', |
|
30 | + 'PAGANTIS_SIMULATOR_START_INSTALLMENTS'=>3, |
|
31 | + 'PAGANTIS_SIMULATOR_MAX_INSTALLMENTS'=>12, |
|
32 | + 'PAGANTIS_SIMULATOR_CSS_POSITION_SELECTOR'=>'default', |
|
33 | + 'PAGANTIS_SIMULATOR_DISPLAY_CSS_POSITION'=>'pgSDK.simulator.positions.INNER', |
|
34 | + 'PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR'=>'default', |
|
35 | + 'PAGANTIS_SIMULATOR_CSS_QUANTITY_SELECTOR'=>'default', |
|
36 | + 'PAGANTIS_FORM_DISPLAY_TYPE'=>0, |
|
37 | + 'PAGANTIS_DISPLAY_MIN_AMOUNT'=>1, |
|
38 | + 'PAGANTIS_DISPLAY_MAX_AMOUNT'=>0, |
|
39 | + 'PAGANTIS_URL_OK'=>'', |
|
40 | + 'PAGANTIS_URL_KO'=>'', |
|
41 | + 'PAGANTIS_TITLE_EXTRA' => 'Pay up to 12 comfortable installments with Pagantis. Completely online and sympathetic request, and the answer is immediate!' |
|
42 | 42 | ); |
43 | 43 | |
44 | 44 | /** |
@@ -24,21 +24,21 @@ |
||
24 | 24 | * @var array $defaultConfigs |
25 | 25 | */ |
26 | 26 | public $defaultConfigs = array('PAGANTIS_TITLE'=>'Paga en cuotas', |
27 | - 'PAGANTIS_SIMULATOR_DISPLAY_TYPE'=>'pgSDK.simulator.types.SIMPLE', |
|
28 | - 'PAGANTIS_SIMULATOR_DISPLAY_SKIN'=>'pgSDK.simulator.skins.BLUE', |
|
29 | - 'PAGANTIS_SIMULATOR_DISPLAY_POSITION'=>'hookDisplayProductButtons', |
|
30 | - 'PAGANTIS_SIMULATOR_START_INSTALLMENTS'=>3, |
|
31 | - 'PAGANTIS_SIMULATOR_MAX_INSTALLMENTS'=>12, |
|
32 | - 'PAGANTIS_SIMULATOR_CSS_POSITION_SELECTOR'=>'default', |
|
33 | - 'PAGANTIS_SIMULATOR_DISPLAY_CSS_POSITION'=>'pgSDK.simulator.positions.INNER', |
|
34 | - 'PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR'=>'default', |
|
35 | - 'PAGANTIS_SIMULATOR_CSS_QUANTITY_SELECTOR'=>'default', |
|
36 | - 'PAGANTIS_FORM_DISPLAY_TYPE'=>0, |
|
37 | - 'PAGANTIS_DISPLAY_MIN_AMOUNT'=>1, |
|
38 | - 'PAGANTIS_DISPLAY_MAX_AMOUNT'=>0, |
|
39 | - 'PAGANTIS_URL_OK'=>'', |
|
40 | - 'PAGANTIS_URL_KO'=>'', |
|
41 | - 'PAGANTIS_TITLE_EXTRA' => 'Pay up to 12 comfortable installments with Pagantis. Completely online and sympathetic request, and the answer is immediate!' |
|
27 | + 'PAGANTIS_SIMULATOR_DISPLAY_TYPE'=>'pgSDK.simulator.types.SIMPLE', |
|
28 | + 'PAGANTIS_SIMULATOR_DISPLAY_SKIN'=>'pgSDK.simulator.skins.BLUE', |
|
29 | + 'PAGANTIS_SIMULATOR_DISPLAY_POSITION'=>'hookDisplayProductButtons', |
|
30 | + 'PAGANTIS_SIMULATOR_START_INSTALLMENTS'=>3, |
|
31 | + 'PAGANTIS_SIMULATOR_MAX_INSTALLMENTS'=>12, |
|
32 | + 'PAGANTIS_SIMULATOR_CSS_POSITION_SELECTOR'=>'default', |
|
33 | + 'PAGANTIS_SIMULATOR_DISPLAY_CSS_POSITION'=>'pgSDK.simulator.positions.INNER', |
|
34 | + 'PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR'=>'default', |
|
35 | + 'PAGANTIS_SIMULATOR_CSS_QUANTITY_SELECTOR'=>'default', |
|
36 | + 'PAGANTIS_FORM_DISPLAY_TYPE'=>0, |
|
37 | + 'PAGANTIS_DISPLAY_MIN_AMOUNT'=>1, |
|
38 | + 'PAGANTIS_DISPLAY_MAX_AMOUNT'=>0, |
|
39 | + 'PAGANTIS_URL_OK'=>'', |
|
40 | + 'PAGANTIS_URL_KO'=>'', |
|
41 | + 'PAGANTIS_TITLE_EXTRA' => 'Pay up to 12 comfortable installments with Pagantis. Completely online and sympathetic request, and the answer is immediate!' |
|
42 | 42 | ); |
43 | 43 | |
44 | 44 | /** |
@@ -16,26 +16,26 @@ |
||
16 | 16 | * @var array $defaultConfigs |
17 | 17 | */ |
18 | 18 | public $defaultConfigs = array( |
19 | - 'PAGANTIS_TITLE'=>'Pago en cuotas', |
|
20 | - 'PAGANTIS_SIMULATOR_DISPLAY_TYPE'=>'sdk.simulator.types.SELECTABLE_TEXT_CUSTOM', |
|
21 | - 'PAGANTIS_SIMULATOR_DISPLAY_SKIN'=>'sdk.simulator.skins.BLUE', |
|
22 | - 'PAGANTIS_SIMULATOR_DISPLAY_POSITION'=>'hookDisplayProductButtons', |
|
23 | - 'PAGANTIS_SIMULATOR_START_INSTALLMENTS'=>3, |
|
24 | - 'PAGANTIS_SIMULATOR_MAX_INSTALLMENTS'=>12, |
|
25 | - 'PAGANTIS_SIMULATOR_CSS_POSITION_SELECTOR'=>'default', |
|
26 | - 'PAGANTIS_SIMULATOR_DISPLAY_CSS_POSITION'=>'sdk.simulator.positions.INNER', |
|
27 | - 'PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR'=>'default', |
|
28 | - 'PAGANTIS_SIMULATOR_CSS_QUANTITY_SELECTOR'=>'default', |
|
29 | - 'PAGANTIS_FORM_DISPLAY_TYPE'=>0, |
|
30 | - 'PAGANTIS_DISPLAY_MIN_AMOUNT'=>1, |
|
31 | - 'PAGANTIS_DISPLAY_MAX_AMOUNT'=>0, |
|
32 | - 'PAGANTIS_URL_OK'=>'', |
|
33 | - 'PAGANTIS_URL_KO'=>'', |
|
34 | - 'PAGANTIS_TITLE_EXTRA' => 'Pay up to 12 comfortable installments with Pagantis. Completely online and sympathetic request, and the answer is immediate!', |
|
35 | - 'PAGANTIS_ALLOWED_COUNTRIES' => 'a:3:{i:0;s:2:"es";i:1;s:2:"it";i:2;s:2:"fr";}', |
|
36 | - 'PAGANTIS_PROMOTION_EXTRA' => '<p class="promoted">Finance this product <span class="pg-no-interest">without interest!</span></p>', |
|
37 | - 'PAGANTIS_SIMULATOR_THOUSANDS_SEPARATOR' => '.', |
|
38 | - 'PAGANTIS_SIMULATOR_DECIMAL_SEPARATOR' => ',' |
|
19 | + 'PAGANTIS_TITLE'=>'Pago en cuotas', |
|
20 | + 'PAGANTIS_SIMULATOR_DISPLAY_TYPE'=>'sdk.simulator.types.SELECTABLE_TEXT_CUSTOM', |
|
21 | + 'PAGANTIS_SIMULATOR_DISPLAY_SKIN'=>'sdk.simulator.skins.BLUE', |
|
22 | + 'PAGANTIS_SIMULATOR_DISPLAY_POSITION'=>'hookDisplayProductButtons', |
|
23 | + 'PAGANTIS_SIMULATOR_START_INSTALLMENTS'=>3, |
|
24 | + 'PAGANTIS_SIMULATOR_MAX_INSTALLMENTS'=>12, |
|
25 | + 'PAGANTIS_SIMULATOR_CSS_POSITION_SELECTOR'=>'default', |
|
26 | + 'PAGANTIS_SIMULATOR_DISPLAY_CSS_POSITION'=>'sdk.simulator.positions.INNER', |
|
27 | + 'PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR'=>'default', |
|
28 | + 'PAGANTIS_SIMULATOR_CSS_QUANTITY_SELECTOR'=>'default', |
|
29 | + 'PAGANTIS_FORM_DISPLAY_TYPE'=>0, |
|
30 | + 'PAGANTIS_DISPLAY_MIN_AMOUNT'=>1, |
|
31 | + 'PAGANTIS_DISPLAY_MAX_AMOUNT'=>0, |
|
32 | + 'PAGANTIS_URL_OK'=>'', |
|
33 | + 'PAGANTIS_URL_KO'=>'', |
|
34 | + 'PAGANTIS_TITLE_EXTRA' => 'Pay up to 12 comfortable installments with Pagantis. Completely online and sympathetic request, and the answer is immediate!', |
|
35 | + 'PAGANTIS_ALLOWED_COUNTRIES' => 'a:3:{i:0;s:2:"es";i:1;s:2:"it";i:2;s:2:"fr";}', |
|
36 | + 'PAGANTIS_PROMOTION_EXTRA' => '<p class="promoted">Finance this product <span class="pg-no-interest">without interest!</span></p>', |
|
37 | + 'PAGANTIS_SIMULATOR_THOUSANDS_SEPARATOR' => '.', |
|
38 | + 'PAGANTIS_SIMULATOR_DECIMAL_SEPARATOR' => ',' |
|
39 | 39 | ); |
40 | 40 | |
41 | 41 | /** |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | public function execute(\Magento\Framework\Event\Observer $observer) |
17 | 17 | { |
18 | 18 | try { |
19 | - if ($observer->getEvent()->getMethodInstance()->getCode()=="pagantis") { |
|
19 | + if ($observer->getEvent()->getMethodInstance()->getCode() == "pagantis") { |
|
20 | 20 | $checkResult = $observer->getEvent()->getResult(); |
21 | 21 | $totalPrice = (string) floor($observer->getEvent()->getQuote()->getGrandTotal()); |
22 | 22 | $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | $availableCountry = (in_array(strtolower($locale), $allowedCountries)); |
29 | 29 | $maxAmount = $extraConfig['PAGANTIS_DISPLAY_MAX_AMOUNT']; |
30 | 30 | $minAmount = $extraConfig['PAGANTIS_DISPLAY_MIN_AMOUNT']; |
31 | - $validAmount = ($totalPrice>=$minAmount && ($totalPrice<=$maxAmount||$maxAmount=='0')); |
|
31 | + $validAmount = ($totalPrice >= $minAmount && ($totalPrice <= $maxAmount || $maxAmount == '0')); |
|
32 | 32 | if (!isset($config['pagantis_public_key']) || $config['pagantis_public_key'] == '' || |
33 | 33 | !isset($config['pagantis_private_key']) || $config['pagantis_private_key'] == '' || |
34 | 34 | !$availableCountry || !$validAmount) { |