cancel
Showing results for 
Search instead for 
Did you mean: 

Conditional display of HTML / block in product / category page

Conditional display of HTML / block in product / category page

I’m looking for a extension that can display text on any page in frontend (Magento 2). This would be conditional - otherwise it’s fairly simple to display any attribute for example an all product pages.

 
For example:
 
IF  "selling price" is greater than 99 THEN display "text: Free shipping"
 
IF  "attribute: manufacturer" is ”BRANDX" AND "product name" contains "Jacket" THEN display "BRANDX size chart"
 
So basically any variation:
IF "attribute/price/store/any variable" is more than/contains/etc "value" THEN display text/html/snippet/block/etc
 
There are banner extensions, size charts etc. for fixed positions, but one that allows custom positioning for any snippet of HTML based on a condition; attribute, store view, date, cart etc. You can get really creative with this...
3 REPLIES 3

Re: Conditional display of HTML / block in product / category page

Re: Conditional display of HTML / block in product / category page

If I got you right you want to add custom block under some conditions. And I've got just the module for you.

 

In Magento 2 you can create a CMS block and display it using widget almost everywhere in your store. But what Magento doesn't allows you to do is to define what customer groups and time to display this block or page. 

 

So, Magento 2 CMS Display Rule extension is the extension that allows you to define the display of CMS blocks or pages to different customer groups, date, weekday and time.

 

It also allows you to set conditions based on product and shopping cart attributes to display this CMS blocks and pages. 

 

Hope that's what you're looking for.

Re: Conditional display of HTML / block in product / category page

johnpetersdca2, it actually helped. For those developers or regular users, who don't know the basics of HTML tags and how to use them correctly in every single situation, I can recommend articles like this about html strong vs b comparison guide. It's written by dev professionals, with all the detailed information about those tags and some others.