x

HIDING SHOPPING CART ICON ON SOME PAGES

Hi. I note that this subject has been coming up in these pages since 2016. First, I don't want to change the status of my site (www.unfiltered.coop) from shopping cart to "buy now", so we can move on past that piece of advice; although useful, it is not relevant here as I would like to keep the shopping cart function on some pages, but to have the icon removed/masked from others. I have also watched/read many viedos and discussions about customizing code, including one posted by moderator Adam, which was very well put together, but was outlining how to hide navigation from a chosen page and identifying the ID/class of code using web inspector (sadly,  to my uninitiaed eye at least, web inspector does not seem to identify ID/class code that relates specifically to the cart icon). Adam has also mentioned, more than once, that the following code will form a guideline, with the caveat "I don't know what class or ID would be used for the cart, but if you find it in code you can include it in a manner like this":

<style>

#cart { display: none !important; }

</style

I am an amateur at best when it comes to coding (and that's probably an insult to amateurs) but from what I can see from the coding on my site, Adam's format looks as though it should work, but alas I can still see the cart on the pages where I have applied this code.

Clearly I am doing somehing wrong and would be grateful if somebody could give me a guide of what I should be looking for in the code and how to apply it. I think it would be of huge benefit for many others who would like to circumnavigate this particular issue. As some have mentioned over the years, it would seem to make sense to have a kind of "on/off" button but clearly Godot is gonna arrive before that's likely to materialize. With thanks.

363 Views
Message 1 of 2
Report
1 REPLY 1
Square

Is that the exact code you are using? It's missing a closing ">" and without it the code will not work. Full disclaimer, I barely know much about code other than what I see others posting here. I'm definitely not the expert to weigh in on this, but your above code should look like this: 

<style>

#cart { display: none !important; }

</style>

Keep in mind that the code may not work within the editor. You'll want to make sure to save the code, publish the site, then check the live version. If you want the code to only work on specific pages you will want to click on Pages at the top, then the page name on the left side list. Click SEO Settings, and paste the code in the Header section. 

Usually people add code to Settings>SEO>Header but if you add it here it will apply to all pages. 

356 Views
Message 3 of 2
Report