Skip Navigation

[Resolved] Showing content in the frontend depending on selection in the backend

This support ticket is created 5 years, 5 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 4 replies, has 2 voices.

Last updated by kaiD 5 years, 5 months ago.

Assisted by: Minesh.

Author
Posts
#1278377

Tell us what you are trying to do?
If i add a new product in woocommerce i want to have a checkbox or something like that. If it is checked on my wish is that a predefined text or photo is visible in the frontend.

For example: There is a checkbox in the backend asking if that product is limited. If it is in the front end there should be a field which show the predefined text "This product is limited to 200 copies only!". This text should come out of the database.

Is this possible?

Is there any documentation that you are following?

Is there a similar example that we can see?

What is the link to your site?

#1278431

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

What if you create a custom field group and add one checkbox field and one multilne field or text field and assign this custom field group to display with your product post type.
=> https://toolset.com/documentation/user-guides/using-custom-fields/

Then with multiline or single line field you added, add the condition that if checkbox field is checked then you should display this single line or multiline field, you should add post conditional display:
=> hidden link
=> https://toolset.com/documentation/user-guides/types-custom-fields-conditional-display/

Then, on the frontend, display the field values accordingly using Types shortcode.
=> https://toolset.com/documentation/customizing-sites-using-php/functions/

#1278449

Hi Minesh,

thanks for your quick response.
If i understand you right the content of the single line field need to be add when adding a new product, right?
But what i like to have is a predefined text which always will be used if the checkbox is active.

Is there a way for that?

#1278457

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Then what if you only add checkbox field and on frontend - check the conditionally if the checkbox is checked or not using the [wpv-conditinoal] shortcode and display the text. That way you do not need a single line field.

More info:
=> https://toolset.com/documentation/user-guides/conditional-html-output-in-views/

Why I suggest this solution because otherwise, you need to save that single line field with the same text with each product.

#1278605

It seems that this is what i´m looking for. Thank you!