EDD Products in Cart

In this guide, you’ll learn how to setup Easy Digital Downloads (EDD) and Conditional Blocks within WordPress to detect which products are in the customers cart. You’ll then be able to create dynamic content by controlling the visibility of specific WordPress blocks based on the specific products in the cart.

Whether you want to offer special content, promotions, or additional product recommendations, this condition can help you tailor your content to the shopping behavior of your customers.

What can you create by detecting product?

  • Personalized Recommendations: Show related product suggestions based on what the customer already has in their cart.
  • Promotional Content: Display special offer blocks for customers who have certain products that qualify for a promotion.
  • Upselling Opportunities: Highlight premium versions or add-ons of the products in the cart to encourage an upgrade.


These are the minimum requirements you need to meet on your WordPress site in order to setup the Cart Products visibility Condition.

Setting up the Cart Products Condition

Select the Block You Want to Conditionally Display: Choose or create the block that will hold your promotional content or special offer. You can be creative with content you create..

Access Visibility Settings: Click any block and navigate to the Conditional Blocks visibility settings in the block settings sidebar.

Screenshot of the WordPress editor with arrows pointing to the Edit Visibility button

Configure the Condition: In the visibility settings, select the “Cart Products” condition. Choose the specific product (in our case, the e-book) that will trigger the visibility of the block. You can also set additional parameters such as the minimum quantity required in the cart.

Screenshot of Conditional Blocks settings for toggling visibility when a specific product is in the cart

Combine Conditions (Optional): Utilize “AND/OR” logic to combine multiple conditions (such as the EDD Cart Value) for more complex visibility rules.

Preview and Publish: Preview your page to ensure the block appears correctly when the conditions are met. Once you’re satisfied, publish or update your page.

Screenshot of example checkout with no products in the cart
Screenshot of Easy Digital Downloads checkout with custom conditional content

Well done, you’ve successfully changed the block content if the customer has the “ebook” in the cart or not. There’s many use-cases we haven’t covered in this guide, anything is possible – it’s all about being creative with Conditional Blocks.

Was this page helpful?