- Posts: 23
- Thank you received: 0
Cursor filter for custom fields
- raven-worx
-
Topic Author
- Offline
Less
More
11 years 7 months ago - 11 years 7 months ago #190639
by raven-worx
Cursor filter for custom fields was created by raven-worx
-- 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?!
-- 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 7 months ago by raven-worx.
Please Log in or Create an account to join the conversation.
11 years 7 months ago #190685
by nicolas
Replied by nicolas on topic Cursor filter for custom fields
Hi,
Why not.
Add the code:
after the line:
in the file administrator/components/com_hikashop/types/product_information.php and that will work.
Why not.
Add the code:
Code:
$fieldsClass = hikashop_get('class.field');
$fields = $fieldsClass->getData('all','product');
if(!empty($fields)){
foreach($fields as $field){
$this->values[] = JHTML::_('select.option', 'b.'.$field->field_namekey,$field->field_realname);
}
}
Code:
$this->values[] = JHTML::_('select.option', 'b.product_average_score',JText::_('RATING'));
Please Log in or Create an account to join the conversation.
- raven-worx
-
Topic Author
- Offline
Less
More
- Posts: 23
- Thank you received: 0
11 years 7 months ago #190714
by raven-worx
Replied by raven-worx on topic Cursor filter for custom fields
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.
I would be great if i could avoid reappling the change everytime i upgrade the component.
Please Log in or Create an account to join the conversation.
11 years 7 months ago #190722
by nicolas
Replied by nicolas on topic Cursor filter for custom fields
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.
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
Please Log in or Create an account to join the conversation.
- raven-worx
-
Topic Author
- Offline
Less
More
- Posts: 23
- Thank you received: 0
11 years 7 months ago #190783
by raven-worx
Replied by raven-worx on topic Cursor filter for custom fields
I see, great! Thank you!
Please Log in or Create an account to join the conversation.
Time to create page: 0.217 seconds