• Resolved 3Lancer

    (@3lancer)


    Hi,

    Since the update from WooCommerce Version 2.2.11 to 2.3.1, the method to get downloadable file URLs doesn’t appear to be available anymore?

    For example:

    $order = new WC_Order( $download['order_id'] );
    $download_file_urls = $order->get_downloadable_file_urls($download['product_id'], null, $download['download_id']);

    Now returns:
    Fatal error: Call to undefined method WC_Order::get_downloadable_file_urls()

    I need this to be able to list each of the Product download names and urls in a sorted order. It was working fine before the update.

    Has this called been Deprecated?
    Any suggestion / replacement?

    https://www.ads-software.com/plugins/woocommerce/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Claudio Sanches

    (@claudiosanches)

    I don’t remember now, but you can use get_item_downloads().

    $order = new WC_Order( $download['order_id'] );
    $download_file_urls = $order->get_downloadable_file_urls( $download );
    
    Thread Starter 3Lancer

    (@3lancer)

    Thanks for the prompt response, easy fix, appears to be working now with some minor changes!

    Just a correction for above, in case others need it:

    $order = new WC_Order( $download['order_id'] );
    $download_file_urls = $order->get_item_downloads($download);

    It appears you no longer have to decode the URL either.

    The previous method “get_downloadable_file_urls” should probably be noted as deprecated or changed in the references?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WC_Order get_downloadable_file_urls() – Downloadable product file urls’ is closed to new replies.