How to access WP database inside ipn.php? [duplicate]
Try adding this to the top of your script: require(‘/path/to/httpdocs/wp-blog-header.php’); global $wpdb; Then you can run queries using: $sql = “Your SQL Query Here”; $wpdb->get_results($sql)
Try adding this to the top of your script: require(‘/path/to/httpdocs/wp-blog-header.php’); global $wpdb; Then you can run queries using: $sql = “Your SQL Query Here”; $wpdb->get_results($sql)
add_action( ‘woocommerce_thankyou’, ‘change_order_status’, 10, 1 ); function change_order_status( $order_id ){ if( ! $order_id ) return; $order = wc_get_order( $order_id ); if( $order->get_status() == ‘processing’ ) $order->update_status( ‘pending’ ); }
I would normally make this a comment but I believe it warrants an answer. You should not circumvent the order process of WooCommerce because the order itself represent the state of the order and its transaction regardless of whether the transaction (payment) fails or succeeds. You need to consider: what happens if the payment succeeds … Read more
You can create a custom template in the theme that displays the ‘products’ custom post types (see the section on Template Files in Custom Post Types). Then code the HTML for the Paypal button in to your specific single-{posttype}.php and have the attributes such as price, etc, coming from custom fields. <form target=”paypal” action=”https://www.paypal.com/cgi-bin/webscr” method=”post”> … Read more
Paypal standard is now hidden for new installs, possible to read about it in https://developer.woocommerce.com/2021/07/12/developer-advisory-paypal-standard-will-be-hidden-on-new-installs/ for those who want to use it copy paste this code on functions.php add_filter( ‘woocommerce_should_load_paypal_standard’, ‘__return_true’ ); Since july 2021 woocommerce recommends users to use the recommended PayPal extension instead
I am not sure it will do exactly what you want, but it sure can help you to start. http://wordpress.org/extend/plugins/booking/ http://wordpress.org/extend/plugins/bookings/ http://www.checkfront.com/extend/wordpress/ and many others that you can find here or in google
Looking at your original code, I’d say you need to add the sslverify arg. And on a side note, use the HTTP functions available, rather than instantiating the class yourself (you shouldn’t have to load the class manually). wp_remote_post( $url, array( ‘sslverify’ => false, // this is true by default! ‘body’ => array( ‘METHOD’ => … Read more
Best way is to handle this with user roles. A user can register but not read. After paying with paypal, the role will be updated (e.g. from reader to subscriber). The update can be done through PayPals IPN. I made this for one of my clients. You will be paid by your customer. I will … Read more
You can hook to the init action and then check for the query variable, you can use the PayPal provided query var or you can use your own custom query var. I will give you example of your own custom query var i.e MYIPN_LISTENER The Code: function wpse58656_paypal_ipn_listener() { // check for your custom query … Read more
Late answer – I also added this answer on the other Q as addition to my answer. Possible solution Your best bet would be to use A Plugin that makes use of Custom Post Types, then use something like the RW_Meta_Box class library to add custom fields for seat reservation to the event. Use a … Read more