Hi guys,
I’m using Woocommerce for a client who wants to use it only as a catalogue – purchasing is not to be enabled.
I’ve used the “WooCommerce Catalog Visibility Options” plug-in to successfully remove the ‘Add to cart’ from the product view page. However, it does not affect products displayed on category listing pages.
Can you point me to the file that contains the code that produces the buttons there so I can remove it?
Many thanks,
Andrew
Hi thewebworkshop!
Please add following code to Quick CSS in Enfold theme options under General Styling tab
.archive .avia_cart_buttons {
display: none!important;
}
Best regards,
Yigit
Hi Yigit,
Thanks for the reply. I know that a CSS workaround would stop it being displayed on the page when it is displayed as normal. However, the code for it would still be in the HTML and disabling the CSS would make the link visible. I know it’s pretty unlikely that many users will do this, but it still needs to be factored in. Screen readers would also ‘see’ the link.
Can you point me to the file that deals with the link? :)
Many thanks, Yigit.
Andrew
Hey!
Please add following code to Functions.php file in Appearance > Editor
function add_custom_script(){
?>
<script>
jQuery(window).load(function(){
jQuery(".archive .avia_cart_buttons").remove();
});
</script>
<?php
}
add_action('wp_footer', 'add_custom_script');
Best regards,
Yigit
Brilliant. That’s done the trick!
Thanks for your help. Much appreciated.