snippet reduce products x woocoomerce 2.0.10
-
Hello,
I used to insert this snippet code at functions.php from woocommerce to reduce the stock at the checkout, but now after the update from version 2.0.9 to 2.0.10 the snippet creates a conflict with woocommerce, and my page cannot load.
Is there any possibility to change the snippet code, that I can still reduce the stock at the checkout?Here is the code that I use
add_action( 'wp_footer', 'cs_reduce_stock' ); /** * Reduce stock during checkout. * * @return void */ function cs_reduce_stock() { if ( is_page( woocommerce_get_page_id( 'pay' ) ) ) { if ( isset( $_GET['order'] ) ) { $order_id = (int) $_GET['order']; $order = new WC_Order( $order_id ); $order->add_order_note( __( 'Awaiting payment.' ) ); $order->payment_complete(); } }
[Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]
- The topic ‘snippet reduce products x woocoomerce 2.0.10’ is closed to new replies.