webdevask.com

Menu

  • Home
  • New
  • Add question

php - how to query WooCommerce products by date_modified

View Original

one text

i am trying to query products by date_modified, to find all the products i did not updated today.

this is the product query :

enter image description here

this is what i have tried so far :

$limit = 400;
    $products_ids = get_posts( array(
        'post_type'        => ['product','product_variation'],
        'numberposts'      => $limit,
        'post_status'      => 'publish',
        'fields'           => 'ids',
        'meta_query'       => array( array(
            'key'     => 'date_modified',
            'compare' => 'NOT LIKE',
            'value'   => '2022-11-17',
        ) )
    ) );
    print_r($products_ids);

Source

See also:

  • php สร้าง Google ชีตจากบัญชีบริการ

  • php - Laravel 8.0 Installation Failed

  • javascript - How to include HTML data (tags) as value in "arrayToDataTable" of Google Pie Chart?

  • how to Grouping array in php

  • php - vender folder from my laravel project has more 1k error

© 2021
E-mail: contact@webdevask.com
Back to top