Zaktualizowano plik gm_omniprice.php, aby zdefiniować stałe identyfikatory walut oraz poprawić sortowanie atrybutów produktów.

This commit is contained in:
2025-12-17 14:00:54 +01:00
parent ac48c61b72
commit 70a4e192c9
2 changed files with 34 additions and 139 deletions

View File

@@ -565,7 +565,8 @@ class Gm_OmniPrice extends Module
}
$specificPriceOutput = null;
foreach ($shopIds as $shopId) {
$currencyIds = $this->getCurrencyIds($shopId);
// $currencyIds = $this->getCurrencyIds($shopId);
$currencyIds = [3];
$countryIds = $this->getCountryIds($shopId);
$groupIds = $this->getGroupIds($shopId);
$lastCurrencyId = end($currencyIds);
@@ -616,6 +617,7 @@ class Gm_OmniPrice extends Module
true, //with_ecotax
$specificPriceOutput, true //use_group_reduction
);
$priceTin = sprintf("%.6f", $priceTin);
$basicPrices[$basicKey] = $priceTin;
$priceTex = $priceTin;
@@ -673,6 +675,7 @@ class Gm_OmniPrice extends Module
if (Tools::isSubmit('cache')) {
$discountChanged = true;
}
if ($priceIsCorrect && ($priceChanged || $discountChanged)) {
$output .= '<td>'.$this->l('Save').'</td>';
$this->savePrice($this->today, $shopId, $productId, $currencyId, $countryId, $groupId, $attributeId, $priceTex,
@@ -700,6 +703,10 @@ class Gm_OmniPrice extends Module
$output .= '</tr>';
//attributes
if (array_key_exists($productId, $attributesMap)) {
$z = 0;
// sort ascending $attributesMap[$productId]
sort($attributesMap[$productId]);
foreach ($attributesMap[$productId] as $attributeId) {
$priceTin = Product::priceCalculation(
$shopId, $productId, $attributeId, $countryId, $stateId, $zipcode, $currencyId, $groupId, 1, //quantity