fix products listing

This commit is contained in:
2026-03-27 23:17:21 +01:00
parent ec05101037
commit 9ec329b1d6
429 changed files with 9816 additions and 3774 deletions

View File

@@ -16,22 +16,16 @@ func New() UILocaleSelectorRepo {
return &LocaleSelectorRepo{}
}
func (repo *LocaleSelectorRepo) GetLanguages() ([]model.Language, error) {
func (r *LocaleSelectorRepo) GetLanguages() ([]model.Language, error) {
var languages []model.Language
err := db.DB.Table("b2b_language").Scan(&languages).Error
err := db.Get().Find(&languages).Error
return languages, err
}
func (repo *LocaleSelectorRepo) GetCountriesAndCurrencies() ([]model.Country, error) {
func (r *LocaleSelectorRepo) GetCountriesAndCurrencies() ([]model.Country, error) {
var countries []model.Country
err := db.DB.
Table("b2b_countries").
Select("b2b_countries.id, b2b_countries.name, b2b_countries.flag, ps_currency.id_currency as id_currency, ps_currency.name as currency_name, ps_currency.iso_code as currency_iso_code").
Joins("LEFT JOIN ps_currency ON ps_currency.id_currency = b2b_countries.currency_id").
Scan(&countries).Error
err := db.Get().
Preload("PSCurrency").
Find(&countries).Error
return countries, err
}