- Posts: 91
- Thank you received: 5
Custom field sorted by name and not a numeric value
9 years 5 months ago #271055
by bolando
Custom field sorted by name and not a numeric value was created by bolando
-- HikaShop version -- : 3.1.1
-- Joomla version -- : 3.7.2
-- PHP version -- : 7.1
-- Browser(s) name and version -- : Chrome latest
I created a shop with tiles and each product has a custom field price/m2. When I sort products by this fields, the sort is A-Z, so it goes like
100, 129, 150, 40, 75
Is it possible to sort them by value: 40,75,100,129,150? How?
Thank you
-- Joomla version -- : 3.7.2
-- PHP version -- : 7.1
-- Browser(s) name and version -- : Chrome latest
I created a shop with tiles and each product has a custom field price/m2. When I sort products by this fields, the sort is A-Z, so it goes like
100, 129, 150, 40, 75
Is it possible to sort them by value: 40,75,100,129,150? How?
Thank you
Please Log in or Create an account to join the conversation.
9 years 5 months ago #271056
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Custom field sorted by name and not a numeric value
Hello,
I'm afraid that it won't be possible because the sorting is made directly by the database (MySQL) and the custom field is stored as text. So MySQL sort the content using an alphabetical ordering.
Regards,
I'm afraid that it won't be possible because the sorting is made directly by the database (MySQL) and the custom field is stored as text. So MySQL sort the content using an alphabetical ordering.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
9 years 5 months ago #271164
by bolando
Replied by bolando on topic Custom field sorted by name and not a numeric value
It was possible - I changed in mySQL #__hikashop_product table this field from text to smallint and it works, I attach my table structure.
Please Log in or Create an account to join the conversation.
Time to create page: 0.052 seconds