website blocks

Targeting the right people with the right message is a skill you need to develop to succeed in eCommerce. But not without a little help. Magento 2 Dynamic Blocks  and Pages is a tool that helps you control the display of CMS blocks and pages for different customers and under different conditions.

Today we'll focus on the CMS blocks and teach you to enable dynamic blocks in Magento in various scenarios. 

Step 1: Create CMS Block

Before we move to the conditions you need to create a Magento CMS block. All the conditions and display settings will be under the block Content once you install the extension.

Magento 2 Create New CMS Block

Step 2: Set Conditions

If you display content blocks using widgets, you can define what page and place on the page to display a block on. However, you can't choose to display a block only if a product is new, or if a person browsing products or categories has already added something to the cart. 

That's what dynamic block conditions cover.

Set conditions based on product attributes

If you want to display CMS blocks only on on-sale products, items with certain size, colours, etc., you can do that with the product attributes. Simply specify an attribute or a combination of them to narrow down pages dynamic block should be displayed on.

e.g. You can display a personal discount offer only on items from certain categories or only new products. Additionally, you can display this banner with different discount amounts for different customer groups. 

magento 2 product attributes in conditions

Set conditions based on cart attributes

With the cart attributes you can choose what state of the cart should define the display of a block. Especially if you display CMS blocks on a shopping cart.

e.g. You can display the free shipping offer only to one country and only for orders less than $200. The rest of the customers won't see it.

magento 2 cart attributes in conditions

Step 3: Fill out Display Settings

The dynamic blocks display settings cover how, when and to whom your block will be displayed. Besides, here you can define what blocks to display instead of the current once in case it's aimed only at certain customer groups.

Enable display mode and device

Since it's important to maintain a high loading speed on your store, pay attention to these settings. You can choose the Display Mode to lazy load CMS blocks in Magento and display them only on certain Devices.

magento block display settings mode

Choose customer groups

Personalization is key to better conversions. That's why you need to target different customer groups with different blocks. Choose who to display dynamic blocks to in the Visible For Customer Groups section. 

magento 2 cms block restrictions for customer group

Set date, time and day of the week

You can't enable and disable certain CMS blocks every time you have a new offer coming. Just specify the Date From/To, Days of the Week and Time From/To to define when your block should be enabled. The extension will do the rest automatically.

magento dynamic blocks date

Choose another block to display

Finally, if you create a CMS block for certain customer groups, and display it on a product page, what do other see? You can leave the block space emply, of you can display another block there.

Don't miss out on the opportunity to target more people. Display multiple Magento dynamic blocks in the same place, but let different customers see different messages.

display another block

Don't forget to Save your dynamic block and test it on the fronted under different conditions. 
cms block in magento shopping cart

The better the offer the more likely people are to convert. However, personalization makes it even more likely to happen. 

Display dynamic blocks under various conditions, but remember to enable dynamic pages in Magento as well.

FAQs

How to configure dynamic blocks for a customer segment in Magento?
collapsible icon
To create a dynamic block for customer segments, navigate to Content > Blocks and create a new CMS block.

Then use the Magefan Dynamic Blocks and Pages to assign CMS blocks to different customer groups. This way, even if displayed in the same container and position, different blocks will be displayed for different customer segments.
How to add custom dynamic block to Magento checkout?
collapsible icon
You can add a custom dynamic block to checkout using three different methods: your theme, a custom module or default admin settings.

The easiest way is to add CMS block to Magento checkout using just CMS block and widget settings.
How to enable dynamic blocks in Magento with full page cache turned on?
collapsible icon
If you use Magefan Dynamic Blocks Extension, it is fully compatible with the full page cache. And due to the "Replacement block" feature, each dynamic block assigned to a different customer groups or conditions will load according to those conditions, on different pages.