- Posts: 100
- Thank you received: 1
Custom Field Value and Filtering Issue
- paddyrolls
-
Topic Author
- Offline
-- Joomla version -- : 3.3
-- PHP version -- : 5x
HI
I have created a custom field of table "product" as below:
I use this custom field to create a filter:
I have discoverd that the space in the Value - "Anglican Church" causes the filter option to become unchecked. (The behaviour should be checked after search results).
When I change this to Value - "AnglicanChurch", then filtering works properly.
My problem is if I use this custom field $this->row->venue on a product list table, it returns the value (AnglicanChurch or 2) and not the Title "Anglican Church".
How do you retrieve the Title of the custom field rather than the Value?
Would you have any suggestion around this issue.
Thanks
Patrick
Please Log in or Create an account to join the conversation.
Yes, you should avoid the space in the value of the custom field.
To load the title instead of the value, you can do like that:
Please Log in or Create an account to join the conversation.
- paddyrolls
-
Topic Author
- Offline
- Posts: 100
- Thank you received: 1
Thank you for the information. Could I also:
1. How would I get the title of custom fields that are not shown in the frontend and only in backend of product view.
2. I am using $fields->field_categories and it returns ",19," representing the category for the custom field. Could you advise how to could return the category name
Thanks
Patrick
Please Log in or Create an account to join the conversation.
1. you could directly write the title. Otherwise such code can do it:
2. There is no function for that. You'll have to do it yourself:
Please Log in or Create an account to join the conversation.
if i do this to get the value of a dropdown i get the following error
Notice: Trying to get property of non-object in administrator/components/com_hikashop/classes/field.php on line 1288 Notice: Trying to get property of non-object in administrator/components/com_hikashop/classes/field.php on line 1289 Fatal error: Call to undefined method hikashop::show() in administrator/components/com_hikashop/classes/field.php on line 1298
any help would be aprriciated
Please Log in or Create an account to join the conversation.
Several pieces of code were posted here. What exact code modification did you do and where exactly ?
Please Log in or Create an account to join the conversation.
nicolas wrote: Hi,
Yes, you should avoid the space in the value of the custom field.
To load the title instead of the value, you can do like that:Code:$fieldsClass = hikashop_get('class.field); $fields = $fieldsClass->getFields('frontcomp',$this->row,'product','checkout&task=state'); echo $fieldsClass->show($fields['venue'],$this->row->venue);
this one
Please Log in or Create an account to join the conversation.
Where did you add that code ?
Do you have a custom product field called "venue" ? Could you do a screenshot of the options of your custom field ?
Please Log in or Create an account to join the conversation.
but gives me the error.
It is added in product/listing_img_title.php
Please Log in or Create an account to join the conversation.
It would have been great to have a screenshot of all the options of the custom field, including the remaining options on the right of the screen.
Here is the potential issue:
- you should turn on the "front-end" option in your custom field, or change frontcomp to backend in your custom code.
- make sure that the "include sub categories" option of the categories listing of your custom field is activated.
- make sure that you didn't restrict your custom field to only some user groups via the "access levels" option.
Please Log in or Create an account to join the conversation.
rest was as you already stated... now it just shows on products where i didn't want it, but can hide it there with a display none, so no worries
Thanx
Please Log in or Create an account to join the conversation.