Update: I think I found a good woocommerce hook to add the action to:
"woocommerce_review_order_after_payment"....
so to add an action to this hook whenever it fires, I'd do something like this:
in my functions.php file:
add_action('woocommerce_review_order_after_payment', 'my_wpdb_insert_or_update_function');
function my_wpdb_insert_or_update_function($riderID, $donationAmount) {
global $wpdb;
$myQ = $wpdb->prepare('Insert INTO my_table ('rider_id', 'funds_raised') VALUES ($riderID, $donationAmount));
$wpdb->query($myQ) or die ("Error Preparing Query For Execution");
$wpdb->execute() or die ("Error Sending Data To DB");
$wpdb->close();
}
Does that look correct for the most part? Will the $donationAmount and $riderID be available via POST data (I can see these variables on the checkout screen)?
WordPress ...
ما را در سایت WordPress دنبال می کنید
برچسب : نویسنده : استخدام کار wpss بازدید : 157 تاريخ : دوشنبه 17 خرداد 1395 ساعت: 7:43