Hooking the woocommerce cart into the header menu
I want my cart link and counter to appear in the krystal shop header menu. I looked at the header.php file, it seems that the header nav menu is called thusly:
do_action( ‘krystalpro_action_header’ );
But when I add action using that hook, the cart counter ends up completely outside the header nav div, behind the header. I don’t think I am using the right hook. What would be the correct hook to use to hook into the header menu, so that the cart counter appears, ideally, as an li in the nav menu?
Replies (10)
-
August 17, 2019 at 1:53 am
I want my cart link and counter to appear in the krystal shop header menu. I looked at the header.php file, it seems that the header nav menu is called thusly:
do_action( ‘krystalpro_action_header’ );
But when I add action using that hook, the cart counter ends up completely outside the header nav div, behind the header. I don’t think I am using the right hook. What would be the correct hook to use to hook into the header menu, so that the cart counter appears, ideally, as an li in the nav menu?
-
August 17, 2019 at 11:49 am
Hi Mike,
Go to Appearance -> Customize -> Shop Settings and check the option Show Menu Cart.
Best Regards
-
August 17, 2019 at 7:54 pm
thanks!
-
August 17, 2019 at 9:06 pm
So I applied the settings you provided, but the cart icon is not showting up. I thought it might be sizing of div, but I can not figure out how to get the card to show.
http://www.goldenapplecannabis.com/dev -
August 19, 2019 at 5:40 am
Hi Mike,
We have just updated our theme to version 1.1.9
You’ll see an update notice in your WordPress admin dashboard.Best Regards
-
August 23, 2019 at 12:05 am
Okay, so the update fixed the cart issue, but now I have the same issue for the back to top button. the icon shows as a square, but should show as an up arrow.
-
August 23, 2019 at 5:00 pm
Hi Mike,
This issue is noted and will be corrected in our next theme update soon.
Best Regards
-
August 25, 2019 at 11:38 pm
Any idea where to start? I may not have that kind of time. Let’s open-source fix this here and now. Probably the same fix you did for the cart.
-
August 26, 2019 at 6:10 am
Hi Mike,
Yes, actually the issue is arising due to the Font Awesome version. The Elementor page builder is using Font Awesome version 5 and our theme was having version 4 which we have updated recently to version 5. We need to check the bottom to top icon also for this or we have to change its CSS.
Best Regards
-
August 28, 2019 at 3:48 am
Yes! I tried that too in child theme using different fa icon, but somehow it’s not resolving. I even gave it larger area, still no love.
Perhaps dequeueing krystal fontawesome version 4 in child theme and requeue version 5?
.btntoTop {
width: 40px;
height: 40px;
}.btntoTop:before {
font: 30px ‘FontAwesome’;
content: “\f062”!important; /*overrides parent style*/
} -
August 28, 2019 at 5:25 am
Thanks for sharing this code 🙂
Best Regards