Black Friday is here! Save Up to 78% right now on our plugins and the all access bundle.

How to display the add to cart button on all pages in Divi theme

by | Sep 7, 2021 | Code Snippets | 0 comments

Divi theme has 3 modules that display WooCommerce products on different pages. The shop module displays the products on any page.

The Upsells module displays the upsell products on single product pages.

And the Related products module displays the related products on single product pages.

All the 3 modules do not display the “add to cart” button. This button is important to make it easy for your customers to add more products to the cart. This should lead to more sales.

Luckily, adding the add to cart button is really simple.

Add the following code to your child theme’s functions.php file at the very end (but before ?> if the file ends with it).

add_action('woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 9);

That’s it for today’s snippet. Let me know you want to see more like snippets this.

By Abdou

My name is Abdelfatah Aboelghit, a PHP developer from Egypt and my friends call me Abdou!
Here I write and develop products about Divi Theme.

More Article

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Shop Tabs Plugin

A must-have plugin for Divi & WooCommerce.

Read More

Divi Theme

The Best Theme For WordPress. 

Read More

Pin It on Pinterest

Share This