Skip to content

Commit

Permalink
Merge pull request #2 from soisy/test
Browse files Browse the repository at this point in the history
Add zero interest rate
  • Loading branch information
salvatore-disavio authored May 30, 2022
2 parents 400bf77 + 0862d64 commit ab1d7ad
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 10 deletions.
3 changes: 2 additions & 1 deletion Actions/GetSimulation.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ public function getDefaultWidgetSimulation($amount)
$html = '<soisy-loan-quote ' .
'shop-id="' . $this->settings->getShopId(true) . '" ' .
'amount="' . $amount . '" ' .
'instalments="' . $this->settings->getPromotionalRates() . '"></soisy-loan-quote>' .
'instalments="' . $this->settings->getPromotionalRates() . '" ' .
'zero-interest-rate="' . $this->settings->getZeroInterestRate() . '"></soisy-loan-quote>' .
'<script src="https://cdn.soisy.it/loan-quote-widget.js" async defer></script>';
return $html;
}
Expand Down
5 changes: 5 additions & 0 deletions Helper/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ public function getPromotionalRates()
return $this->getSettings('promotional_rates');
}

public function getZeroInterestRate()
{
return $this->getSettings('zero_interest_rate');
}

protected function getCmsUrl($urlString)
{
return $urlString ? $this->cmsHelper->getPageUrl($urlString) : $this->storeManager->getStore()->getBaseUrl();
Expand Down
23 changes: 15 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Magento 2.3.x, 2.4.x Soisy's installment payment method

Facts
-----
- version: 1.0.0
- version: 1.1.0
- extension key: Soisy_PaymentMethod

Description
Expand All @@ -26,20 +26,27 @@ The module should be compatible also with magento 2 >= 2.3.0
Installation Instructions
-------------------------

* manual copy all the files into your magento root, /app/code/Soisy/PaymentMethod.
### Installation:

1) Manual copy all the files into your magento `root/app/code/Soisy/PaymentMethod`.

(If you don't have this folder please create it)

2) Clear the cache, logout from the admin panel and then login again.

3) Go to System -> Tools -> Web Setup Wizard, in Module Manager and check "Enable" on Soisy_PaymentMethod.

4) Execute the follow command:
* php bin\magento setup:static-content:deploy -f
* php bin\magento cache:clean
* php bin\magento cache:flush
### Optional:
Execute the follow command:
1) php bin\magento setup:static-content:deploy -f
2) php bin\magento cache:clean
3) php bin\magento cache:flush


Configuration
-------------
Configure and activate the extension under System - Configuration - Sales - Payment methods.
Configure and activate the extension under Stores -> Configuration -> Sales -> Payment Methods


![Settings](view/frontend/web/images/readme/settings.png)

Expand Down Expand Up @@ -109,4 +116,4 @@ Developer

Copyright
---------
(c) 2021 Soisy
(c) 2022 Soisy
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "soisy/magento2-payment-method",
"description": "Create Soisy payment method in your Magento2 online shop",
"type": "magento2-module",
"version": "1.0.0",
"version": "1.1.0",
"license": [
"MPL-2.0"
],
Expand Down
5 changes: 5 additions & 0 deletions etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@
<field id="*/*/show_simulation">1</field>
</depends>
</field>
<field id="zero_interest_rate" translate="label" type="select" sortOrder="204" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1">
<label>Zero interest rate</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<comment>Zero interest rate</comment>
</field>
<field id="sort_order" translate="label" type="text" sortOrder="900" showInDefault="1" showInWebsite="1" showInStore="0">
<label>Sort Order</label>
<frontend_class>validate-number</frontend_class>
Expand Down
1 change: 1 addition & 0 deletions etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<instructions></instructions>
<show_simulation>1</show_simulation>
<promotional_rates>12</promotional_rates>
<zero_interest_rate>0</zero_interest_rate>
<allowspecific>0</allowspecific>
<group>offline</group>
</soisy>
Expand Down

0 comments on commit ab1d7ad

Please sign in to comment.