Home Forums WoodMart support forum WooCommerce – reverse minicart order V2

WooCommerce – reverse minicart order V2

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #566514

    boti
    Participant

    Hello, you sent us the following code and it worked:

    if ( ! function_exists(‘wd_revers_cart_content_default’)) {
    function wd_revers_cart_content_default( $cart_contents ) {
    if ( $cart_contents && is_array( $cart_contents ) ) {
    $cart_contents = array_reverse( $cart_contents );
    }

    return $cart_contents;
    }

    add_action(‘woocommerce_before_mini_cart_contents’, function () {
    add_action(‘woocommerce_get_cart_contents’, ‘wd_revers_cart_content_default’);
    });
    add_action(‘woocommerce_after_mini_cart’, function () {
    remove_action(‘woocommerce_get_cart_contents’, ‘wd_revers_cart_content_default’);
    });
    }

    however, if I change quantities with ajax, it does not. Can you please help? If I change the quantity, it bounces back to the end.

    #566906

    Hung Pham
    Participant

    Hi boti,

    Thanks for reaching to us.

    First of all, I’m really sorry have taken long time to reply you due to the weekend.

    Can you please share me link of topic that you received above code? I tried to look up the old topics but couldn’t find it.

    Regards,

Viewing 2 posts - 1 through 2 (of 2 total)