Skip Navigation

[Resolved] Chargable cred form – edit / new

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

Problem:

Charge users for submitting content using Toolset Forms plugin.

Solution:

You can follow our document to setup Toolset Forms and woocommerce.

Relevant Documentation:

https://toolset.com/course-lesson/charge-users-for-submitting-content/

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

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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)

Tagged: 

This topic contains 2 replies, has 2 voices.

Last updated by JakubV7709 3 years, 8 months ago.

Assisted by: Luo Yang.

Author
Posts
#1734169
chargable form toolset.jpg
cred form chargable.jpg

Hi,

could you please help me with issues about CRED from in chargable way?

I have a several cred form for new post (for free and chargable). I set a custom field for value which contain value (1 - paid, 2 - free) and set expiration for this forms via functions.php (it works).

Im struggling with 2 issues:
1) When my customer fill the form and click on submit button he is forward to checkout page (its ok). But in this time the post is published instead of waiting for payment.... im using autocompleted orders in woocommerce.
2) I setup edit chargable form which change value in custom field (from default value "2" to "1") and set expiration date for this post. There is a same issue that when customer is on checkout page the post is "live" (published) without payment.

Functions.php

/** Form expiration date by product id řešení*/
add_action('cred_save_data', 'my_save_data_action',999,2);
function my_save_data_action($post_id, $form_data){
    // if a specific form
    if ($form_data['id']==26){
 
        //get the value from the field as it appears in the post with the ID from above and assign it to a variable
        $product_id = get_post_meta($post_id, 'reklama', true);
         
        if($product_id == 51){
                $timestamp = current_time('timestamp') + 92 * DAY_IN_SECONDS;
     
            }else if($product_id == 52){
                $timestamp = current_time('timestamp') + 183 * DAY_IN_SECONDS;
          
            }
        update_post_meta($post_id, '_cred_post_expiration_time',  $timestamp);
    }

I will share with you my credentials for login as admin.

Thank you in advance.

#1735371

Hello,

The problem you mentioned above is abnormal, I have tried the same settings in my localhost with a fresh WP installation + the latest version of Toolset plugins, it works fine.

Please check these in your website:
1) Make sure you are using the latest version of Toolset plugins, you can download them here:
https://toolset.com/account/downloads/

2) In case it is a compatibility problem, please deactivate all other plugins, and switch to wordpress default theme 2020, deactivate all custom PHP codes, and test again

3) Also check if there is any PHP/JS error in your website:
https://toolset.com/documentation/programmer-reference/debugging-sites-built-with-toolset/

4) If the problem still persists, please provide database dump file(ZIP file) of your website, you can put the package files in your own google drive disk, share the link only, also point out the problem page URLs and form URLs, I need to test and debug it in my localhost, thanks
https://toolset.com/faq/provide-supporters-copy-site/

#1741595

I changed status of new CRED Form to Draft instead of Publish. My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.