Skip Navigation

[Resolved] How to get the term value topopulate a cred tax single select threw urlparameter

This support ticket is created 7 years, 3 months ago. 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)

This topic contains 21 replies, has 3 voices.

Last updated by Shane 7 years, 3 months ago.

Assisted by: Shane.

Author
Posts
#558511

I see the code on the JS part of the form, but there is no effect.
Please note I also have changed the field from checkbox to select like this :

[cred_field field='pays' display='select' single_select='true' urlparam='pays_v' output='bootstrap']

But the code doesn't work either if it is a checkbox.
Thank you.

#558644

Shane
Supporter

Languages: English (English )

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

Hi Roman,

The code actually works when it is a checkbox, i've changed the field type back to checkbox and if you take a look the field will auto select based on the url value.

hidden link

Please try again with that url.

Thanks,
Shane

#558671

In your example it's USA that is checked, but it should be Allemagne, since the offer's term is Allemagne, not USA !
You can verify this by checking the "offre" id in url parameter "id_offre", then check the taxonomy for this post id in backend.

#558676

Shane
Supporter

Languages: English (English )

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

Screen Shot 2017-08-10 at 10.49.17 AM.png

Hi Roman,

What was selected is actually correct and is done based what is the value of that checkbox field. See Screenshot.

USA has a value of 7 and Allemagne has a value of 11 and the parameter value that was passed is 7 not 11. If 11 was passed then Allemagne would be selected.

Thanks,
Shane

#558678

Shane
Supporter

Languages: English (English )

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

If you were to change the value of the parameter to 11 for a test you will see that Allemagne will be selected.

#558682

Oh, in deed, thank you.

It seems it is because the shortcode that generates that number is wrong

[wpv-post-taxonomy type="pays" format="count"]

This count the number of terms instead of giving the term ID. How could I get the term ID with a shortcode ?

Thank you.

#558737

Shane
Supporter

Languages: English (English )

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

Hi Roman,

You will need to create some custom shortcode to get the term id.

Could you send me a link to the page where this shortcode is used to generate the link ?

Thanks,
Shane