WooCommerce-REST-API-Client-Library icon indicating copy to clipboard operation
WooCommerce-REST-API-Client-Library copied to clipboard

WooCommerce -Deleted order LineItem

Open nitin2907 opened this issue 9 years ago • 0 comments

Hi all, I am using woocommerce plugin in wordpress & and place it inside /home/builhsqv/public_html/test/wp-contents/plugins/ location And I have created a core php file inside /home/builhsqv/public_html/test/test.php, in this file i have written code to delete a individual Order line item. below is my code :-

//TEST.PHP

//wc-order-functions.php (File of woocommerce )

query( $wpdb->prepare( "DELETE FROM {$wpdb->prefix}woocommerce_order_items WHERE order_item_id = %d", $item_id ) ); $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->prefix}woocommerce_order_itemmeta WHERE order_item_id = %d", $item_id ) ); do_action( 'woocommerce_delete_order_item', $item_id ); return true; } ?>

when i run this file in browser, it's showing blank page. but when i comment the require path and the calling function that i can see the echo message.

I want to deleted a order line item using php script in woocommerce.

any help would be appreciate. thank you in advance.

Thanks & Regards, Nitin Shukla

nitin2907 avatar Aug 08 '16 07:08 nitin2907