I need to create a payment form with redirect to Chronopay payment gate on wordpress. I try to make it with CF7 plugin with database extension.
How can I do next things: 1. Add unique ID and payment status to CF7 database strings. (I have added 2 fields to database and tried to change them with hook on wpcf7_before_send_mail).
function order_set_id($f) {
global $wpdb;
global $table_prefix;
$submit_time = $f->submit_time;
$title = $f->title;
if ('Taxy pick up' == $title ) {
$sql = "SELECT MAX(order_id) as mid FROM `wp_cf7dbplugin_submits`";
$var = $wpdb->get_results($wpdb->prepare($sql));
$neworder_id = $var[0]->mid;
$wpdb->update( 'wp_cf7dbplugin_submits',
array( 'order_id' => 0, 'order_payment' => 0 ),
array( 'submit_time' => $submit_time ),
array( '%s', '%d' ),
array( '%d' )
);
}}
add_action( 'wpcf7_before_send_mail', 'order_set_id');
But it doesn't work.
In the nearly past I wanted something similar. Found this two methods:
Idea is on hold for now, but asap I will have free time, will decide which method to use.
Good luck! :)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.