Home Forums WoodMart support forum change the order of items in the mini-cart of your Woodmart theme to have the la

change the order of items in the mini-cart of your Woodmart theme to have the la

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #508232

    boti
    Participant

    To change the order of items in the mini-cart of your Woodmart theme to have the last added item appear first, you would need to customize the code that handles the cart items listing. However, based on the search results provided, there is no direct solution to this specific request available.

    #508423

    Luke Nielsen
    Keymaster

    Hello,

    Sorry to say but right now there is no option in Theme Settings available for that. It requires Customization and this is beyond our limitations and support policy scope. Hope you can understand our limitations.

    If you’d like to contact us, we are here for whatever questions you may have.

    Kind Regards.

    #508751

    boti
    Participant

    Hello, can you do it with custom development?

    #508753

    Luke Nielsen
    Keymaster

    Hello,

    Try to define the below code in the child theme and recheck the issue.

    if ( ! function_exists('wd_revers_cart_content')) {
    		function wd_revers_cart_content( $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');
    		});
    		add_action('woocommerce_after_mini_cart', function () {
    			remove_action('woocommerce_get_cart_contents', 'wd_revers_cart_content');
    		});
    }

    In the meantime, feel free to ask me any questions you may have.

    Kind Regards

    #509121

    boti
    Participant

    it works, thanks.

    #509124

    Luke Nielsen
    Keymaster

    Hello,

    You are welcome! In case you need any additional help, I’d be more than happy to assist you.

    Have a good day!

    Kind Regards

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

The topic ‘change the order of items in the mini-cart of your Woodmart theme to have the la’ is closed to new replies.