• You MUST read the Babiato Rules before making your first post otherwise you may get permanent warning points or a permanent Ban.

    Our resources on Babiato Forum are CLEAN and SAFE. So you can use them for development and testing purposes. If your are on Windows and have an antivirus that alerts you about a possible infection: Know it's a false positive because all scripts are double checked by our experts. We advise you to add Babiato to trusted sites/sources or disable your antivirus momentarily while downloading a resource. "Enjoy your presence on Babiato"

Logged-in and Orders

asdriel

Member
Apr 26, 2019
199
18
18
www.bantu-2rsn.com
I want to get all orders made by current user inside a plugin function.
i have this code

if (!class_exists('WooCommerce')) :
require ABSPATH . 'wp-content/plugins/woocommerce/woocommerce.php';
$orders = get_all_orders();
endif;

function get_all_orders() {
$customer_orders = get_posts(apply_filters('woocommerce_my_account_my_orders_query', array(
'numberposts' => -1,
'meta_key' => '_customer_user',
'meta_value' => get_current_user_id(),
'post_type' => wc_get_order_types('view-orders'),
'post_status' => array_keys(wc_get_order_statuses())
)));
return $customer_orders;
}

and i want to call a popup when the user makes login, if in his orders theres one completed
 
AdBlock Detected

We get it, advertisements are annoying!

However in order to keep our huge array of resources free of charge we need to generate income from ads so to use the site you will need to turn off your adblocker.

If you'd like to have an ad free experience you can become a Babiato Lover by donating as little as $5 per month. Click on the Donate menu tab for more info.

I've Disabled AdBlock