简体   繁体   中英

Wordpress Contact Form 7 Database Unique ID

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.

  1. I need to display a hidden form as payment invoice after submittin a form. How can I do it?
  2. How can I block sending email messages in Contact Form 7?

In the nearly past I wanted something similar. Found this two methods:

  1. http://runastartup.com/integrate-paypal-button-with-contact-form-in-wordpress/
  2. http://www.gobdg.com/blog/code-library/donation-form-using-contact-form-7-paypal/

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM