-
AuthorPosts
-
January 11, 2016 at 10:29 am #740988
Hi
I would like to move the woocommerce cart that is displayed in the nav menu upon activation (see image attached) to the top bar… what do i need to change in files to accomplish that?
Thanks a lot
Cheers carlo
January 11, 2016 at 10:46 am #741008Hello Carlo,
Thanks for writing in! To assist you with this issue, we’ll first need you to provide us with your URL. This is to ensure that we can provide you with a tailored answer to your situation. Once you have provided us with your URL, we will be happy to assist you with everything.
Thanks.
January 11, 2016 at 11:16 am #741061Hi
i have my site in a developing subdomain… it is online but dns is not pointing to it so it is hidden for everyone…
i could give you details so you can add it to terminal (mac) or something so you can check it…
please let me know
January 11, 2016 at 11:54 am #741116Hi there,
Thanks for updating! X WooCommerce cart button is specifically to appear in the Navbar. It could be possible to show it in the Topbar with custom development, but it would fall beyond the scope of support we can provide. You may wish to consult a developer to assist you with this. X is quite extensible with child themes, so there are plenty of possibilities.
Thanks for understanding.
January 11, 2016 at 12:03 pm #741133i will search in this forum because i have seen it somewhere here but can’t track it anymore…
something with a shortcode and another post adding something to topbar.pgp
January 11, 2016 at 12:58 pm #741197Hi there,
Thanks for updating! Maybe you are referring this thread – https://community.theme.co/forums/topic/add-cartmy-account-woocommerce-into-top-bar/
You can follow this if you are ready to go for some custom development. However we can’t guarantee anything about the suggested code there as it’s a pretty old thread and won’t be able to assist you on this.Cheers!
January 12, 2016 at 4:59 am #742290I couldn’t find the info needed in there… as you said it’s an old post and already showed that the shortcode plugin wouldn’t work.
also the less plugins he better 😉
for sure there has to be a code somewhere that adds the cart button (the one that gets activated in nav bar by checking the option in customizer…with amount and item number) to the nav bar?
If you maybe could tell me where to find it i could maybe try to get it in topbar.php?
January 12, 2016 at 5:58 am #742361Hi there,
Copy _topbar.php from framework/views/global and put it in the same path inside child theme, replace existing code with following :
<?php // ============================================================================= // VIEWS/GLOBAL/_TOPBAR.PHP // ----------------------------------------------------------------------------- // Includes topbar output. // ============================================================================= ?> <?php if ( x_get_option( 'x_topbar_display' ) == '1' ) : ?> <div class="x-topbar"> <div class="x-topbar-inner x-container max width"> <?php if ( x_get_option( 'x_topbar_content' ) != '' ) : ?> <p class="p-info"><?php echo x_get_option( 'x_topbar_content' ); ?></p> <?php endif; ?> <?php x_social_global(); ?> <ul class="x-nav"> <li class="menu-item current-menu-parent x-menu-item x-menu-item-woocommerce"> <a href="<?php x_get_cart_link(); ?>" class="x-btn-navbar-woocommerce"> <?php echo (x_woocommerce_navbar_cart()); ?> </a> </li> </ul> </div> </div> <?php endif; ?>
Hope it helps.
January 12, 2016 at 6:17 am #742379Hi
yep, that made it show in top bar 😉
2 (minor) issues … how come the amount shows 3 digits after the ,? so instead of € 0,00 it shows € 0,000
i configured 2 dig’s in woocommerce…does it not pick it up somehow?
Also when clicking it it stays on same page… so i guess the get cart link doesn’t activate somehow
edit: hahahahaha… i was looking a bit crosseyed here… the 3 digits is my mistake it says €0,000 items… so the 3rd 0 belongs to items… didn’t style it yet so it is without any styling.
January 12, 2016 at 7:33 am #742459Hi,
Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:
– Link to your site
– WordPress Admin username / password
– FTP credentialsDon’t forget to select Set as private reply. This ensures your information is only visible to our staff.
January 12, 2016 at 9:26 am #742590This reply has been marked as private.January 12, 2016 at 9:32 am #742604Hi
Before you proceed… my son just came home and had a look at it and suggested a small addition:
Instead of:
<ul class="x-nav"> <li class="menu-item current-menu-parent x-menu-item x-menu-item-woocommerce"> <a href="<?php x_get_cart_link(); ?>" class="x-btn-navbar-woocommerce"> <?php echo (x_woocommerce_navbar_cart()); ?> </a> </li> </ul> Use <ul class="x-nav"> <li class="menu-item current-menu-parent x-menu-item x-menu-item-woocommerce"> <a href="<?php echo x_get_cart_link(); ?>" class="x-btn-navbar-woocommerce"> <?php echo (x_woocommerce_navbar_cart()); ?> </a> </li> </ul>
so before x_get_cart_link add “echo” … that worked.
January 12, 2016 at 10:22 am #742685Glad you’ve sorted it out.
If you need anything else, please let us know 🙂
January 12, 2016 at 10:39 am #742722I will.. thanks for all the great help!!
January 12, 2016 at 10:56 am #742753You are most welcome. 🙂
-
AuthorPosts