Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ composer test

### Supported PrestaShop versions

This module is compatible with 1.6.1.x and 1.7.x versions.
This module is compatible with 1.6.1.x, 1.7.x and 8.x versions.

> As of 31th of october, 2018, PrestaShop 1.6.1.x will only receives security patches.

This module is maintained for 1.7.4.x and above *only*.

Please, use v2.5.x for v1.7.x and below, and v3.x for v8 and above.

## Reporting issues

You can report issues with this module in the main PrestaShop repository. [Click here to report an issue][report-issue].
Expand Down
2 changes: 1 addition & 1 deletion config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<module>
<name>gamification</name>
<displayName><![CDATA[Merchant Expertise]]></displayName>
<version><![CDATA[3.0.5]]></version>
<version><![CDATA[3.0.6]]></version>
<description><![CDATA[Become an e-commerce expert within the blink of an eye!]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[administration]]></tab>
Expand Down
25 changes: 23 additions & 2 deletions gamification.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function __construct()
{
$this->name = 'gamification';
$this->tab = 'administration';
$this->version = '3.0.5';
$this->version = '3.0.6';
$this->author = 'PrestaShop';
$this->module_key = 'c1187d1672d2a2d33fbd7d5c29f0d42e';
$this->ps_versions_compliancy = [
Expand Down Expand Up @@ -128,7 +128,28 @@ public function enable($force_all = false)

public function disable($force_all = false)
{
return parent::disable($force_all) && Tab::disablingForModule($this->name);
$disabled = parent::disable($force_all);

if ($disabled) {
try {
Tab::disablingForModule($this->name);
} catch (PrestaShopException $exception) {
// We don't install tab since PS8, but can still get it if user comes from 1.7.x
$this->uninstallTab();
}
}

return $disabled;
}

public function uninstallTab()
{
$id_tab = (int) Tab::getIdFromClassName('AdminGamification');
if ($id_tab) {
$tab = new Tab($id_tab);

$tab->delete();
}
}

public function __call($name, $arguments)
Expand Down
2 changes: 1 addition & 1 deletion views/js/gamification_bt.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function gamificationTasks()
fancybox.fancybox();
}

$(".preactivationLink").on('click', function(e) {
$(".preactivationLink").one('click', function(e) {
e.preventDefault();
preactivationLinkClick($(this).attr('rel'), $(this).attr('href'));
});
Expand Down