Custom fields

  • Posts: 259
  • Thank you received: 10
10 years 3 months ago #162645

Finally coming around to adding content to my site again and need custom fields. I created a topic about this a long time ago (over 3 years) and its very likely not the proper way to do it anymore so i figured i'll start over.

I need a custom text field (lets call it for the sake of help 'fieldname1'). So i went to custom fields and created a custom textfield called "fieldname1" with the following properties

Label: fieldname1
Table: product
Field type: text
Mandatory: yes
Category: NL (dual lingual site so i have 2 root categories NL and EN, this particular field is for NL only)
activated: yes
display:
front-end: yes
back-end form: yes

The field should display on articles, but only when i choose to select to display it. The problem is, the option to display the field yes/no is not showing up on the backend when creating an article. So i'm obviously missing something

Please Log in or Create an account to join the conversation.

  • Posts: 82723
  • Thank you received: 13338
  • MODERATOR
10 years 3 months ago #162676

Hi,

I'm not following you.
If you don't enter anything in the field, it won't display on the product page, if you enter something in it, it will display.
So there is no "option to display the field yes/no" on the backend when creating an article.

If you still see it on the frontend even though you didn't enter anything in it, that means that one or several of the view files of the product page have been edited via the menu Display>views with either old code, or broken code.

Please Log in or Create an account to join the conversation.

  • Posts: 259
  • Thank you received: 10
10 years 3 months ago #162776

I'm talking about this

www.hikashop.com/forum/2-general-talk-ab...tom-field.html#18511

nicolas wrote: You need TWO custom fields.
one of the table product and of the type radio with two values, yes and no. So that you can select if the product needs the custom item field or not.
one of the table item and of the type text. So that you can display the input box on the product page.


What i mean is that although the custom field is created, it will not display on the article view. Some articles will need that custom fields, other's won't. Which is why in the "old days" as linked in that topic i was told (by you also) to create a radio button. Selecting yes on that radio button would make the field shows up on that specific article on the front end. The problem is i can't seem to do it correctly (that radio button)

It's not that i still see it on the front, end, the field isn't showing up AT ALL. That's what i'm saying. And no files have been edited. It's a fresh joomla 3 install. I'd be happy to send you login details or send the template your way

back then it required editing of the view files, i hope there is an easier way by now that doesn't involve editing template files, because each time i upload a new version of my self-designed template (however minor the change is) i'll have to redo that modification

It could be because of whoever did that nl-translation in my absence. It's lousy, i keep finding more errors. On the custom field selection list i have 2 artikels items

Adres,user,article,category,HIKA_CONTACT,order,article(again),input

perhaps more clearly: the custom field "fieldname1" should only appear on the products where i select via the backend if the custom field should be displayed or not

Last edit: 10 years 3 months ago by Ch3vr0n.

Please Log in or Create an account to join the conversation.

  • Posts: 82723
  • Thank you received: 13338
  • MODERATOR
10 years 3 months ago #162837

Hi,

I don't see how the value entered in a product field on the backend wouldn't display on the product page of the frontend. That's not possible.
And I don't see how the product field itself wouldn't display on the product edition page on the backend. That has to work.
But anyway, you don't need such field anymore.

Regarding displaying a custom field for some products and not others though, there is no need anymore to do like you did 3 years ago. Now, you need to only create a custom item field, create a disabled category for that field, and then add that category in the categories listing of the custom item field.
Then, when you add the disabled category as a second category to the products, the field will display, if you don't add it, the field won't display on the product page.

Please Log in or Create an account to join the conversation.

  • Posts: 259
  • Thank you received: 10
10 years 3 months ago #162905

i didn't say anything about a value not being shown, i said the field wasn't being displayed.

regarding the "disabled category" (you mean an unpublished one?) & categories listing i don't fully understand. Could you give me a step-by-step procedure (where and what) of what i need to do to get it working.

All i need is that input text field to show up on products of my choice. If it's in the documentation to do what then please by all means point me in the right direction. I can also give an su login so you can set it up and I can then look how is done to do it myself in the future.

ps: nocturnal bird too are ya ;)? always up late like me :p

Last edit: 10 years 3 months ago by Ch3vr0n.

Please Log in or Create an account to join the conversation.

  • Posts: 82723
  • Thank you received: 13338
  • MODERATOR
10 years 3 months ago #163203

Hi,

1. It's normal that the field of a product custom field doesn't display on the product page on the frontend. There is no such capability. Only the custom item fields display on the product page.

2. It's easy. Create an unpublished category. Add it in the "categories" listing of your custom item field. Add it to the products for which you want the field to display. That's it.

Please Log in or Create an account to join the conversation.

  • Posts: 259
  • Thank you received: 10
10 years 3 months ago #163204

would be nice if that functionality could get added though, not just limited to the "item" field. would save alot of trouble i imagine. No extra unpublished categories.

i can imagine it working very easily. Create custom text field and link it to article, then when clicking "add article" someowhere on that page would be for example a dropdown list with all the custom fields linked to the "article" display. All one would have to do was then select the field they wanted to display and click "display field" or something and it would get added to that article and displayed on the front end. i can knock up an image if you want to explain more clearly


2) it's not a custom item field, its a custom TEXT field that needs to show on an article. where the user can enter text which then gets transmitted along the order. Don't know how i can explain myself better. I did mail SU login details per another topic. Feel free to set it up so i can take a look at it afterwards.

Attachment not found

Last edit: 10 years 3 months ago by Ch3vr0n.

Please Log in or Create an account to join the conversation.

  • Posts: 82723
  • Thank you received: 13338
  • MODERATOR
10 years 3 months ago #163207

1. What you're suggesting is almost the same as what is already done with the categories restriction of custom fields. When you are on a product edition page, you just add the category of the fields that you want to be displayed on the product page and they will appear there.

2. Again, you need to create a custom field of the table "item", not of the table "product". Custom fields of the table product will display only on the backend of the product page. Custom fields of the table "item" will display on the product page.
The type of the custom field is not the problem, you can put whatever you want in it.

3. We don't keep track of the backend accesses of everyone. But again, it's really easy to setup the way I explained

Please Log in or Create an account to join the conversation.

  • Posts: 259
  • Thank you received: 10
10 years 3 months ago #163267

kk i'l try it. But backend access was given along a link for that messed up template layout thing :)

Please Log in or Create an account to join the conversation.

  • Posts: 259
  • Thank you received: 10
10 years 3 months ago #163282

Ok, field is displaying, but the field data (whether its the default value or own entered value) is not being transmitted .

Not transmitted during checkout process
Not transmitted alongside the order email
Not showing up on the backend order overview nor on the "add article" page.

So we're halfway there, the field is being displayed but that's it. The data isn't being sent.

current field properties

Table: item
Columname: fieldname
Label: fieldname
field type: text
Required: yes
front-end: yes
back-end form: yes
back-end list: no
published: yes
core: no

Could it be related to the following? As soon is i added that custom field to the category the button on the product changed from "add to cart" to "choose options" and that there are no options? Just a custom field

Last edit: 10 years 3 months ago by Ch3vr0n.

Please Log in or Create an account to join the conversation.

  • Posts: 259
  • Thank you received: 10
10 years 3 months ago #163595

bumpetiebump. Kind of a big issue if the entered text in the field does not get transmitted

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
10 years 3 months ago #163624

Hi,

Do you edited any views ?
The fields must be transmitted, it i working on our end ;)

If you try:

<?php 
foreach($data->cart->products as $item) {
  $product = $productClass->products[$item->product_id];
  echo $product->CUSTOMFIELD_NAME;
}
?>
In the email, is that displaying the desired value ?

Please Log in or Create an account to join the conversation.

  • Posts: 259
  • Thank you received: 10
10 years 3 months ago #163712

nope, didn't edit anything. As i said it was a fresh install of everything. Should the "back-end list" option be enabled? Swapping to default template "protostar" didnt solve it either

which mail do i edit? Order creation notification? html part? text part? Preview part?

i edited html part in that mail template but still didn't work. field data is not being transmitted. Not to the checkout page, not in the final order created email, not on the backend. So i removed the modifications again

Feel free to login on the backend. Nicolas has the superuser details

**EDIT**: Nevermind i don't know what was wrong but i scrapped the custom field and recreated it and changed the label. The field label was in 2 words "field name". Picked a different name with 1 word and this time it worked. Don't know if that's the reason but field data is being transmitted now.

Last edit: 10 years 3 months ago by Ch3vr0n.

Please Log in or Create an account to join the conversation.

Time to create page: 0.079 seconds
Powered by Kunena Forum