Skip to content

Commit

Permalink
Clarify update on save behavoiur and add some options (#189)
Browse files Browse the repository at this point in the history
* Clarify update on save behavoiur

* Updated copy

* update options and text

* update arrays so CS don't complain
  • Loading branch information
brunovesar authored Mar 7, 2024
1 parent c42ba7f commit 7477596
Show file tree
Hide file tree
Showing 4 changed files with 281 additions and 538 deletions.
24 changes: 14 additions & 10 deletions doofinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Doofinder extends Module
const DOOMANAGER_URL = 'https://admin.doofinder.com';
const GS_SHORT_DESCRIPTION = 1;
const GS_LONG_DESCRIPTION = 2;
const VERSION = '4.7.23';
const VERSION = '4.7.24';
const YES = 1;
const NO = 0;

Expand Down Expand Up @@ -550,16 +550,20 @@ protected function getConfigFormDataFeed()
],
[
'type' => 'select',
'label' => $this->l('Automatically process product changes'),
'desc' => $this->l('Configure when registered product changes are sent to Doofinder'),
'label' => $this->l('Automatically process modified products'),
'desc' => $this->l('Configure how often changes will be sent to Doofinder. It will only be executed if there are changes.'),
'name' => 'DF_UPDATE_ON_SAVE_DELAY',
'options' => [
'query' => [
0 => ['id' => 0, 'name' => $this->l('Every day')],
90 => ['id' => 90, 'name' => sprintf($this->l('Every %s minutes'), '90')],
60 => ['id' => 60, 'name' => sprintf($this->l('Every %s minutes'), '60')],
30 => ['id' => 30, 'name' => sprintf($this->l('Every %s minutes'), '30')],
15 => ['id' => 15, 'name' => sprintf($this->l('Every %s minutes'), '15')],
5 => ['id' => 5, 'name' => sprintf($this->l('Each %s minutes'), '5')],
15 => ['id' => 15, 'name' => sprintf($this->l('Each %s minutes'), '15')],
30 => ['id' => 30, 'name' => sprintf($this->l('Each %s minutes'), '30')],
60 => ['id' => 60, 'name' => $this->l('Each hour')],
120 => ['id' => 120, 'name' => sprintf($this->l('Each %s hours'), '2')],
360 => ['id' => 360, 'name' => sprintf($this->l('Each %s hours'), '6')],
720 => ['id' => 720, 'name' => sprintf($this->l('Each %s hours'), '12')],
1440 => ['id' => 1440, 'name' => $this->l('Once a day')],
0 => ['id' => 0, 'name' => $this->l('Disabled')],
],
'id' => 'id',
'name' => 'name',
Expand Down Expand Up @@ -784,8 +788,8 @@ protected function postProcess()
if ((bool) Configuration::get('DF_UPDATE_ON_SAVE_DELAY')) {
$this->setSearchEnginesByConfig();
}
if (Tools::getValue('DF_UPDATE_ON_SAVE_DELAY') && (int) Tools::getValue('DF_UPDATE_ON_SAVE_DELAY') < 15) {
Configuration::updateValue('DF_UPDATE_ON_SAVE_DELAY', 15);
if (Tools::getValue('DF_UPDATE_ON_SAVE_DELAY') && (int) Tools::getValue('DF_UPDATE_ON_SAVE_DELAY') < 5) {
Configuration::updateValue('DF_UPDATE_ON_SAVE_DELAY', 5);
}

$this->context->smarty->assign('text_data_changed', $this->l('You\'ve just changed a data feed option. It may be necessary to reprocess the index to apply these changes effectively.'));
Expand Down
Loading

0 comments on commit 7477596

Please sign in to comment.