Hi,
I use the Storefront Pro plugin for that from Pootlepress.
Awesome to configure Storefront theme and remove cart link with one click.
Hope this helps,
Annie
Any way to do it without purchasing the plugin?
If you put the following code in your child theme’s style.css:
#main-nav-cart{
display:none
}
the cart should be removed as well π
This is not working for me π
Also, some clarification – I have storefront theme installed. Also, the style.css looks illegible.
Please help.
Do you have a storefront child theme created?
Never edit the actual parent theme ( storefront in this case ).
Always edit the child theme!
http://www.pootlepress.com/shop/free-blank-woothemes-storefront-child-theme/
Just tried it in a test site to make sure the code still works, but it did no longer hide the cart at this point.
Maybe the recent updates to Storefront made this code outdated…
You might find a solution here:
http://wooassist.com/category/code-snippets/
They present lots of code snippets for storefront.
Putting this code into the function.php ( child theme ) might do the trick:
function remove_sf_actions() {
remove_action( 'storefront_header', 'storefront_header_cart', 60 );
}
add_action( 'init', 'remove_sf_actions' );
I have not tested this, so not sure it still works. Make sure to test this and/or take a backup first.
-
This reply was modified 9 years, 9 months ago by
LogoLogics.
-
This reply was modified 9 years, 9 months ago by
LogoLogics.
has anybody figured this out to a successful conclusion
there are lots of ideas but none of them work for storefront
Adding the following code into the function.php (storefront theme) worked for me
*/
add_action( ‘init’, ‘jk_remove_storefront_header_search’ );
function jk_remove_storefront_header_search() {
remove_action( ‘storefront_header’, ‘storefront_product_search’, 40 );
}
/**
As LogoLogics suggested above, it should be possible to use CSS rules to stop it displaying.
The code they linked above would work, except perhaps a theme update has changed the div ID targeted.
At the time of writing, the current div ID is
#site-header-cart{
display:none
}
This can be added to the ‘Additional CSS’ under ‘Customize’ for the theme.
You may also want to remove the bar on mobile that displays the cart. Some info for doing that is here:
https://docs.woocommerce.com/document/customize-the-links-in-the-handheld-footer-bar/
When making those changes, its suggested to use this theme customisation plugin. Such that if woocommerce updates, you don’t lose the code you added.
Hi aph5, your answer was great. but i still cannot solve the issue on how to remove the bar on mobile and tablet.The info you provide not able to solve my proble. Why not you just provide the code ??