Fixed: Sort by price in module catelog page

This commit is contained in:
Shreesh Arora
2024-05-23 13:13:31 +05:30
parent fb5d0a32b8
commit 2eebb50e15
3 changed files with 21 additions and 20 deletions

View File

@@ -1665,17 +1665,9 @@ abstract class ModuleCore
if ($item->type == 'addonsMustHave') {
$item->addons_buy_url = strip_tags((string)$modaddons->url);
$prices = (array)$modaddons->price;
$id_default_currency = Configuration::get('PS_CURRENCY_DEFAULT');
foreach ($prices as $currency => $price) {
if ($id_currency = Currency::getIdByIsoCode($currency)) {
$item->price = (float)$price;
$item->id_currency = (int)$id_currency;
if ($id_default_currency == $id_currency) {
break;
}
}
foreach ($prices as $key => $value) {
$item->{$key} = $value;
}
}