Site logo

Archived topic

Change cart menu and breadcrumb

31 replies · Started by Caroline on September 25, 2018

Viewing posts 16–30 of 32

I'm not sure if it will work, but you can try replacing:

WC()->cart->get_cart_subtotal()

With:

WC()->cart->get_subtotal()

Unfortunately I'm not super familiar with the WooCommerce code base, so I'm not 100% sure on this one.

If I do that change the amount is without tax. The same thing happen if I change it to
WC()->cart->get_cart_total()

But I just keep the prices in cart with tax so its not a big problem. I have made a new topic to fix the including tax text.

Is there anyway to get the css code to move the cart to the left on mobile too?

You could do something like this:

@media (max-width: 768px) {
    .inside-navigation {
        display: flex;
    }

    .menu-toggle {
        order: 1;
    }

    .mobile-bar-items {
        order: 3;
    }

    .wc-mobile-cart-items {
        order: 2;
        margin-right: auto;
    }
}

If you need to support old browsers, you can run that code through this tool: https://autoprefixer.github.io/

Thank you :-)
I can’t figure out how to remove (inkl. mva) i my navigation. Could you change to code to just hav a number of items, and not (1)?

So just the number without the brackets?

Yes

Thank you. The amount was still there but I removed
<span class="amount"><?php echo wp_kses_data( WC()->cart->get_cart_subtotal() ); ?></span>

hope that was the right ting to remove to only show the numbers of items

When I use this css my mobilenavigation get like this https://ibb.co/gW0hrz

@media (max-width: 768px) {
    .inside-navigation {
        display: flex;
    }

    .menu-toggle {
        order: 1;
    }

    .mobile-bar-items {
        order: 3;
    }

    .wc-mobile-cart-items {
        order: 2;
        margin-right: auto;
    }
}

But I want it like this, just change place on the search and cart. https://ibb.co/jWrNrz

I did and then it looks like the last image in my post. But the search and cart should change place.

Looks like you added a maintenance page - any chance you can send me login details so I can see the site?: https://generatepress.com/contact

Be sure to mention this topic :)

I turned off the maintenance mode now :-)

Try this function:

add_action( 'after_setup_theme', function() {
    remove_action( 'generate_inside_navigation', 'generatepress_wc_mobile_cart_link' );
    add_action( 'generate_inside_navigation', 'generatepress_wc_mobile_cart_link', 99 );
} );
This archived topic is closed to new replies.