Skip to content

Commit

Permalink
Merge pull request #61 from logeecom/master
Browse files Browse the repository at this point in the history
Release version 3.2.20
  • Loading branch information
logeecom authored Aug 27, 2024
2 parents 5f6b9d7 + 4a9b454 commit b50827a
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 2 deletions.
Binary file added PluginInstallation/3.2.20/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 @@ -3,6 +3,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.20](https://github.com/packlink-dev/prestashop_module/compare/v3.2.19...v3.2.20)
### Changed
- Added webhook registration in debug controller
- Added check if menu item already exists before adding it

## [3.2.19](https://github.com/packlink-dev/prestashop_module/compare/v3.2.18...v3.2.19)
### Changed
- Updated to Core version 3.3.21
Expand Down
7 changes: 7 additions & 0 deletions src/classes/Utility/PacklinkInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,13 @@ public function updateHooks()
*/
public function addMenuItem()
{
/** @noinspection PhpDeprecationInspection */
$id = \Tab::getIdFromClassName('Packlink');

if ($id) {
return true;
}

$tab = new \Tab();

$languages = \Language::getLanguages(true, \Context::getContext()->shop->id);
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.19",
"version": "3.2.20",
"repositories": [
{
"type": "vcs",
Expand Down
30 changes: 30 additions & 0 deletions src/controllers/admin/DebugController.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<?php

use Logeecom\Infrastructure\Configuration\Configuration;
use Logeecom\Infrastructure\Http\Exceptions\HttpAuthenticationException;
use Logeecom\Infrastructure\Http\Exceptions\HttpCommunicationException;
use Logeecom\Infrastructure\Http\Exceptions\HttpRequestException;
use Logeecom\Infrastructure\ServiceRegister;
use Packlink\BusinessLogic\Http\Proxy;
use Packlink\PrestaShop\Classes\Utility\PacklinkPrestaShopUtility;
use Packlink\PrestaShop\Classes\Utility\SystemInfoUtility;
use Packlink\BusinessLogic\Controllers\DebugController as BaseDebugController;
Expand Down Expand Up @@ -167,6 +171,23 @@ public function displayAjaxGetAsyncTimeout()
));
}

/**
* @return void
*
* @throws HttpAuthenticationException
* @throws HttpCommunicationException
* @throws HttpRequestException
*/
public function displayAjaxRegisterWebhooks()
{
$webHookUrl = $this->getConfigService()->getWebHookUrl();
if (!empty($webHookUrl)) {
$this->getProxy()->registerWebHookHandler($webHookUrl);
}

PacklinkPrestaShopUtility::dieJson(array('success' => true));
}

/**
* @return ConfigurationService
*/
Expand All @@ -175,4 +196,13 @@ private function getConfigurationService()
/** @noinspection PhpIncompatibleReturnTypeInspection */
return ServiceRegister::getService(Configuration::CLASS_NAME);
}

/**
* @return Proxy
*/
private function getProxy()
{
/** @noinspection PhpIncompatibleReturnTypeInspection */
return ServiceRegister::getService(Proxy::CLASS_NAME);
}
}
2 changes: 1 addition & 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.19';
$this->version = '3.2.20';
$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

0 comments on commit b50827a

Please sign in to comment.