Skip to content

Commit

Permalink
Merge pull request #57 from logeecom/master
Browse files Browse the repository at this point in the history
Release new plugin version 3.2.17
  • Loading branch information
logeecom authored Feb 14, 2024
2 parents 3045683 + b1e48a2 commit 0e60191
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 6 deletions.
Binary file added PluginInstallation/3.2.17/packlink.zip
Binary file not shown.
5 changes: 5 additions & 0 deletions PluginInstallation/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
## [3.2.17](https://github.com/packlink-dev/prestashop_module/compare/v3.2.16...v3.2.17)
### Changed
- Register htmlspecialchars_decode modifier using Smarty::registerPlugin
- Do not register hooks that are not used

## [3.2.16](https://github.com/packlink-dev/prestashop_module/compare/v3.2.15...v3.2.16)
### Added
- Change to Core version 3.3.18
Expand Down
3 changes: 0 additions & 3 deletions src/classes/Utility/PacklinkInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@ class PacklinkInstaller
*/
private $module;
private static $hooks = array(
'updateCarrier',
'displayAfterCarrier',
'actionValidateStepComplete',
'displayBackOfficeOrderActions',
'displayAdminOrderTabShip',
'displayAdminOrderContentShip',
'displayBeforeCarrier',
Expand Down
2 changes: 1 addition & 1 deletion src/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "packlink/prestashop",
"description": "Packlink Shipping PrestaShop plugin",
"type": "library",
"version": "3.2.16",
"version": "3.2.17",
"repositories": [
{
"type": "vcs",
Expand Down
8 changes: 8 additions & 0 deletions src/controllers/admin/PacklinkAutoTestController.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,14 @@ protected function displayPage()
'moduleUrl' => $this->getAction('Packlink', '', false),
)
);

// Register modifier function
$this->context->smarty->registerPlugin(
'modifier',
'htmlspecialchars_decode',
'htmlspecialchars_decode'
);

// render template and assign it to the page
$content = $this->context->smarty->fetch($this->getTemplatePath() . 'auto-test.tpl');
$this->context->smarty->assign(
Expand Down
41 changes: 40 additions & 1 deletion src/packlink.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function __construct()
$this->module_key = 'a7a3a395043ca3a09d703f7d1c74a107';
$this->name = 'packlink';
$this->tab = 'shipping_logistics';
$this->version = '3.2.16';
$this->version = '3.2.17';
$this->author = $this->l('Packlink Shipping S.L.');
$this->need_instance = 0;
$this->ps_versions_compliancy = array('min' => '1.6.0.14', 'max' => _PS_VERSION_);
Expand Down Expand Up @@ -200,6 +200,7 @@ public function hookDisplayBeforeCarrier($params)
* @throws \Logeecom\Infrastructure\ORM\Exceptions\RepositoryNotRegisteredException
* @throws \PrestaShopDatabaseException
* @throws \PrestaShopException
* @throws SmartyException
*/
public function hookDisplayAfterCarrier($params)
{
Expand All @@ -209,6 +210,13 @@ public function hookDisplayAfterCarrier($params)
'configuration' => $configuration,
));

// Register modifier function
$this->context->smarty->registerPlugin(
'modifier',
'htmlspecialchars_decode',
'htmlspecialchars_decode'
);

return $this->display(__FILE__, 'shipping_methods_17.tpl');
}

Expand Down Expand Up @@ -254,6 +262,13 @@ public function hookDisplayAdminOrderContentShip()
Tools::getValue('id_order')
);

// Register modifier function
$this->context->smarty->registerPlugin(
'modifier',
'htmlspecialchars_decode',
'htmlspecialchars_decode'
);

return $this->context->smarty->createTemplate(
$this->getLocalPath() . self::PACKLINK_SHIPPING_CONTENT,
$this->context->smarty
Expand All @@ -271,6 +286,7 @@ public function hookDisplayAdminOrderContentShip()
* @throws \Logeecom\Infrastructure\ORM\Exceptions\RepositoryNotRegisteredException
* @throws \PrestaShopDatabaseException
* @throws \PrestaShopException
* @throws SmartyException
*/
public function hookDisplayOrderConfirmation($params)
{
Expand All @@ -296,6 +312,13 @@ public function hookDisplayOrderConfirmation($params)
array('configuration' => $configuration)
);

// Register modifier function
$this->context->smarty->registerPlugin(
'modifier',
'htmlspecialchars_decode',
'htmlspecialchars_decode'
);

$output = $this->getLocationPickerFilesLinks();

$output .= $this->getCheckoutFilesLinks();
Expand Down Expand Up @@ -611,6 +634,7 @@ public function getOrderShippingCostExternal($params)
* @return string
*
* @throws \PrestaShopException
* @throws SmartyException
*/
public function getContent()
{
Expand All @@ -636,6 +660,13 @@ public function getContent()
'gridResizerScript' => $this->getPathUri() . 'views/js/core/GridResizerService.js?v=' . $this->version,
));

// Register modifier function
$this->context->smarty->registerPlugin(
'modifier',
'htmlspecialchars_decode',
'htmlspecialchars_decode'
);

return $this->display(__FILE__, 'index.tpl');
}

Expand Down Expand Up @@ -997,6 +1028,7 @@ protected function getShippingStepConfiguration($params)
* @throws \Logeecom\Infrastructure\ORM\Exceptions\RepositoryNotRegisteredException
* @throws \PrestaShopDatabaseException
* @throws \PrestaShopException
* @throws SmartyException
*/
protected function getPresta16ShippingStepPage($params)
{
Expand All @@ -1008,6 +1040,13 @@ protected function getPresta16ShippingStepPage($params)
'shippingServicePath' => $this->_path . 'views/js/ShippingService16.js?v=' . $this->version,
));

// Register modifier function
$this->context->smarty->registerPlugin(
'modifier',
'htmlspecialchars_decode',
'htmlspecialchars_decode'
);

$output = $this->display(__FILE__, 'getPresta16ShippingStepPage.tpl');

$output .= $this->getCheckoutFilesLinks();
Expand Down
32 changes: 32 additions & 0 deletions src/upgrade/upgrade-3.2.17.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

use Packlink\PrestaShop\Classes\Bootstrap;
use Packlink\PrestaShop\Classes\Utility\PacklinkInstaller;

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

/**
* Updates module to version 3.2.17.
*
* @param $module
*
* @return bool
*/
function upgrade_module_3_2_17($module)
{
$previousShopContext = \Shop::getContext();
\Shop::setContext(\Shop::CONTEXT_ALL);

Bootstrap::init();
$installer = new PacklinkInstaller($module);

if (!$installer->addControllersAndHooks()) {
return false;
}

\Shop::setContext($previousShopContext);

return true;
}
2 changes: 1 addition & 1 deletion src/views/js/prestashop-ui-kit.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0e60191

Please sign in to comment.