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.
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/
I changed status of new CRED Form to Draft instead of Publish. My issue is resolved now. Thank you!