Skip to content

Commit

Permalink
Release v7.9.0
Browse files Browse the repository at this point in the history
* [ADD] Maximum instalment desired option for widgets.
  • Loading branch information
alexhernandezord authored Jul 20, 2023
2 parents a7dfe72 + 66539dc commit 56a71da
Show file tree
Hide file tree
Showing 9 changed files with 70 additions and 2 deletions.
4 changes: 4 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Change Log

#### [v7.9.0](https://github.com/aplazame/prestashop/tree/v7.9.0) (2023-07-20)

* [ADD] Maximum instalment desired option for widgets.

#### [v7.8.3](https://github.com/aplazame/prestashop/tree/v7.8.3) (2023-07-13)

* [FIX] Fraud check conditional.
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version ?= v7.8.3
version ?= v7.9.0
errors = $(shell find aplazame -type f -name "*.php" -exec php -l "{}" \;| grep "Errors parsing ";)

syntax.checker:
Expand Down
42 changes: 41 additions & 1 deletion aplazame/aplazame.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function __construct()
{
$this->name = 'aplazame';
$this->tab = 'payments_gateways';
$this->version = '7.8.3';
$this->version = '7.9.0';
$this->author = 'Aplazame SL';
$this->author_uri = 'https://aplazame.com';
$this->module_key = '64b13ea3527b4df3fe2e3fc1526ce515';
Expand Down Expand Up @@ -127,9 +127,11 @@ public function install()
Configuration::updateValue('PRODUCT_WIDGET_PRIMARY_COLOR', '#334bff');
Configuration::updateValue('PRODUCT_WIDGET_LAYOUT', 'horizontal');
Configuration::updateValue('PRODUCT_WIDGET_ALIGN', 'center');
Configuration::updateValue('PRODUCT_WIDGET_MAX_DESIRED', false);
Configuration::updateValue('CART_WIDGET_PRIMARY_COLOR', '#334bff');
Configuration::updateValue('CART_WIDGET_LAYOUT', 'horizontal');
Configuration::updateValue('CART_WIDGET_ALIGN', 'center');
Configuration::updateValue('CART_WIDGET_MAX_DESIRED', false);

return ($this->registerHook('actionOrderSlipAdd')
&& $this->registerHook('actionOrderStatusUpdate')
Expand Down Expand Up @@ -279,9 +281,11 @@ public function getContent()
'PRODUCT_WIDGET_PRIMARY_COLOR',
'PRODUCT_WIDGET_LAYOUT',
'PRODUCT_WIDGET_ALIGN',
'PRODUCT_WIDGET_MAX_DESIRED',
'CART_WIDGET_PRIMARY_COLOR',
'CART_WIDGET_LAYOUT',
'CART_WIDGET_ALIGN',
'CART_WIDGET_MAX_DESIRED',
);

if (Tools::isSubmit('submitAplazameModule')) {
Expand Down Expand Up @@ -614,6 +618,23 @@ protected function getConfigForm()
),
),
),
array(
'type' => $switch_or_radio,
'label' => $this->l('Enter maximum instalment'),
'name' => 'PRODUCT_WIDGET_MAX_DESIRED',
'is_bool' => true,
'desc' => $this->l('Allow the user to manually enter the maximum instalment they want to pay (only new widget)'),
'values' => array(
array(
'id' => 'active_on',
'value' => true,
),
array(
'id' => 'active_off',
'value' => false,
),
),
),
array(
'name' => 'PRODUCT_WIDGET_PRIMARY_COLOR',
'type' => 'color',
Expand Down Expand Up @@ -758,6 +779,23 @@ protected function getConfigForm()
'name' => 'APLAZAME_CART_CSS',
'label' => $this->l('Variable price CSS'),
),
array(
'type' => $switch_or_radio,
'label' => $this->l('Enter maximum instalment'),
'name' => 'CART_WIDGET_MAX_DESIRED',
'is_bool' => true,
'desc' => $this->l('Allow the user to manually enter the maximum instalment they want to pay (only new widget)'),
'values' => array(
array(
'id' => 'active_on',
'value' => true,
),
array(
'id' => 'active_off',
'value' => false,
),
),
),
array(
'name' => 'CART_WIDGET_PRIMARY_COLOR',
'type' => 'color',
Expand Down Expand Up @@ -1019,6 +1057,7 @@ public function hookDisplayShoppingCart($params)
'aplazame_default_instalments' => Configuration::get('APLAZAME_CART_DEFAULT_INSTALMENTS'),
'aplazame_widget_out_of_limits' => Configuration::get('APLAZAME_WIDGET_OUT_OF_LIMITS'),
'aplazame_widget_legacy' => Configuration::get('WIDGET_LEGACY'),
'aplazame_max_desired' => Configuration::get('CART_WIDGET_MAX_DESIRED') ? 'true' : 'false',
'aplazame_primary_color' => Configuration::get('CART_WIDGET_PRIMARY_COLOR'),
'aplazame_layout' => Configuration::get('CART_WIDGET_LAYOUT'),
'aplazame_align' => Configuration::get('CART_WIDGET_ALIGN'),
Expand Down Expand Up @@ -1146,6 +1185,7 @@ public function getWidget($params)
'aplazame_default_instalments' => Configuration::get('APLAZAME_PRODUCT_DEFAULT_INSTALMENTS'),
'aplazame_widget_out_of_limits' => Configuration::get('APLAZAME_WIDGET_OUT_OF_LIMITS'),
'aplazame_widget_legacy' => Configuration::get('WIDGET_LEGACY'),
'aplazame_max_desired' => Configuration::get('PRODUCT_WIDGET_MAX_DESIRED') ? 'true' : 'false',
'aplazame_primary_color' => Configuration::get('PRODUCT_WIDGET_PRIMARY_COLOR'),
'aplazame_layout' => Configuration::get('PRODUCT_WIDGET_LAYOUT'),
'aplazame_align' => Configuration::get('PRODUCT_WIDGET_ALIGN'),
Expand Down
Binary file modified aplazame/logo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified aplazame/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions aplazame/translations/es.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
$_MODULE['<{aplazame}prestashop>aplazame_613e6334a73ad07b4938e60b541957e6'] = 'CSS de precio variable';
$_MODULE['<{aplazame}prestashop>aplazame_070554647306343cbea29ebfdd278ba8'] = 'Marco';
$_MODULE['<{aplazame}prestashop>aplazame_bac9f95e3ec6adb497342739cf54de93'] = 'Mostrar marco en el widget del producto (sólo nuevo widget)';
$_MODULE['<{aplazame}prestashop>aplazame_e849d3acec26b04bc09323bbdb09fc05'] = 'Introducir cuota máxima';
$_MODULE['<{aplazame}prestashop>aplazame_06a34207536cd6041509b9ec59619904'] = 'Permitir al usuario introducir manualmente la cuota máxima que desea pagar (sólo nuevo widget)';
$_MODULE['<{aplazame}prestashop>aplazame_3b5c7c0a40e4a36839e79e8c5f6d103f'] = 'Color principal';
$_MODULE['<{aplazame}prestashop>aplazame_1619438a71c23b74624a2bc3764d28d8'] = 'Código hexadecimal del color principal para el widget del producto (sólo nuevo widget)';
$_MODULE['<{aplazame}prestashop>aplazame_ebd9bec4d70abc789d439c1f136b0538'] = 'Disposición';
Expand Down
20 changes: 20 additions & 0 deletions aplazame/upgrade/Upgrade-7.9.0.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php
/**
* This file is part of the official Aplazame module for PrestaShop.
*
* @author Aplazame <[email protected]>
* @copyright 2015-2023 Aplazame
* @license see file: LICENSE
*/

if (!defined('_PS_VERSION_')) {
exit;
}

function upgrade_module_7_9_0(Aplazame $module)
{
Configuration::updateValue('PRODUCT_WIDGET_MAX_DESIRED', false);
Configuration::updateValue('CART_WIDGET_MAX_DESIRED', false);

return true;
}
1 change: 1 addition & 0 deletions aplazame/views/templates/hook/product.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
{else}
data-aplazame-widget-instalments="v4"
data-type="product"
data-option-max-amount-desired="{$aplazame_max_desired|escape:'htmlall':'UTF-8'}"
data-option-primary-color="{$aplazame_primary_color|escape:'htmlall':'UTF-8'}"
data-option-layout="{$aplazame_layout|escape:'htmlall':'UTF-8'}"
data-option-align="{$aplazame_align|escape:'htmlall':'UTF-8'}"
Expand Down
1 change: 1 addition & 0 deletions aplazame/views/templates/hook/shoppingcart.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
{else}
data-aplazame-widget-instalments="v4"
data-type="cart"
data-option-max-amount-desired="{$aplazame_max_desired|escape:'htmlall':'UTF-8'}"
data-option-primary-color="{$aplazame_primary_color|escape:'htmlall':'UTF-8'}"
data-option-layout="{$aplazame_layout|escape:'htmlall':'UTF-8'}"
data-option-align="{$aplazame_align|escape:'htmlall':'UTF-8'}"
Expand Down

0 comments on commit 56a71da

Please sign in to comment.