Woocommerce don't show orders with variable

Viewed 13

I'm trying to not display elements in my Woocommerce My Account section that have the variable $customer_quotes

Here is the Woocomerce code out of the box:

foreach ( $customer_orders->orders as $customer_order ) {
    $order = wc_get_order( $customer_order ); // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
    $item_count = $order->get_item_count() - $order->get_item_count_refunded();

Now I have tested the following code but it doesn't work and only breaks the page:

foreach ( $customer_orders->orders as $customer_order ) {
    $order = wc_get_order( $customer_order ); // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
    $item_count = $order->get_item_count() - $order->get_item_count_refunded();
    if ( $customer_quotes ) {
                continue;
            }

Any ideas on how to fix this?

0 Answers
Related