Dodanie nowych plików tłumaczeń, aktualizacja wersji modułu gm_omniprice do 1.2.0 oraz poprawki w kodzie i logach

This commit is contained in:
2025-01-30 15:50:33 +01:00
parent 3ae138b01d
commit 3753eb902b
25 changed files with 990 additions and 94 deletions

View File

@@ -1,3 +1,198 @@
## [1.2.11] - 2024-12-19
### Changed
- More conservative approach to cleaning prices
## [1.2.10] - 2024-12-09
### Changed
- Performance optimization for cleanup and indexing
### Added
- Silent mode for cleanup script
## [1.2.9] - 2024-12-04
### Changed
- Translations update
## [1.2.8] - 2024-09-02
### Fixed
- PHP 8 compatibility in some scenarios
## [1.2.7] - 2024-03-06
### Fixed
- groupinc module support - only if the groupinc module is installed
## [1.2.6] - 2023-11-29
### Fixed
- Checking lowest price for the real discount feature
## [1.2.5] - 2023-10-31
### Fixed
- Warning when checking specific price output
## [1.2.4] - 2023-10-11
### Added
- Additional database index
## [1.2.3] - 2023-09-12
### Added
- Support for third party modules manipulating prices (like groupinc)
- New feature to skip non EU countries
## [1.2.2] - 2023-05-15
### Added
- New feature to skip products sold below cost price
## [1.2.1] - 2023-08-01
### Fixed
- Notice when getting active products for multistore
## [1.2.0] - 2023-05-15
### Added
- New feature to index inactive products
## [1.1.15] - 2023-05-05
### Fixed
- Include negative price impacts in information panel
## [1.1.14] - 2023-04-12
### Added
- New function to fill missing cache prices
## [1.1.13] - 2023-03-27
### Fixed
- Index for date column to optimize performance
## [1.1.12] - 2023-03-06
### Added
- Displaying shop and module version in the CRON task
## [1.1.11] - 2023-02-13
### Added
- New feature to show the real discount based on the previous lowest price (only PS 1.7 and 8.0)
- Skipping 0 prices
### Fixed
- Displaying price for combinations when not enough history for PS 1.6 and TB
## [1.1.10] - 2023-02-07
### Fixed
- Default countries and currencies for mutlistore setup
## [1.1.9] - 2023-01-30
### Fixed
- Displaying label for individual discounted combinations (PrestaShop 1.6)
## [1.1.8] - 2023-01-28
### Added
- Support for hook parameters on product lists in PrestaShop 1.6
## [1.1.7] - 2023-01-26
### Added
- Recognizing changes when only type of the price is different (regular vs discounted)
### Added
- Support for older versions of PrestaShop 1.6
## [1.1.6] - 2023-01-23
### Fixed
- Cleaning product attributes from price history and cache
## [1.1.5] - 2023-01-19
### Added
- Cleaning deleted product attributes from price history and cache
### Fixed
- Warnings when getting shop id's
## [1.1.4] - 2023-01-17
### Changed
- Database queries to optimize performance
## [1.1.3] - 2023-01-15
### Added
- information about discounts for individual combinations
- automatic configuration upon installation
## [1.1.2] - 2023-01-12
### Changed
- Default colors
### Added
- cleanup: deleting prices for ignored or deleted groups from old history
## [1.1.1] - 2023-01-11
### Added
- Cleanup script improvements
- Additional debugging features for frontend and CRON task
- Number of stored prices in the information panel
- Number of active countries in the information panel
### Fixed
- Deleting today's history on CRON reset
## [1.1.0] - 2023-01-10
### Added

View File

@@ -8,4 +8,6 @@ $comparedToken = Tools::getAdminToken('gm_omniprice');
if ($token != $comparedToken) {
die('invalid token');
}
$omni->cleanUp(true);
$verbose = !Tools::isSubmit('silent');
$omni->cleanUp($verbose);
echo 'FINISH<br/>';

View File

@@ -2,7 +2,7 @@
<module>
<name>gm_omniprice</name>
<displayName><![CDATA[OmniPrice - zgodność cen z dyrektywą Omnibus]]></displayName>
<version><![CDATA[1.1.0]]></version>
<version><![CDATA[1.2.0]]></version>
<description><![CDATA[Wyświetla informację o najniższej cenie przed promocją]]></description>
<author><![CDATA[GreenMouseStudio.com]]></author>
<tab><![CDATA[front_office_features]]></tab>

View File

@@ -1,7 +1,8 @@
<?php
$start = microtime(true);
require('template.php');
require_once('../../config/config.inc.php');
require_once(dirname(__FILE__) . '/../../config/config.inc.php');
$omni = Module::getInstanceByName('gm_omniprice');
$token = Tools::getValue('token');
@@ -9,9 +10,30 @@ $comparedToken = Tools::getAdminToken('gm_omniprice');
if ($token != $comparedToken) {
die('invalid token');
}
echo 'PS ' . _PS_VERSION_ . '<br/>';
echo 'OmniPrice ' . $omni->version . '<br/>';
if (Tools::isSubmit('reset')) {
$omni->resetIndex();
echo 'RESET</br>';
}
$omni->savePrices(true);
echo 'END';
$productId = null;
if (Tools::isSubmit('pid')) {
$productId = (int) Tools::getValue('pid');
$omni->removeProductFromTodaysIndex($productId);
$omni->removeProductFromTodaysHistory($productId);
}
$omni->savePrices(true, $productId);
echo 'FINISH<br/>';
if (Tools::isSubmit('debug')) {
echo 'DEBUG:<br/>';
$debug = Db::getInstance()->executeS('SELECT * FROM `' . _DB_PREFIX_ . 'gm_omniprice_history` WHERE `id_product` = ' . $productId);
if ($debug) {
echo $omni->displayTable($debug, array_keys($debug[0]));
}
$debug = Db::getInstance()->executeS('SELECT * FROM `' . _DB_PREFIX_ . 'gm_omniprice_cache` WHERE `id_product` = ' . $productId);
if ($debug) {
echo $omni->displayTable($debug, array_keys($debug[0]));
}
}
$timeElapsedSeconds = microtime(true) - $start;
echo round($timeElapsedSeconds, 4) . ' s<br/>';

View File

@@ -0,0 +1,13 @@
<?php
require_once('../../config/config.inc.php');
require_once('../../init.php');
$omni = Module::getInstanceByName('gm_omniprice');
$token = Tools::getValue('token');
$comparedToken = Tools::getAdminToken('gm_omniprice');
if ($token != $comparedToken) {
die('invalid token');
}
$omni->fillMissingCache(true);
echo 'FINISH<br/>';

View File

@@ -13,9 +13,12 @@ if (!defined('_PS_VERSION_'))
class Gm_OmniPrice extends Module
{
protected $prefix = '';
protected $ignoredGroups = [];
protected $batchSize = 100;
protected $ignoreCountries = false;
protected $ignoreNonEuCountries = false;
protected $ignoreCombinations = false;
protected $reindexOnSave = false;
protected $showIfNotEnoughHistoricalData = false;
@@ -24,6 +27,7 @@ class Gm_OmniPrice extends Module
protected $backgroundColor = '';
protected $showRealDiscount = false;
protected $indexInactive = false;
protected $skipBelowCost = false;
protected $activeMap = null;
protected $daysBack = 30;
protected $defaultShopId;
@@ -33,13 +37,44 @@ class Gm_OmniPrice extends Module
protected $today;
protected $yesterday;
protected $groupNames = [];
protected $euCountries = [
'AT', # Austria
'BE', # Belgium
'BG', # Bulgaria
'CY', # Cyprus
'CZ', # Czech Republic
'DE', # Germany
'DK', # Denmark
'EE', # Estonia
'GR', # Greece
'ES', # Spain
'FI', # Finland
'FR', # France
//'GB' # United Kingdom // in case they return ;-)
'HR', # Croatia
'HU', # Hungary
'IE', # Ireland
'IE2', # Ireland (2)
'IT', # Italy
'LT', # Lithuania
'LU', # Luxembourg
'LV', # Latvia
'MT', # Malta
'NL', # Netherlands
'PL', # Poland
'PT', # Portugal
'RO', # Romania
'SE', # Sweden
'SI', # Slovenia
'SK', # Slovakia
];
public function __construct()
{
$this->name = 'gm_omniprice';
$this->prefix = strtoupper($this->name);
$this->tab = 'front_office_features';
$this->version = '1.2.0';
$this->version = '1.2.11';
$this->author = 'GreenMouseStudio.com';
$this->need_instance = 0;
$this->bootstrap = true;
@@ -59,6 +94,7 @@ class Gm_OmniPrice extends Module
$this->daysBack = Configuration::get($this->prefix . '_DAYS');
$this->batchSize = Configuration::get($this->prefix . '_BATCH');
$this->ignoreCountries = Configuration::get($this->prefix . '_IGNORE_COUNTRIES');
$this->ignoreNonEuCountries = Configuration::get($this->prefix . '_IGNORE_NON_EU');
$this->ignoreCombinations = Configuration::get($this->prefix . '_IGNORE_COMBINATIONS');
$this->reindexOnSave = Configuration::get($this->prefix . '_REINDEX');
$this->textColor = Configuration::get($this->prefix . '_TEXT_COLOR');
@@ -67,11 +103,12 @@ class Gm_OmniPrice extends Module
$this->showIfNotEnoughHistoricalData = Configuration::get($this->prefix . '_SHOW_IF_NO_HISTORY');
$this->showRealDiscount = Configuration::get($this->prefix . '_SHOW_REAL_DISCOUNT');
$this->indexInactive = Configuration::get($this->prefix . '_INDEX_INACTIVE');
$this->skipBelowCost = Configuration::get($this->prefix . '_SKIP_BELOW_COST');
$this->defaultShopId = Configuration::get('PS_SHOP_DEFAULT');
$this->defaultCountryId = Configuration::get('PS_COUNTRY_DEFAULT');
$this->defaultGroupId = Configuration::get('PS_CUSTOMER_GROUP');
$this->defaultCurrencyId = Configuration::get('PS_CURRENCY_DEFAULT');
$this->defaultShopId = (int) Configuration::get('PS_SHOP_DEFAULT');
$this->defaultCountryId = (int) Configuration::get('PS_COUNTRY_DEFAULT');
$this->defaultGroupId = (int) Configuration::get('PS_CUSTOMER_GROUP');
$this->defaultCurrencyId = (int) Configuration::get('PS_CURRENCY_DEFAULT');
$this->today = date('Y-m-d');
$this->yesterday = date('Y-m-d', strtotime("-1 days"));
}
@@ -91,10 +128,12 @@ class Gm_OmniPrice extends Module
Configuration::updateValue($this->prefix . '_DAYS', 30);
Configuration::updateValue($this->prefix . '_BATCH', 100);
Configuration::updateValue($this->prefix . '_IGNORE_COUNTRIES', true);
Configuration::updateValue($this->prefix . '_IGNORE_NON_EU', true);
Configuration::updateValue($this->prefix . '_REINDEX', true);
Configuration::updateValue($this->prefix . '_SHOW_IF_NO_HISTORY', false);
Configuration::updateValue($this->prefix . '_SHOW_REAL_DISCOUNT', false);
Configuration::updateValue($this->prefix . '_INDEX_INACTIVE', false);
Configuration::updateValue($this->prefix . '_SKIP_BELOW_COST', false);
Configuration::updateValue($this->prefix . '_TEXT_COLOR', '#666666');
Configuration::updateValue($this->prefix . '_PRICE_COLOR', '#666666');
Configuration::updateValue($this->prefix . '_BG_COLOR', '#FFFFFF');
@@ -136,8 +175,9 @@ class Gm_OmniPrice extends Module
`id_group` INT(10) UNSIGNED NOT NULL,
`price_tex` DECIMAL(20,6),
`price_tin` DECIMAL(20,6),
`is_specific_price` TINYINT(1),
INDEX (`date`, `id_shop`, `id_product`)
`is_specific_price` TINYINT(1),
INDEX (`date`, `id_shop`, `id_product`),
INDEX (`date`, `id_product`)
) ENGINE = ' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=UTF8;') &&
Db::getInstance()->execute('
CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'gm_omniprice_cache` (
@@ -157,7 +197,7 @@ class Gm_OmniPrice extends Module
`date` DATE NOT NULL,
`id_shop` INT(10) UNSIGNED NOT NULL,
`id_product` INT(10) UNSIGNED NOT NULL,
INDEX (`date`, `id_shop`)
INDEX (`date`, `id_shop`)
) ENGINE = ' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=UTF8;');
}
@@ -177,6 +217,7 @@ class Gm_OmniPrice extends Module
!Configuration::deleteByName($this->prefix . '_TEXT_COLOR') ||
!Configuration::deleteByName($this->prefix . '_PRICE_COLOR') ||
!Configuration::deleteByName($this->prefix . '_IGNORE_COUNTRIES') ||
!Configuration::deleteByName($this->prefix . '_IGNORE_NON_EU') ||
!Configuration::deleteByName($this->prefix . '_IGNORE_COMBINATIONS') ||
!Configuration::deleteByName($this->prefix . '_TEXT_COLOR') ||
!Configuration::deleteByName($this->prefix . '_PRICE_COLOR') ||
@@ -204,6 +245,7 @@ class Gm_OmniPrice extends Module
{
$content = '';
$content .= $this->postProcess();
$content .= $this->displayGreenMouseModulesPanel();
$content .= $this->displayForm();
$content .= $this->displayInfo();
$content .= $this->displayInformationPanel();
@@ -216,6 +258,10 @@ class Gm_OmniPrice extends Module
if (Tools::isSubmit('submit' . $this->name))
{
$this->ignoredGroups = Tools::getValue('groupBox');
if (!is_array($this->ignoredGroups))
{
$this->ignoredGroups = [];
}
$groupsString = implode(',', $this->ignoredGroups);
Configuration::updateValue($this->prefix . '_GROUPS', $groupsString);
@@ -228,6 +274,9 @@ class Gm_OmniPrice extends Module
$this->ignoreCountries = Tools::getValue($this->prefix . '_IGNORE_COUNTRIES');
Configuration::updateValue($this->prefix . '_IGNORE_COUNTRIES', $this->ignoreCountries);
$this->ignoreNonEuCountries = Tools::getValue($this->prefix . '_IGNORE_NON_EU');
Configuration::updateValue($this->prefix . '_IGNORE_NON_EU', $this->ignoreNonEuCountries);
$this->ignoreCombinations = Tools::getValue($this->prefix . '_IGNORE_COMBINATIONS');
Configuration::updateValue($this->prefix . '_IGNORE_COMBINATIONS', $this->ignoreCombinations);
@@ -252,6 +301,9 @@ class Gm_OmniPrice extends Module
$this->indexInactive = Tools::getValue($this->prefix . '_INDEX_INACTIVE');
Configuration::updateValue($this->prefix . '_INDEX_INACTIVE', $this->indexInactive);
$this->skipBelowCost = Tools::getValue($this->prefix . '_SKIP_BELOW_COST');
Configuration::updateValue($this->prefix . '_SKIP_BELOW_COST', $this->skipBelowCost);
$output .= $this->displayConfirmation($this->l('Settings updated'));
}
return $output;
@@ -288,6 +340,25 @@ class Gm_OmniPrice extends Module
'hint' => $this->l('Analyze prices only for the default country, customers from other countries will see prices of the default country'),
'desc' => $this->l('Analyze prices only for the default country, customers from other countries will see prices of the default country')
),
array(
'type' => 'switch',
'label' => $this->l('Ignore non EU countries'),
'name' => $this->prefix . '_IGNORE_NON_EU',
'values' => array(
array(
'id' => 'active_on',
'value' => 1,
'label' => $this->l('Yes')
),
array(
'id' => 'active_off',
'value' => 0,
'label' => $this->l('No')
)
),
'hint' => $this->l('Skip non EU countries totally, customers from non EU countries will not see any message about previous price'),
'desc' => $this->l('Skip non EU countries totally, customers from non EU countries will not see any message about previous price')
),
array(
'type' => 'switch',
'label' => $this->l('Ignore combinations'),
@@ -417,6 +488,23 @@ class Gm_OmniPrice extends Module
'desc' => $this->l('Display price change percentage after the lowest previous price')
);
}
$inputs[] = array(
'type' => 'switch',
'label' => $this->l('Skip products sold below cost price'),
'name' => $this->prefix . '_SKIP_BELOW_COST',
'values' => array(
array(
'id' => 'active_on',
'value' => 1,
'label' => $this->l('Yes')
),
array(
'id' => 'active_off',
'value' => 0,
'label' => $this->l('No')
)
),
);
$fieldsForm = array(
'form' => array(
'legend' => array(
@@ -435,8 +523,7 @@ class Gm_OmniPrice extends Module
$helper->table = $this->table;
$helper->default_form_language = (int) Configuration::get('PS_LANG_DEFAULT');
$helper->module = $this;
$helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') ? Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG')
: 0;
$helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') ? Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') : 0;
$helper->identifier = $this->identifier;
$helper->submit_action = 'submit' . $this->name;
$helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false) . '&configure=' . $this->name . '&tab_module=' . $this->tab . '&module_name=' . $this->name;
@@ -448,6 +535,7 @@ class Gm_OmniPrice extends Module
$helper->fields_value[$this->prefix . '_DAYS'] = $this->daysBack;
$helper->fields_value[$this->prefix . '_BATCH'] = $this->batchSize;
$helper->fields_value[$this->prefix . '_IGNORE_COUNTRIES'] = $this->ignoreCountries;
$helper->fields_value[$this->prefix . '_IGNORE_NON_EU'] = $this->ignoreNonEuCountries;
$helper->fields_value[$this->prefix . '_IGNORE_COMBINATIONS'] = $this->ignoreCombinations;
$helper->fields_value[$this->prefix . '_REINDEX'] = $this->reindexOnSave;
$helper->fields_value[$this->prefix . '_TEXT_COLOR'] = $this->textColor;
@@ -455,6 +543,7 @@ class Gm_OmniPrice extends Module
$helper->fields_value[$this->prefix . '_BG_COLOR'] = $this->backgroundColor;
$helper->fields_value[$this->prefix . '_SHOW_REAL_DISCOUNT'] = $this->showRealDiscount;
$helper->fields_value[$this->prefix . '_INDEX_INACTIVE'] = $this->indexInactive;
$helper->fields_value[$this->prefix . '_SKIP_BELOW_COST'] = $this->skipBelowCost;
$helper->fields_value[$this->prefix . '_SHOW_IF_NO_HISTORY'] = $this->showIfNotEnoughHistoricalData;
return $helper->generateForm(array($fieldsForm));
@@ -484,12 +573,20 @@ class Gm_OmniPrice extends Module
{
$useReduction = false;
}
if ($this->skipBelowCost)
{
$rates = $this->getConversionRates();
$costPriceMap = $this->getCostPriceMap();
}
$specificPriceOutput = null;
foreach ($shopIds as $shopId)
{
$currencyIds = $this->getCurrencyIds($shopId);
$countryIds = $this->getCountryIds($shopId);
$groupIds = $this->getGroupIds($shopId);
$lastCurrencyId = end($currencyIds);
$lastCountryId = end($countryIds);
$lastGroupId = end($groupIds);
$attributesMap = $this->getProductAttributeMap($shopId);
if (!$productId)
{
@@ -591,8 +688,39 @@ class Gm_OmniPrice extends Module
$previousPrice = 0;
$previousDiscount = false;
}
$onDiscount = $this->checkIfProductIsDiscounted($discountedIds, $productId, $attributeId);
if (Tools::isSubmit('init'))
{
$onDiscount = false;
}
else
{
if (Module::isEnabled('groupinc'))
{
$onDiscount = $this->checkIfProductIsDiscounted($discountedIds, $productId, $attributeId) || (is_array($specificPriceOutput) && (count($specificPriceOutput) > 1)); //groupinc module support
}
else
{
$onDiscount = $this->checkIfProductIsDiscounted($discountedIds, $productId, $attributeId);
}
}
$onDiscountText = ($onDiscount ? $this->l('Yes') : $this->l('No'));
//check if product is sold below cost price
if ($this->skipBelowCost)
{
if ($this->checkIfProductIsSoldBelowCost(
$priceTex,
$costPriceMap,
$rates,
$shopId,
$productId,
$attributeId,
$currencyId
))
{
$onDiscount = false;
$onDiscountText = $this->l('Below cost');
}
}
$output .= '<tr>'
. '<td>' . ++$counter . '</td>'
. '<td>' . $productId . '</td>'
@@ -602,7 +730,7 @@ class Gm_OmniPrice extends Module
. '<td>' . $groupId . '</td>'
. '<td>' . $priceTin . ' (' . $priceTex . ') </td>'
. '<td>' . $previousPrice . '</td>'
. '<td>' . ($onDiscount ? $this->l('Yes') : $this->l('No')) . '</td>';
. '<td>' . $onDiscountText . '</td>';
$priceIsCorrect = ($priceTin > 0);
$priceChanged = (abs($previousPrice - $priceTin) > 0.01);
$discountChanged = ($previousDiscount != $onDiscount);
@@ -646,7 +774,7 @@ class Gm_OmniPrice extends Module
}
else
{
$output .= '<td>' . $this->l('Unknown') . '<</td>';
$output .= '<td>' . $this->l('Unknown') . '</td>';
}
}
else
@@ -723,7 +851,38 @@ class Gm_OmniPrice extends Module
$previousPrice = 0;
$previousDiscount = false;
}
$onDiscount = $this->checkIfProductIsDiscounted($discountedIds, $productId, $attributeId);
if (Tools::isSubmit('init'))
{
$onDiscount = false;
}
else
{
if (Module::isEnabled('groupinc'))
{
$onDiscount = $this->checkIfProductIsDiscounted($discountedIds, $productId, $attributeId) || (is_array($specificPriceOutput) && (count($specificPriceOutput) > 1)); //groupinc module support
}
else
{
$onDiscount = $this->checkIfProductIsDiscounted($discountedIds, $productId, $attributeId);
}
}
$onDiscountText = ($onDiscount ? $this->l('Yes') : $this->l('No'));
if ($this->skipBelowCost)
{
if ($this->checkIfProductIsSoldBelowCost(
$priceTex,
$costPriceMap,
$rates,
$shopId,
$productId,
$attributeId,
$currencyId
))
{
$onDiscount = false;
$onDiscountText = $this->l('Below cost');
}
}
$output .= '<tr>'
. '<td>' . ++$counter . '</td>'
. '<td>' . $productId . '</td>'
@@ -733,7 +892,7 @@ class Gm_OmniPrice extends Module
. '<td>' . $groupId . '</td>'
. '<td>' . $priceTin . ' (' . $priceTex . ') </td>'
. '<td>' . $previousPrice . '</td>'
. '<td>' . ($onDiscount ? $this->l('Yes') : $this->l('No')) . '</td>';
. '<td>' . $onDiscountText . '</td>';
$priceIsCorrect = ($priceTin > 0);
$priceChanged = (abs($previousPrice - $priceTin) > 0.01);
$discountChanged = ($previousDiscount != $onDiscount);
@@ -813,7 +972,10 @@ class Gm_OmniPrice extends Module
}
}
}
$this->addProductToIndex($shopId, $productId, $this->today);
if ($currencyId == $lastCurrencyId && $groupId == $lastGroupId && $countryId == $lastCountryId)
{
$this->addProductToIndex($shopId, $productId, $this->today);
}
}
}
}
@@ -848,9 +1010,9 @@ class Gm_OmniPrice extends Module
. ' AND `date` <= \'' . $date . '\''
. ' ORDER BY `date` DESC'
);
if ($attributeId != 0 && $row == false)
{
$attributeId = 0;
$row = Db::getInstance()->getRow(
'SELECT `price_tin`, `price_tex` '
. ' FROM `' . _DB_PREFIX_ . 'gm_omniprice_history` '
@@ -1058,7 +1220,18 @@ class Gm_OmniPrice extends Module
{
if (!in_array($row['id_country'], $ids))
{
$ids[] = (int) $row['id_country'];
if ($this->ignoreNonEuCountries)
{
$country = new Country($row['id_country']);
if (in_array($country->iso_code, $this->euCountries))
{
$ids[] = (int) $row['id_country'];
}
}
else
{
$ids[] = (int) $row['id_country'];
}
}
}
}
@@ -1174,12 +1347,19 @@ class Gm_OmniPrice extends Module
if (Tools::isSubmit('omnidebug'))
{
var_export($params);
echo $this->context->country->iso_code;
}
if ($this->ignoreNonEuCountries)
{
if (!in_array($this->context->country->iso_code, $this->euCountries))
{
return false;
}
}
$lowestCachedPrice = $this->getLowestCachedPrice($params);
}
$realDiscount = '';
if ($showRealDiscount && isset($hookParams['product']['price_amount']))
if ($showRealDiscount && $lowestCachedPrice && isset($hookParams['product']['price_amount']))
{
$currentPrice = $hookParams['product']['price_amount'];
$previousPrice = $lowestCachedPrice['raw'];
@@ -1201,6 +1381,7 @@ class Gm_OmniPrice extends Module
$this->context->smarty->assign(
[
'gm_omniprice_lowest' => $lowestCachedPrice['formatted'],
'gm_omniprice_lowest_raw' => $lowestCachedPrice['raw'],
'gm_omniprice_days' => $this->daysBack,
'gm_omniprice_color' => $this->textColor,
'gm_omniprice_price_color' => $this->priceColor,
@@ -1258,7 +1439,7 @@ class Gm_OmniPrice extends Module
if ($price)
{
return [
'formatted' => $this->getFormattedPrice($price),
'formatted' => $this->getFormattedPrice(round($price)),
'raw' => $price
];
}
@@ -1272,13 +1453,12 @@ class Gm_OmniPrice extends Module
. ' AND `id_currency` = ' . $params['id_currency']
. ' AND `id_country` = ' . $params['id_country']
. ' AND `id_group` = ' . $params['id_group']
. ' AND `id_product_attribute` = ' . $params['id_product_attribute']
. ' AND `id_product_attribute` = 0'
);
if ($price)
{
return [
'formatted' => $this->getFormattedPrice($price),
'formatted' => $this->getFormattedPrice(round($price)),
'raw' => $price
];
}
@@ -1306,6 +1486,9 @@ class Gm_OmniPrice extends Module
$field = '`price_tin`';
$arrayField = 'price_tin';
}
$date_history = date( 'Y-m-d', strtotime( '-30 days', time() ) );
$prices = Db::getInstance()->executeS(
'SELECT ' . $field . ', `is_specific_price`'
. ' FROM `' . _DB_PREFIX_ . 'gm_omniprice_history`'
@@ -1314,13 +1497,14 @@ class Gm_OmniPrice extends Module
. ' AND `id_currency` = ' . $params['id_currency']
. ' AND `id_country` = ' . $params['id_country']
. ' AND `id_group` = ' . $params['id_group']
. ' AND `id_product_attribute` = ' . $params['id_product_attribute'] . ' ORDER BY price_tin ASC LIMIT 1'
. ' AND `id_product_attribute` = ' . $params['id_product_attribute']
. ' AND date >= \'' . $date_history . '\''
);
if ((count($prices) == 1) && ($prices[0]['is_specific_price']))
{
{;
return
[
'formatted' => $this->getFormattedPrice($prices[0][$arrayField]),
'formatted' => $this->getFormattedPrice(round($prices[0][$arrayField])),
'raw' => $prices[0][$arrayField]
];
}
@@ -1334,17 +1518,23 @@ class Gm_OmniPrice extends Module
. ' AND `id_currency` = ' . $params['id_currency']
. ' AND `id_country` = ' . $params['id_country']
. ' AND `id_group` = ' . $params['id_group']
. ' AND `id_product_attribute` = ' . $params['id_product_attribute'] . ' ORDER BY price_tin ASC LIMIT 1'
. ' AND `id_product_attribute` = 0'
. ' AND date >= \'' . $date_history . '\''
);
if ((count($prices) == 1) && ($prices[0]['is_specific_price']))
{
return
[
'formatted' => $this->getFormattedPrice($prices[0][$arrayField]),
'formatted' => $this->getFormattedPrice(round($prices[0][$arrayField])),
'raw' => $prices[0][$arrayField]
];
}
}
return
[
'formatted' => $this->getFormattedPrice(round(Product::getPriceStatic( $params['id_product'], true, $params['id_product_attribute'], 2, null, false, false ) ))
];
return false;
}
@@ -1373,7 +1563,7 @@ class Gm_OmniPrice extends Module
{
foreach ($result as $row)
{
$prices[$row['id_product_attribute']] = $this->getFormattedPrice($row['price']);
$prices[$row['id_product_attribute']] = $this->getFormattedPrice(round($row['price']));
}
}
else
@@ -1394,7 +1584,7 @@ class Gm_OmniPrice extends Module
{
foreach ($result as $row)
{
$prices[$row['id_product_attribute']] = $this->getFormattedPrice($row['price']);
$prices[$row['id_product_attribute']] = $this->getFormattedPrice(round($row['price']));
}
}
}
@@ -1922,49 +2112,52 @@ class Gm_OmniPrice extends Module
$currencyIds = $this->getCurrencyIds($shopId);
$countryIds = $this->getCountryIds($shopId);
$groupIds = $this->getGroupIds($shopId);
$productIds = $this->getProductIdsInHistory($shopId);
foreach ($currencyIds as $currencyId)
{
foreach ($countryIds as $countryId)
{
foreach ($groupIds as $groupId)
{
$query = 'SELECT `date`, `id_product`, `id_product_attribute` FROM `' . _DB_PREFIX_ . 'gm_omniprice_history` '
. ' WHERE `id_shop` = ' . $shopId . ' AND `id_currency` = ' . $currencyId .
' AND `id_country` = ' . $countryId . ' AND `id_group` = ' . $groupId . ' ORDER BY `date` ASC';
$res = Db::getInstance()->executeS($query);
$datesMap = [];
if ($res)
foreach ($productIds as $productId)
{
foreach ($res as $row)
$query = 'SELECT `date`, `id_product`, `id_product_attribute` FROM `' . _DB_PREFIX_ . 'gm_omniprice_history` '
. ' WHERE `id_product` = ' . $productId . ' AND `id_shop` = ' . $shopId . ' AND `id_currency` = ' . $currencyId .
' AND `id_country` = ' . $countryId . ' AND `id_group` = ' . $groupId . ' ORDER BY `date` ASC';
$res = Db::getInstance()->executeS($query);
$datesMap = [];
if ($res)
{
$day = $row['date'];
$productId = $row['id_product'];
$attributeId = $row['id_product_attribute'];
if ($day < $date)
foreach ($res as $row)
{
$datesMap[$productId][$attributeId][] = $day;
}
}
//$output .= var_export($datesMap, true);
foreach ($datesMap as $productId => $dateItem)
{
foreach ($dateItem as $attributeId => $dates)
{
$output .= "Product ID {$productId}, attribute ID: {$attributeId}<br/>";
$datesCount = count($dates);
if ($datesCount > 1)
$day = $row['date'];
$productId = $row['id_product'];
$attributeId = $row['id_product_attribute'];
if ($day < $date)
{
for ($i = 0; $i < $datesCount - 1; $i++)
{
$output .= ' ' . $dates[$i] . ' ' . $this->l('this price may be deleted') . '<br/>';
$where = '`id_shop` = ' . $shopId . ' AND `id_currency` = ' . $currencyId .
' AND `id_country` = ' . $countryId . ' AND `id_group` = ' . $groupId;
$where .= ' AND `id_product` = ' . $productId . ' AND `id_product_attribute` = ' . $attributeId;
$where .= ' AND `date` = \'' . $dates[$i] . '\'';
Db::getInstance()->delete('gm_omniprice_history', $where);
}
$datesMap[$productId][$attributeId][] = $day;
}
}
foreach ($datesMap as $productId => $dateItem)
{
foreach ($dateItem as $attributeId => $dates)
{
$output .= "Product ID {$productId}, attribute ID: {$attributeId}<br/>";
$datesCount = count($dates);
if ($datesCount > 2)
{
for ($i = 0; $i < $datesCount - 2; $i++)
{
$output .= ' ' . $dates[$i] . ' ' . $this->l('this price may be deleted') . '<br/>';
$where = '`id_shop` = ' . $shopId . ' AND `id_currency` = ' . $currencyId .
' AND `id_country` = ' . $countryId . ' AND `id_group` = ' . $groupId;
$where .= ' AND `id_product` = ' . $productId . ' AND `id_product_attribute` = ' . $attributeId;
$where .= ' AND `date` = \'' . $dates[$i] . '\'';
Db::getInstance()->delete('gm_omniprice_history', $where);
}
}
$output .= ' ' . $dates[$datesCount - 1] . ' ' . $this->l('this price is still needed') . '<br/>';
}
$output .= ' ' . $dates[$datesCount - 1] . ' ' . $this->l('this price is still needed') . '<br/>';
}
}
}
@@ -1980,6 +2173,22 @@ class Gm_OmniPrice extends Module
}
}
protected function getProductIdsInHistory($shopId)
{
$ids = [];
$query = 'SELECT DISTINCT `id_product` FROM `' . _DB_PREFIX_ . 'gm_omniprice_history` '
. ' WHERE `id_shop` = ' . $shopId;
$res = Db::getInstance()->executeS($query);
if ($res)
{
foreach ($res as $row)
{
$ids[] = (int) $row['id_product'];
}
}
return $ids;
}
public function hookDisplayAdminProductsExtra(array $params)
{
$data = [];
@@ -2182,13 +2391,97 @@ class Gm_OmniPrice extends Module
public function productIsActive($productId, $shopId)
{
$activeMap = $this->getActiveMap();
if ($productId && isset($activeMap[$shopId]) && isset($activeMap[$shopId][$productId]))
if (isset($activeMap[$shopId][$productId]))
{
return ($activeMap[$shopId][$productId] == 1);
}
else
return false;
}
public function getCostPriceMap()
{
$map = [];
$query = 'SELECT `id_product`, `id_shop`, `wholesale_price` FROM `' . _DB_PREFIX_ . 'product_shop` WHERE `wholesale_price` > 0';
$res = Db::getInstance()->executeS($query);
if ($res)
{
return false;
foreach ($res as $row)
{
$shopId = (int) $row['id_shop'];
$productId = (int) $row['id_product'];
$costPrice = $row['wholesale_price'];
$map[$shopId][$productId][0] = $costPrice;
}
}
$query = 'SELECT `id_product`, `id_product_attribute`, `id_shop`, `wholesale_price` FROM `' . _DB_PREFIX_ . 'product_attribute_shop` WHERE `wholesale_price` > 0';
$res = Db::getInstance()->executeS($query);
if ($res)
{
foreach ($res as $row)
{
$shopId = (int) $row['id_shop'];
$productId = (int) $row['id_product'];
$attributeId = (int) $row['id_product_attribute'];
$costPrice = $row['wholesale_price'];
$map[$shopId][$productId][$attributeId] = $costPrice;
}
}
return $map;
}
public function getConversionRates()
{
$rates = [];
$currencies = Db::getInstance()->executeS('
SELECT `id_shop`, `id_currency`, `conversion_rate`
FROM `' . _DB_PREFIX_ . 'currency_shop`');
if ($currencies)
{
foreach ($currencies as $currency)
{
$shopId = (int) $currency['id_shop'];
$currencyId = (int) $currency['id_currency'];
$rate = $currency['conversion_rate'];
$rates[$currencyId][$shopId] = $rate;
}
}
return $rates;
}
public function checkIfProductIsSoldBelowCost($priceTex, $costPriceMap, $rates, $shopId, $productId, $attributeId, $currencyId)
{
$conversionRate = $rates[$currencyId][$shopId];
$costPrice = $costPriceMap[$shopId][$productId][$attributeId];
$convertedCostPrice = $costPrice / $conversionRate;
return ($priceTex < $convertedCostPrice);
}
protected function displayGreenMouseModulesPanel()
{
$url = 'https://codecanyon.net/user/greenmousestudio/portfolio';
$isoCode = Context::getContext()->language->iso_code;
$translations = [
'en' => "Check out more <a href=\"$url\" target=\"_blank\">PrestaShop modules from GreenMouseStudio</a>",
'fr' => "Découvrez plus de <a href=\"$url\" target=\"_blank\">modules PrestaShop de GreenMouseStudio</a>",
'es' => "Descubra más <a href=\"$url\" target=\"_blank\">módulos de PrestaShop de GreenMouseStudio</a>",
'de' => "Entdecken Sie mehr <a href=\"$url\" target=\"_blank\">PrestaShop-Module von GreenMouseStudio</a>",
'it' => "Scopri di più <a href=\"$url\" target=\"_blank\">moduli PrestaShop di GreenMouseStudio</a>",
'pl' => "Zobacz więcej <a href=\"$url\" target=\"_blank\">modułów PrestaShop od GreenMouseStudio</a>",
'pt' => "Confira mais <a href=\"$url\" target=\"_blank\">módulos PrestaShop do GreenMouseStudio</a>",
'nl' => "Bekijk meer <a href=\"$url\" target=\"_blank\">PrestaShop-modules van GreenMouseStudio</a>",
'sv' => "Upptäck fler <a href=\"$url\" target=\"_blank\">PrestaShop-moduler från GreenMouseStudio</a>",
'da' => "Se flere <a href=\"$url\" target=\"_blank\">PrestaShop-moduler fra GreenMouseStudio</a>",
'fi' => "Tutustu lisää <a href=\"$url\" target=\"_blank\">GreenMouseStudion PrestaShop-moduuleihin</a>",
'cs' => "Podívejte se na další <a href=\"$url\" target=\"_blank\">moduly PrestaShop od GreenMouseStudio</a>",
'sk' => "Pozrite si viac <a href=\"$url\" target=\"_blank\">modulov PrestaShop od GreenMouseStudio</a>",
'hu' => "Nézzen meg több <a href=\"$url\" target=\"_blank\">PrestaShop modult a GreenMouseStudio-tól</a>",
'ro' => "Descoperiți mai multe <a href=\"$url\" target=\"_blank\">module PrestaShop de la GreenMouseStudio</a>",
'el' => "Δείτε περισσότερες <a href=\"$url\" target=\"_blank\">μονάδες PrestaShop από το GreenMouseStudio</a>",
];
$message = isset($translations[$isoCode]) ? $translations[$isoCode] : $translations['en'];
$content = '';
$content .= '<p class="alert alert-warning">' . $message . '</p>';
return $content;
}
}

View File

View File

View File

View File

View File

@@ -5,33 +5,39 @@ $_MODULE = array();
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_90a0c7b2104a67d391df6f2db66300e3'] = 'OmniPrice - zgodność cen z dyrektywą Omnibus';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_2f2aaa2e0f7ba09de9a5f449ba5f45af'] = 'Wyświetla informację o najniższej cenie przed promocją';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_c888438d14855d7d96a2724ee9c306bd'] = 'Zapisano ustawienia';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_f4f70727dc34561dfde1a3c529b6205c'] = 'Ustawienia';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_1901606ea069a83dc7beea17881ef95a'] = 'Okres';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_b1e1f9076cca4dd59d55975e7a318f38'] = 'Liczba dni przed promocją podlegająca analizie';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_62fefba7aea0bdb51b8935c165195610'] = 'Ignoruj kraje';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_93cba07454f06a4a960172bbd6e2a435'] = 'Tak';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_bafd7322c6e97d25b6299b5d6fe8920b'] = 'Nie';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_dc4143a87bf30fc020b5285c0943567c'] = 'Analizuj ceny tylko dla domyślnego kraju, klienci z innych krajów będą widzieli ceny dla domyślnego kraju';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_7f01c3611adcbec6862b1c4001f0f300'] = 'Ignoruj kraje spoza UE';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_f0e0af7ffec706830ed933f0aa52c841'] = 'Całkowicie pomija kraje spoza UE, klientom z tych krajów nie będą pokazywane żadne komunikaty o poprzednich cenach';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_b7b08b9fdd4d8d7a01eaf832777db241'] = 'Ignoruj kombinacje';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_a9a3387e6b5111e07b969cfa06d68586'] = 'Analizuj ceny tylko dla domyślnej kombinacji produktu, zalecane jeżeli kombinacje nie mają wpływu na cenę';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_09c12c14a8bdcb5579a6163a4ce736e8'] = 'Ignorowane grupy';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_c8885049351230f4d9e65f2997e2de57'] = 'Ignoruj wybrane grupy, klienci z tych grup będą widzieli cenę dla grupy domyślnej (Klient), zalecane jeżeli nie są używane rabaty grupowe';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_1300769d8d72fc8218b40772f1c25efc'] = 'Pakiet produktów';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_1300769d8d72fc8218b40772f1c25efc'] = 'Pakiet produktow';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_419e727dd8d9ac44fd248de2eda589b4'] = 'Liczba produktów przetwarzana podczas pojedynczego przebiegu zadania CRON';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_e09109328229ca6967e3ea981ee158dd'] = 'Reindeksuj podczas zapisu produktu';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_bd0b2b3a1ded97ddd1d70591f1af8960'] = 'Reindeksuje produkt w momencie jego zapisu ';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_368d9ac76af05f714092bc808a426bfc'] = 'Kolor tła';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_5f111ae4c490902059da2004cbc8b424'] = 'Kolor tekstu';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_d6a3bb2945a3fa2ac63739ec31c00060'] = 'Kolor ceny';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_ad1338e53c6bec090eaab52628716805'] = 'Pokaż komunikat nawet gdy brak historii';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_0a7291f2167ca2f321c44157ded8e2f8'] = 'Dla przecenionych produktów, dla których brak informacji o poprzednich cenach, pokazuje aktualną cenę promocyjną jako najniższą cenę historyczną';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_ad1338e53c6bec090eaab52628716805'] = 'Pokaż komunikat nawet gdy za mało historii';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_0a7291f2167ca2f321c44157ded8e2f8'] = 'Dla przecenionych produktów, dla których brak informacji o poprzednich cenach, pokazuje jedyną zapamiętaną cenę promocyjną jako najniższą cenę historyczną';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_38ce18494ca0426bdbd483c5c4cf9ec2'] = 'Indeksuj nieaktywne produkty';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_37d66737bda18cffdc0342145c644e52'] = 'Zapisuje historię cen produktu nawet jeżeli jest nieaktywny';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_90ce4a97e9f26453b3deca306fa6a1d5'] = 'Pokaż rzeczywistą obniżkę względem poprzedniej ceny';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_dad8fdc91311e7e8cd8431bc54036090'] = 'Pokazuje procentową różnicę między aktualną ceną produktu, a najniższą ceną poprzednią';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_8dcea44ea2df2fb48f9f2eab63cbe8e6'] = 'Pomiń produkty sprzedawane poniżej ceny zakupu';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_f4f70727dc34561dfde1a3c529b6205c'] = 'Ustawienia';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_c9cc8cce247e49bae79f15173ce97354'] = 'Zapisz';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_29d52349ac08e64641ca944b5089945c'] = 'ID domyślnego sklepu:';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_1033eb0896e0e3ccde90fe8ea13c1fb2'] = 'ID domyślnego kraju:';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_f770b9c02b33fe4e7246f96b12887a01'] = 'ID domyślnej grupy:';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_97a3473f848ca730a12ddd300fa36d38'] = 'ID domyślnej waluty:';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_1033eb0896e0e3ccde90fe8ea13c1fb2'] = 'ID domyslnego kraju:';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_f770b9c02b33fe4e7246f96b12887a01'] = 'ID domyslnej grupy:';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_212713efb37cd2f521ee584f1dbb5f0b'] = 'ID sklepu:';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_36f12776fd15f301a8b51336b49a7043'] = 'Wszystkie produkty zaindeksowane';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_f2f4e21b8a93962f211c50a54d20653d'] = 'To jeszcze nie koniec, uruchom mnie ponownie';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_97f08a40f22a625d0cbfe03db3349108'] = 'ID produktu';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_b9a7a7f4250389169ecdbe30bf388e62'] = 'ID kombinacji';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_28a382bd262d1e28a94c3ef716364f45'] = 'ID kraju';
@@ -42,6 +48,9 @@ $_MODULE['<{gm_omniprice}prestashop>gm_omniprice_51aa40e214d39cada27aec2074df80d
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_50ead5491751f11a8f21884a66532f20'] = 'Na przecenie';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_004bf6c9a40003140292e97330236c53'] = 'Akcja';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_13f5e3a5ca5014256ec30d986f6365fb'] = 'Najnizsza cena';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_2486a303176f5a6a68ecf83455ddc55c'] = 'Poniżej kosztów';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_88183b946cc5f0e8c96b2e66e1c74a7e'] = 'Nieznana';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_e681a3b45989b468533c4b90ee960bf9'] = 'Nie dotyczy';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_7b44391e916811603c318ffd2caaf1b1'] = 'Bez zmian';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_c017b7425d07d95d17494f3ed6830de9'] = 'Gromadzenie historii cen';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_fe25cfca4b1b64ab36d337972864b82e'] = 'Czyszczenie starej historii cen';
@@ -51,7 +60,16 @@ $_MODULE['<{gm_omniprice}prestashop>gm_omniprice_8b550b54d30d109322b24fd570f14c0
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_85ddea2392785df2fb727165e63e7266'] = 'Grupy z cenami specyficznymi:';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_c855e004485babe5c373301a3efe35c3'] = 'Grupy z regułami cenowymi katalogu:';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_b23c2990245b2f2e9547f28992096e35'] = 'Produkty posiadają kombinacje z wpływem na cenę:';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_9e003b5f5cd7e7715720a6621894b655'] = 'Pojedyncze kombinacje posiadają rabaty:';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_8d355f74fb73e3c11bb9239e54cde7a7'] = 'Liczba aktywnych krajów:';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_a2c5b5f105f1e71608e3c9d9dee9f2a4'] = 'Liczba aktywnych walut:';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_2b3720269ac2364ac58c8769ba8c9c25'] = 'Liczba cen zgromadzonych w historii:';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_6adf97f83acf6453d4a6a4b1070f3754'] = 'Brak';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_114d3c884cee5cdb580d88fd277e847b'] = 'ta cena może zostać skasowana';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_fa19e91aa306519181f7b8a19743b5f1'] = 'ta cena jest ciągle potrzebna';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_63b539babcf7978229d66ba4052ca71f'] = 'Cena promocyjna';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_4d8adffdc001189e0202c01ac529a3a9'] = 'Cena regularna';
$_MODULE['<{gm_omniprice}prestashop>gm_omniprice_148b76150603892408248b0ed5a5dd51'] = 'Najniższa poprzednia cena';
$_MODULE['<{gm_omniprice}prestashop>price_7a6e48674dee5dd4a09f41e487d2c896'] = 'Najniższa cena w okresie %d dni przed promocją:';
$_MODULE['<{gm_omniprice}prestashop>tab_11ac0a790117ce9772284501afb324e5'] = 'Produkt zaindeksowany dzisiaj:';
$_MODULE['<{gm_omniprice}prestashop>tab_93cba07454f06a4a960172bbd6e2a435'] = 'Tak';
@@ -59,4 +77,4 @@ $_MODULE['<{gm_omniprice}prestashop>tab_bafd7322c6e97d25b6299b5d6fe8920b'] = 'Ni
$_MODULE['<{gm_omniprice}prestashop>tab_0968b8dc12087a20de5b608d6617b925'] = 'Dla uproszczenia, poniższa tabela pokazuje historię zmian cen dla domyślnej waluty, kraju, grupy klienta oraz atrybutu.';
$_MODULE['<{gm_omniprice}prestashop>tab_44749712dbec183e983dcd78a7736c41'] = 'Data';
$_MODULE['<{gm_omniprice}prestashop>tab_3601146c4e948c32b6424d2c0a7f0118'] = 'Cena';
$_MODULE['<{gm_omniprice}prestashop>tab_626a54d37d402d449d6d7541911e0952'] = 'Promocja';
$_MODULE['<{gm_omniprice}prestashop>tab_58b2e2eff900334f1aea87c9bf05903c'] = 'Typ ceny';

View File

@@ -0,0 +1,10 @@
<?php
if (!defined('_PS_VERSION_')) {
exit;
}
function upgrade_module_1_1_11($object)
{
Configuration::updateValue('GM_OMNIPRICE_SHOW_REAL_DISCOUNT', false);
return true;
}

View File

@@ -0,0 +1,10 @@
<?php
if (!defined('_PS_VERSION_')) {
exit;
}
function upgrade_module_1_2_0($object)
{
Configuration::updateValue('GM_OMNIPRICE_INDEX_INACTIVE', false);
return true;
}

View File

@@ -0,0 +1,10 @@
<?php
if (!defined('_PS_VERSION_')) {
exit;
}
function upgrade_module_1_2_3($object)
{
Configuration::updateValue('GM_OMNIPRICE_IGNORE_NON_EU', false);
return true;
}

View File

@@ -1,13 +1,5 @@
.gm_omniprice {
margin-top: 5px;
display: inline-block;
padding: 5px 0;
font-weight: 300;
background: none !important;
color: #636363 !important;
font-size: 12px !important;
}
.gm_omniprice span {
color: #000 !important;
margin-top: 5px;
display: inline-block;
padding: 5px;
}

View File

@@ -1,4 +1,7 @@
<span class="gm_omniprice" style="color:{$gm_omniprice_color}; background-color: {$gm_omniprice_background};">
{l s='Lowest price within %d days before promotion:' sprintf=[$gm_omniprice_days] mod='gm_omniprice'}
<span class="gm_omniprice_lowest" style="color:{$gm_omniprice_price_color};">{$gm_omniprice_lowest}</span>
{if $gm_omniprice_show_real_discount && $gm_omniprice_real_discount}
<span class="gm_omniprice_real_discount">({$gm_omniprice_real_discount})</span>
{/if}
</span>

View File

@@ -6,14 +6,14 @@
<tr>
<th class="fixed-width-md"><span class="title_box">{l s='Date' mod='gm_omniprice'}</span></th>
<th class="fixed-width-md"><span class="title_box">{l s='Price' mod='gm_omniprice'}</span></th>
<th class="fixed-width-md"><span class="title_box">{l s='Promotion' mod='gm_omniprice'}</span></th>
<th class="fixed-width-md"><span class="title_box">{l s='Price type' mod='gm_omniprice'}</span></th>
</tr>
</thead>
{foreach from=$historyData item=historyItem}
<tr>
<td>{$historyItem.date}</td>
<td>{$historyItem.price_tin}</td>
<td>{if $historyItem.is_specific_price == '1'}{l s='Yes' mod='gm_omniprice'}{/if}{if $historyItem.is_specific_price == '0'}{l s='No' mod='gm_omniprice'}{/if}</td>
<td>{$historyItem.type}</td>
</tr>
{/foreach}
</table>