[Skip to main content](#vessel-content)

#   Cursor filter for custom fields

##

- **[raven-worx](/forum/user/36141-raven-worx "View raven-worx's Profile")**
- [![raven-worx's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/36141-raven-worx "View raven-worx's Profile") Topic Author
- [ Offline](/forum/user/36141-raven-worx)

Less More

- Posts: 23
- Thank you received: 0
-
-

11 years 9 months ago -  11 years 9 months ago [\#190639](#190639) by [raven-worx](/forum/user/36141-raven-worx "View raven-worx's Profile")  *[Cursor filter for custom fields](/forum/45-filters-search/874969-cursor-filter-for-custom-fields#190639 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.3.28  Hi,  i have a custom field (type text - also tried single selection list) where i only enter integer values. Now i want a cursor on that field.  Unfortunately i am not allowed to select a custom field for the cursor filter type. But what exactly the reason for that? I read in another forum thread that you are using BETWEEN SQL query command. The BETWEEN command is applicable for columns of the type integer, string and datetime. So it would be possible to use it. Alternatively it would also be possible to use CONVERT and CAST commands to force the values to be number types before using the BETWEEN command. The cursor filter anyway only makes sense for numeric fields, so in case someone uses the cursor filter on a non-numeric field it is his own fault.  I think this would be a feature a lot of people are missing?!")* was created by *[raven-worx](/forum/user/36141-raven-worx "View raven-worx's Profile")*

-- HikaShop version -- : 2.3.5
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.3.28

Hi,

i have a custom field (type text - also tried single selection list) where i only enter integer values.
Now i want a cursor on that field.

Unfortunately i am not allowed to select a custom field for the cursor filter type. But what exactly the reason for that?
I read in another forum thread that you are using BETWEEN SQL query command.
The BETWEEN command is applicable for columns of the type integer, string and datetime. So it would be possible to use it.
Alternatively it would also be possible to use CONVERT and CAST commands to force the values to be number types before using the BETWEEN command. The cursor filter anyway only makes sense for numeric fields, so in case someone uses the cursor filter on a non-numeric field it is his own fault.

I think this would be a feature a lot of people are missing?!

Last edit: 11 years 9 months ago by [raven-worx](/forum/user/36141-raven-worx "View raven-worx's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ1LWZpbHRlcnMtc2VhcmNoLzg3NDk2OS1jdXJzb3ItZmlsdGVyLWZvci1jdXN0b20tZmllbGRzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86576
- Thank you received: 14320
-
-

11 years 9 months ago [\#190685](#190685) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Cursor filter for custom fields](/forum/45-filters-search/874969-cursor-filter-for-custom-fields#190685 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.3.28  Hi,  i have a custom field (type text - also tried single selection list) where i only enter integer values. Now i want a cursor on that field.  Unfortunately i am not allowed to select a custom field for the cursor filter type. But what exactly the reason for that? I read in another forum thread that you are using BETWEEN SQL query command. The BETWEEN command is applicable for columns of the type integer, string and datetime. So it would be possible to use it. Alternatively it would also be possible to use CONVERT and CAST commands to force the values to be number types before using the BETWEEN command. The cursor filter anyway only makes sense for numeric fields, so in case someone uses the cursor filter on a non-numeric field it is his own fault.  I think this would be a feature a lot of people are missing?!")*

Hi,

Why not.
Add the code: Code:

$fieldsClass = hikashop_get('class.field'); $fields = $fieldsClass-&gt;getData('all','product'); if(!empty($fields)){ foreach($fields as $field){ $this-&gt;values[] = JHTML::_('select.option', 'b.'.$field-&gt;field_namekey,$field-&gt;field_realname); } }

after the line: Code:

$this-&gt;values[] = JHTML::_('select.option', 'b.product_average_score',JText::_('RATING'));

in the file administrator/components/com_hikashop/types/product_information.php and that will work.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ1LWZpbHRlcnMtc2VhcmNoLzg3NDk2OS1jdXJzb3ItZmlsdGVyLWZvci1jdXN0b20tZmllbGRzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[raven-worx](/forum/user/36141-raven-worx "View raven-worx's Profile")**
- [![raven-worx's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/36141-raven-worx "View raven-worx's Profile") Topic Author
- [ Offline](/forum/user/36141-raven-worx)

Less More

- Posts: 23
- Thank you received: 0
-
-

11 years 9 months ago [\#190714](#190714) by [raven-worx](/forum/user/36141-raven-worx "View raven-worx's Profile")  Replied by *[raven-worx](/forum/user/36141-raven-worx "View raven-worx's Profile")* on topic *[Cursor filter for custom fields](/forum/45-filters-search/874969-cursor-filter-for-custom-fields#190714 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.3.28  Hi,  i have a custom field (type text - also tried single selection list) where i only enter integer values. Now i want a cursor on that field.  Unfortunately i am not allowed to select a custom field for the cursor filter type. But what exactly the reason for that? I read in another forum thread that you are using BETWEEN SQL query command. The BETWEEN command is applicable for columns of the type integer, string and datetime. So it would be possible to use it. Alternatively it would also be possible to use CONVERT and CAST commands to force the values to be number types before using the BETWEEN command. The cursor filter anyway only makes sense for numeric fields, so in case someone uses the cursor filter on a non-numeric field it is his own fault.  I think this would be a feature a lot of people are missing?!")*

But why is such an essential feature not already implemented?! Is there a special reason?
I would be great if i could avoid reappling the change everytime i upgrade the component.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ1LWZpbHRlcnMtc2VhcmNoLzg3NDk2OS1jdXJzb3ItZmlsdGVyLWZvci1jdXN0b20tZmllbGRzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86576
- Thank you received: 14320
-
-

11 years 9 months ago [\#190722](#190722) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Cursor filter for custom fields](/forum/45-filters-search/874969-cursor-filter-for-custom-fields#190722 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.3.28  Hi,  i have a custom field (type text - also tried single selection list) where i only enter integer values. Now i want a cursor on that field.  Unfortunately i am not allowed to select a custom field for the cursor filter type. But what exactly the reason for that? I read in another forum thread that you are using BETWEEN SQL query command. The BETWEEN command is applicable for columns of the type integer, string and datetime. So it would be possible to use it. Alternatively it would also be possible to use CONVERT and CAST commands to force the values to be number types before using the BETWEEN command. The cursor filter anyway only makes sense for numeric fields, so in case someone uses the cursor filter on a non-numeric field it is his own fault.  I think this would be a feature a lot of people are missing?!")*

No one asked. It's as simple as that.
That code will of course be in the next version of HikaShop. I just gave you the code in case you wanted to do it before we publish next release of HikaShop in a month or so.

The following user(s) said Thank You: [raven-worx](/forum/user/36141-raven-worx "View raven-worx's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ1LWZpbHRlcnMtc2VhcmNoLzg3NDk2OS1jdXJzb3ItZmlsdGVyLWZvci1jdXN0b20tZmllbGRzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[raven-worx](/forum/user/36141-raven-worx "View raven-worx's Profile")**
- [![raven-worx's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/36141-raven-worx "View raven-worx's Profile") Topic Author
- [ Offline](/forum/user/36141-raven-worx)

Less More

- Posts: 23
- Thank you received: 0
-
-

11 years 9 months ago [\#190783](#190783) by [raven-worx](/forum/user/36141-raven-worx "View raven-worx's Profile")  Replied by *[raven-worx](/forum/user/36141-raven-worx "View raven-worx's Profile")* on topic *[Cursor filter for custom fields](/forum/45-filters-search/874969-cursor-filter-for-custom-fields#190783 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.3.28  Hi,  i have a custom field (type text - also tried single selection list) where i only enter integer values. Now i want a cursor on that field.  Unfortunately i am not allowed to select a custom field for the cursor filter type. But what exactly the reason for that? I read in another forum thread that you are using BETWEEN SQL query command. The BETWEEN command is applicable for columns of the type integer, string and datetime. So it would be possible to use it. Alternatively it would also be possible to use CONVERT and CAST commands to force the values to be number types before using the BETWEEN command. The cursor filter anyway only makes sense for numeric fields, so in case someone uses the cursor filter on a non-numeric field it is his own fault.  I think this would be a feature a lot of people are missing?!")*

I see, great! Thank you!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ1LWZpbHRlcnMtc2VhcmNoLzg3NDk2OS1jdXJzb3ItZmlsdGVyLWZvci1jdXN0b20tZmllbGRzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.068 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
