Many WordPress themes already come prepared for WooCommerce, because everyone knows why they start their website but not how it will end.
In fact, it’s a good idea -and I always recommend it- that the theme you choose is compatible with WooCommerce, even if you haven’t thought about adding online store functionality to your site yet.
But not all WooCommerce-compatible themes are the same, and I have detected that many of them do not incorporate something that seems to me to be a basic functionality: that any place where products appear there is a button to quickly add to the cart.
You will always find the add to cart button on the product page, but not in all themes it will be displayed in the catalog, product category file pages, etc.
I also find it particularly useful for cross-selling, so that once in the cart the customer can quickly add more products to their purchase, don’t you think?
How to make Divi and other themes show the add to cart button everywhere
One of the themes that surprisingly does not incorporate the default add to cart button is Divi.
Neither in the category file pages, nor in the WooCommerce modules, does it ever show the add to cart button, except on the product page.
But it is not the only one, others like Unwind, which I also like very much, also does not have this functionality, which as I mentioned before I think is basic, but above all very useful to sell more, which is what it is all about, isn’t it?
Fortunately, the solution is simple, no, very simple!
You only have to add one line of code to the functions.php file of the active theme, this one:
/* Add to cart button in store */ add_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 20 );
Save the changes and that’s it.
Now you will have buttons to add to the cart everywhere with the theme Divi…and with any other theme too.
Also, as you can see in the screenshots, nothing else needs to be modified. The buttons will be shown with the styles of the theme, in the language of the site, as if they had always been there.
Read this post in Spanish: WooCommerce: Botón de añadir al carrito en la tienda con Divi y cualquier otro tema