Skip Navigation

[Resolved] Adding options to Front End Product Submission

This thread is resolved. Here is a description of the problem and solution.

Problem:

I have created a Post Form to allow Users to add Products from the Front End. I would like to give the Users the option to 1) Save, 2) Preview and 3) Submit the Post depending on whether they have finished the Post and are ready to submit or not.

Solution:

There isn't such kind of built-in feature within Toolset forms plugin, but it needs PHP codes, for example:

https://toolset.com/forums/topic/adding-options-to-front-end-product-submission/#post-1686113

Relevant Documentation:

https://toolset.com/documentation/programmer-reference/cred-api/#cred_success_redirect

This support ticket is created 4 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Hong_Kong (GMT+08:00)

This topic contains 10 replies, has 2 voices.

Last updated by GinaM9227 4 years, 5 months ago.

Assisted by: Luo Yang.

Author
Posts
#1685691

Tell us what you are trying to do?
I have created a Post Form to allow Users to add Products from the Front End. I would like to give the Users the option to 1) Save, 2) Preview and 3) Submit the Post depending on whether they have finished the Post and are ready to submit or not.

The documentation that I have reviewed says that only One Option is possible on the Product Form..is that right? For a better user experience, How do I give my Users more options without having to create additional steps?

Is there any documentation that you are following?
https://toolset.com/forums/topic/uploading-product-using-forms/?bbp_reply_to=1606685&_wpnonce=990c823beb#new-post
https://toolset.com/forums/topic/cred-custom-statuses-radio-button-text-pulldown-menu-default-option-etc/

Is there a similar example that we can see?
The options to Save, Preview and Submit are standard options when creating new posts.

What is the link to your site? hidden link

#1686113

Hello,

There isn't such kind of built-in feature within Toolset forms plugin, but it needs PHP codes, for example:
1) You can add a general radio field "status" into your post form for creating new post:
https://toolset.com/documentation/programmer-reference/forms/cred-shortcodes/#cred_generic_field
with three options:
- Save
- Preview
- Submit

2) When user fill above form and choose one of above option, use action hook "cred_success_redirect" to trigger a PHP function
https://toolset.com/documentation/programmer-reference/cred-api/#cred_success_redirect

in this PHP function, redirect user to different URLs based on option "status" value
- If user choose option "Save", redirect him to an the new post URL + content template ID URL parameter "content-template-id", in this content template, display a post form for editing current post
see similar thread:
https://toolset.com/forums/topic/post-forms-saved-in-progress-paged-forms/
- option "Preview" redirect him to the post URL
- option "Submit", redirect him to another page, in this page, display a success message.

#1687335

Thank you for your help

I have one question

In 2) article, when user fill above form and choose one of 3 radio options, Do the action hook "cred_success_redirect" happen without clicking submit button?

And when the action hook happen, how can I get the value of the radio options?
This is very Urgent Problem
Please help me ASAP.

Thank you

#1688315

Q) when user fill above form and choose one of 3 radio options, Do the action hook "cred_success_redirect" happen without clicking submit button?
As I mentioned above, you need to submit the form, then trigger the action hook "cred_success_redirect", you can get the value from PHP global variable, for example $_POST['status'].

If you need more assistance for it, please provide a test site with the same problem, also point out the problem page URL and form URL, where I can edit your PHP codes, I can setup a demo for you.

#1688349
message.png

Good
I resolved that problem
Thank you
And I have some another problems.
1. When clicking the [Preview] button, is it possible to open a new screen for the preview screen in a web browser?
Can I keep the current editing screen?

2. When I click the [Submit] button, the page redirect to another page,
At that time how can I get success message from the [Custom Post From]?

#1688383

1) There isn't such kind of built-in feature, it needs custom codes, for example, you can setup custom JS codes to open preview screen in a web browser:
https://stackoverflow.com/questions/19851782/how-to-open-a-url-in-a-new-tab-using-javascript-or-jquery

2) The success message is in the "success" page, you can display text "success !" in success page.

#1688419

Thank you
1. I can open the new page in web browser with Javascript but after redirect to the [Preview] page, the all edit field are formatted.

I want to keep the edit page data.
How can I do it?

2) The success message is in the "success" page, you can display text "success !" in success page.
When I click the submit button, the page redirect to the another page
ie: My account page
At that time, How can I find "Success" page and where is the "Success" page?

Please tell me more correctly..

#1688429

1) I want to keep the edit page data.
It is similar as option "Save": when user choose option [Preview], display the content template for editing post + custom JS codes to open the window.

2) At that time, How can I find "Success" page and where is the "Success" page?
You can create a wordpress page with title "Success", in the page content put below text:
Success !
Save it and view it in front-end, you will get the "Success" page URL, then you can use it in your custom PHP function.

#1704687
add_row.png

Hi Luo Yang
Good morning

I have another problem.
I wanna add the new function that add the columns to the post form in the front-end with Toolset.
How can I make this function?
Please help me.

#1704817

I assume the original questions of this thread is resolved, according to our support policy, we prefer one ticket one question.

For the new question, please check the new thread here:
https://toolset.com/forums/topic/i-wanna-add-the-new-function-that-add-the-columns-to-the-post-form-in-the-front-end-with-toolset/

#1715089

My issue is resolved now. Thank you!