Skip to content

Commit

Permalink
ref #85780 Fix module activation (#318)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kocmonavtik authored Nov 20, 2023
1 parent 97cc1c1 commit f49cc38
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 2023-11-20 4.6.14
* Fix module activation/deactivation

## 2023-10-26 4.6.13
* Fix not correct scoring product total price when product price is not number

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.6.13
4.6.14
14 changes: 14 additions & 0 deletions src/include/class-wc-retailcrm-base.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ public function __construct($retailcrm = false)

// Deactivate hook
add_action('retailcrm_deactivate', [$this, 'deactivate']);

//Activation configured module
$this->activateModule();
}

/**
Expand Down Expand Up @@ -941,5 +944,16 @@ private function getSubscribeCheckbox()
__('I agree to receive promotional newsletters', 'retailcrm')
);
}

private function activateModule()
{
$clientId = get_option('retailcrm_client_id');
$isActive = get_option('retailcrm_active_in_crm');

if ($this->apiClient && $clientId && !$isActive) {
WC_Retailcrm_Plugin::integration_module($this->apiClient, $clientId);
update_option('retailcrm_active_in_crm', true);
}
}
}
}
5 changes: 4 additions & 1 deletion src/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Tags: Интеграция, Simla.com, simla
Requires PHP: 7.0
Requires at least: 5.3
Tested up to: 6.2
Stable tag: 4.6.13
Stable tag: 4.6.14
License: GPLv1 or later
License URI: http://www.gnu.org/licenses/gpl-1.0.html

Expand Down Expand Up @@ -82,6 +82,9 @@ Asegúrate de tener una clave API específica para cada tienda. Las siguientes i


== Changelog ==
= 4.6.14 =
* Fix module activation/deactivation

= 4.6.13 =
* Fix not correct scoring product total price when product price is not number

Expand Down
2 changes: 1 addition & 1 deletion src/retailcrm.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Description: Integration plugin for WooCommerce & Simla.com
* Author: RetailDriver LLC
* Author URI: http://retailcrm.pro/
* Version: 4.6.13
* Version: 4.6.14
* Tested up to: 6.2
* WC requires at least: 5.4
* WC tested up to: 7.8
Expand Down
2 changes: 1 addition & 1 deletion src/uninstall.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* @link https://wordpress.org/plugins/woo-retailcrm/
*
* @version 4.6.13
* @version 4.6.14
*
* @package RetailCRM
*/
Expand Down

0 comments on commit f49cc38

Please sign in to comment.