Skip to content

Commit

Permalink
Merge pull request #16 from max-geraci/master
Browse files Browse the repository at this point in the history
Added option to show payment images in checkout
  • Loading branch information
max-geraci authored Apr 30, 2020
2 parents 21d9971 + 8b496e2 commit 9666b8b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
2 changes: 2 additions & 0 deletions paynlpaymentmethods/nl.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
$_MODULE['<{paynlpaymentmethods}prestashop>paynlpaymentmethods_b9f5c797ebbf55adccdd8539a65a0241'] = 'Uitgeschakeld';
$_MODULE['<{paynlpaymentmethods}prestashop>paynlpaymentmethods_4245499695408b974322be6f01b0d17a'] = 'Test modus';
$_MODULE['<{paynlpaymentmethods}prestashop>paynlpaymentmethods_61142607f22ea506073bcb1c1c74133e'] = 'Start de transacties in sandbox modus om te testen';
$_MODULE['<{paynlpaymentmethods}prestashop>paynlpaymentmethods_4861c3d5c88af6037e2bfb0d5c309ce1'] = 'Weergave afbeeldingen';
$_MODULE['<{paynlpaymentmethods}prestashop>paynlpaymentmethods_f7d5170bde3cbe04f1e4c3cb3459dc08'] = 'Laat de afbeeldingen van de betaalmethoden zien in de checkout.';
$_MODULE['<{paynlpaymentmethods}prestashop>paynlpaymentmethods_3d8bf69f189462bae437c9b50d32f4e1'] = 'Betaalscherm taal';
$_MODULE['<{paynlpaymentmethods}prestashop>paynlpaymentmethods_1efea134dc382b9d18ef9ed8a21e178f'] = 'Selecteer de taal waarin het betaalscherm wordt weergegeven, gebruikt automatisch de browser taal';
$_MODULE['<{paynlpaymentmethods}prestashop>paynlpaymentmethods_c9cc8cce247e49bae79f15173ce97354'] = 'Opslaan';
Expand Down
27 changes: 25 additions & 2 deletions paynlpaymentmethods/paynlpaymentmethods.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,10 @@ private function getPaymentMethods($cart = null)
'value' => $paymentMethod->id,
],
])
->setLogo('https://static.pay.nl/payment_profiles/50x32/' . $paymentMethod->id . '.png');
if (isset($paymentMethod->description)) {
if (Configuration::get('PAYNL_SHOW_IMAGE')) {
$objPaymentMethod->
setLogo('https://static.pay.nl/payment_profiles/50x32/' . $paymentMethod->id . '.png');
} if (isset($paymentMethod->description)) {
$objPaymentMethod->setAdditionalInformation('<p>' . $paymentMethod->description . '</p>');
}

Expand Down Expand Up @@ -981,6 +983,8 @@ protected function _postProcess()
Configuration::updateValue('PAYNL_DESCRIPTION_PREFIX', Tools::getValue('PAYNL_DESCRIPTION_PREFIX'));
Configuration::updateValue('PAYNL_PAYMENTMETHODS', Tools::getValue('PAYNL_PAYMENTMETHODS'));
Configuration::updateValue('PAYNL_LANGUAGE', Tools::getValue('PAYNL_LANGUAGE'));
Configuration::updateValue('PAYNL_SHOW_IMAGE', Tools::getValue('PAYNL_SHOW_IMAGE'));

}
$this->_html .= $this->displayConfirmation($this->l('Settings updated'));
}
Expand Down Expand Up @@ -1051,6 +1055,24 @@ public function renderAccountSettingsForm()
)
),
),
array(
'type' => 'switch',
'label' => $this->l('Show images'),
'name' => 'PAYNL_SHOW_IMAGE',
'desc' => $this->l('Show the images of the payment methods in checkout.'),
'values' => array(
array(
'id' => 'active_on',
'value' => 1,
'label' => $this->l('Enabled')
),
array(
'id' => 'active_off',
'value' => 0,
'label' => $this->l('Disabled')
)
),
),
array(
'type' => 'select',
'label' => $this->l('Payment screen language'),
Expand Down Expand Up @@ -1114,6 +1136,7 @@ public function getConfigFieldsValues()
'PAYNL_VALIDATION_DELAY' => Tools::getValue('PAYNL_VALIDATION_DELAY', Configuration::get('PAYNL_VALIDATION_DELAY')),
'PAYNL_DESCRIPTION_PREFIX' => Tools::getValue('PAYNL_DESCRIPTION_PREFIX', Configuration::get('PAYNL_DESCRIPTION_PREFIX')),
'PAYNL_LANGUAGE' => Tools::getValue('PAYNL_LANGUAGE', Configuration::get('PAYNL_LANGUAGE')),
'PAYNL_SHOW_IMAGE' => Tools::getValue('PAYNL_SHOW_IMAGE', Configuration::get('PAYNL_SHOW_IMAGE')),
'PAYNL_PAYMENTMETHODS' => $paymentMethods
);
}
Expand Down

0 comments on commit 9666b8b

Please sign in to comment.