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.