Support » Plugin: WooCommerce Filter Orders by Product » Please use wc_get_products in dropdown_fields()

  • Hi there, thanks for building this Plugin and maintaining it. Please note that direct database access is not recommended and WC functions are available to mitigate this.

    File: woocommerce-filter-orders-by-product/inc/filter-by-product.php

    Here’s also a way to allow the Plugin user to format the Product option label, i.e. appending the SKU


    $args = array(
    ‘status’ => apply_filters( ‘wfobp_product_status’, ‘publish )
    );
    $products = wc_get_products( $args );
    foreach( $products as $product ) {
    $fields[$product->get_id()] = apply_filters( ‘wfobp_product_option_label’, $product->get_title, $product );
    }

    • This topic was modified 5 months, 3 weeks ago by Michael Visser.
    • This topic was modified 5 months, 3 weeks ago by Yui.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.