Navigation überspringen

[Geschlossen] Custom Field (Types Field) in Cred Form

This support ticket is created vor 3 Jahren, 3 Monaten. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Dieses Thema enthält 12 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von Shane vor 3 Jahren, 3 Monaten.

Assistiert von: Shane.

Author
Artikel
#2162951
Einzelzimmer_Zuschlag_4.jpg
Einzelzimmer_Zuschlag_3.jpg
Einzelzimmer_Zuschlag_2.jpg
Einzelzimmer_Zuschlag_1.jpg

Hi,
in the Backend I there are several Custom Fields in a CPT. I created a Custom Field called "Einzelzimmer-Zuschlag Preis" (see picture "Einzelzimmer_Zuschlag_1.jpg"). When I create a "Veranstaltung" and use this field in the Backend (see "Einzelzimmer_Zuschlag_2.jpg") and than want to display this field in my Toolset Form (Cred), the Label with the Types Field "Einzelzimmer-Zuschlag Preis" doesn't appear (see "Einzelzimmer_Zuschlag_3.jpg").
Here is the code:
[code]
[wpv-conditional if="($(wpcf-einzelzimmer-zuschlag) eq '1' )"]
<div class="form-group">
<label>Einzelzimmer-Zuschlag Euro pro Nacht ([types field='einzelzimmer-zuschlag-preis' output='raw'][/types] Euro pro Nacht)</label>
[cred_field field='einzelzimmer-zuschlag-formular' force_type='field' class='form-control' output='bootstrap']
</div>
[/wpv-conditional]
[/code]
If I delete the part:
[code]
[types field='einzelzimmer-zuschlag-preis' output='raw'][/types]
[/code]
the Label shows (see "Einzelzimmer_Zuschlag_4.jpg").
Why does it not work, when I use the Types Field? Strange thing is, that I use another Types Field in the (Cred) Toolset Form on another Place, which works well.
Thanks
Thorsten

#2163085

Shane
Supporter

Sprachen: Englisch (English )

Zeitzone: America/Jamaica (GMT-05:00)

Hi Thorsten,

Thank you for getting in touch.

Are you saying if you use the types shortcode within the label tag it doesn't work? However if you use a different custom field displayed with the types shortcode it works ? Is the shortcode also inside a label tag?

Please let me know so that I can attempt to replicate the issue.

Thanks,
Shane

#2163415

Hi Shane,
yes, the Lable doesn't display. However, it doesn't matter, if I use thhis code inside or outside the label. In both cases, the label isn't visible. I also tried to set it in a p-Tag, but this doesn't work either. However for the other code, it work's (which is in a P-Tag). This is the code, that works:
<p>Buchungs-Nr.: [types field='veranstaltungsnummer_neu' output='raw'][/types]</p>

and that is the code, which doesn't work:
[wpv-conditional if="($(wpcf-einzelzimmer-zuschlag) eq '1' )"]
<div class="form-group">
<label>Einzelzimmer-Zuschlag Euro pro Nacht ([types field='einzelzimmer-zuschlag-preis' output='raw'][/types] Euro pro Nacht)</label>
[cred_field field='einzelzimmer-zuschlag-formular' force_type='field' class='form-control' output='bootstrap']
</div>

So my questions are:
- Why is the second code not working?
- How can I display a Custom Field within a cred form?

PS: If you need access to the Website, I can give you access.
Thanks
Thorsten

#2163585

Shane
Supporter

Sprachen: Englisch (English )

Zeitzone: America/Jamaica (GMT-05:00)

Hi THorsten,

Thank you for the clarity.

Please provide me with admin access to the site as I was not able to replicate the issue on my end.

Thanks,
Shane

#2163769

Shane
Supporter

Sprachen: Englisch (English )

Zeitzone: America/Jamaica (GMT-05:00)

Hi Thorsten,

Not sure why it is behaving as such but when i moved the entire field to a different position on the form it works fine.

You can have a look at the page and let me know if this helps.

Thanks,
Shane

#2164451

Hi SHane,
thanks for this sollution, but the problem is, that the client doesn't want to display the field at this place. Indeed, this is a very strange behaviour. Is there a way to display it with PHP code like in this example?
https://toolset.com/forums/topic/displaying-custom-fields-on-the-sites-front-end-woocommerce-product-page/
I tried it with <?php echo 'This is a Test' ?> to test it in general, but it doesn't work.
Thanks
Thorsten

#2164641

Shane
Supporter

Sprachen: Englisch (English )

Zeitzone: America/Jamaica (GMT-05:00)

Hi Thorsten,

This seems to be an issue with the form itself and unfortunately no the field will need to be displayed in the code of the form to work correctly.

I believe the issue might be with the form itself and I would recommend remaking it.

Currently I see where it works if you have a copy of the field on the page itself so this is a temporary workaround to the issue. I would recommend remaking the form as a test to see if the issue is present in the new form as well.

Thanks,
Shane

#2165827
Einzelzimmer_Zuschlag_Bug_2.jpg
Einzelzimmer_Zuschlag_Bug_1.jpg

Hi Shane,
I created a new form. Unfortunaltely, it's the same issue. I attached two screenshots. In the first screenshot you will see, that if you insert hte types field for "Einzelzimmer Zuschlag", many fields disappear. If you delete the Types field, everything works as expected. I even deleted the old custom fields and created new ones, but the same issue. I guess, it has to be a Bug with Toolset itself. I now entered the number manually (static). Than, of course, it works, but this is only a workaround and not the solution for the bug. Is there a way to solve this issue?
Also you can see on the screenshot (sorry, it's very smal), that there is a little star (*) at the end of the senetence "Datenschutz und Stornogebühren gelesen und akzeptiert*". Where does this star come from?

#2168011

Shane
Supporter

Sprachen: Englisch (English )

Zeitzone: America/Jamaica (GMT-05:00)

Hi Thorsten,

At this point I will need to grab a copy of the site for further testing in a more controlled environment without affecting your live site.

Would it be ok if I go ahead and grab a copy of the site ?

I see that you have the duplicator pro plugin installed so I can use this to create the backup for the copy.

Secondly the asterisk is there because the field was set to be required.

Thanks,
Shane

#2170849

Hi Shane,
that's fine for me. You can create a Copy from the Site to test the issue on your side.
Ok, but as far as aI and my client know, the asterisk was not there befor the Toolset Update. The other fields are also required, but they don't show the asterisk, so that's a bit strange for us.
Thanks
Thorsten

#2174299

Shane
Supporter

Sprachen: Englisch (English )

Zeitzone: America/Jamaica (GMT-05:00)

Hi Thorsten,

Just an update here. The asterisk is definitely being added by making the field required.

I did a test on my end to confirm that this is the default behaviour when a generic field is set to required.

Thanks,
Shane

#2177475

Ok, thanks for the info.
Did you take a copy of the site for testing purposes regarding the other issue with the form?

Thanks,
Thorsten

#2178865

Shane
Supporter

Sprachen: Englisch (English )

Zeitzone: America/Jamaica (GMT-05:00)

Hi Thorsten,

I did attempt to create the copy here locally, unfortunately I wasn't able to successfully restore the backup.

Are you able to setup a staging site for me where I can safely troubleshoot and debug without affecting your live site.

Please let me know.

Thanks,
Shane

Das Thema „[Geschlossen] Custom Field (Types Field) in Cred Form“ ist für neue Antworten geschlossen.