• Resolved embroideryallsorts

    (@embroideryallsorts)


    I give away a free file every day, which means my customers have a very long list of downloads, is there a way to put the latest one on top? currently, they are ordered from oldest to newest which means that they have to do a lot of scrolling to get their most recent download. I tried to add some code to functions.php but I got an error message that I had never seen before “BAILOUT malware detected”

    The code I was trying to add was

    function reverse_my_downloads_order( $downloads ) {
    return array_reverse( $downloads );
    }
    add_filter( ‘woocommerce_customer_get_downloadable_products’, ‘reverse_my_downloads_o

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Beauty of Code (woo-hc)

    (@beautyofcode)

    Hey @embroideryallsorts ,

    Thanks for reaching out!

    It looks like you are trying to add a code snippet that will change the order of the products on the Downloads tab on the My Account page, however, this is causing an error on your end, correct?

    I tried to add some code to functions.php but I got an error message that I had never seen before “BAILOUT malware detected”

    Oof, that is an odd error message, and one I have yet to experience.??

    Although help with custom code is outside our scope of support, I’m curious as to how this code snippet is being added to your site. Is it directly in the functions.php file, or via a snippets plugin?

    It appears that the code you have shared is incomplete, however, I managed to find the complete code here:

    The code provided there is working as expected on my end. There are no errors being produced when adding this snippet via the free Code Snippets plugin (this is the recommended way), and the Downloads order is rearranged correctly.

    Can you try adding the code below as is, via a plugin like Code Snippets and see if this works as expected:

    function reverse_my_downloads_order( $downloads ) {
        return array_reverse( $downloads );
    }
    add_filter( 'woocommerce_customer_get_downloadable_products', 'reverse_my_downloads_order' );

    If you are still seeing the error, do you perhaps have any plugins or additional custom code that directly targets the My Accounts page? If so, you can try temporarily deactivating those and see if this makes any difference.

    Cheers!

    Plugin Support Beauty of Code (woo-hc)

    (@beautyofcode)

    Howdy,

    We haven’t heard back from you in a while, so I’m going to mark this as resolved.

    Feel free to?create a new topic?if you need any further help with WooCommerce core ??

    Cheers!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘customer downloadable products list newest on top’ is closed to new replies.