• Resolved Alex Volkov

    (@vol4ikman)


    How to get all Global Shop Discount products or taxonomies with PHP?

    I need to access to all products with global discount. How can I do that?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @vol4ikman,

    Thanks for reaching out.

    I have escalated this with our development team. They will get back to you as soon as they can.

    Kind regards,
    Moshtafizur

    Plugin Author Algoritmika

    (@algoritmika)

    Hi @vol4ikman,

    Please update the plugin to the latest v1.6.0 – I’ve added a new function to get all discounted product ids:

    alg_wc_gsd_get_product_ids( $product_query_args = array( 'limit' => -1 ), $incl_on_sale = true, $use_transient = false )

    The function has three optional parameters:

    • $product_query_args – sets which products to check. By default, it’s set to all products, i.e., array( 'limit' => -1 ). This parameter is passed directly to the WooCommerce wc_get_products() function, so you can use all the same parameters as listed in the documentation.
    • $incl_on_sale – if set to true, will return all on-sale products in your shop, including products that you have set on-sale manually, without using our plugin.
    • $use_transient – the function goes through all products in your shop, so it can be rather slow, especially if you have a lot of products in your shop. To speed things up, you can store results in a transient by setting the parameter to true. The transient expires after 24 hours.

    Please give it a try and let me know what you think.

    Plugin Author Algoritmika

    (@algoritmika)

    I’m going to mark this thread as “resolved” for now, hope that’s ok. Please let me know if there are still any questions/issues.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to get all Global Shop Discount products or taxonomies with PHP’ is closed to new replies.