Important. We are closed. Due to decreased amount of time available, we don't accept new orders and we don't provide support for existing ones.

Really incredible support from the team at MANAdev. I was having some issues getting the Layered Navigation SEO Plus set up as my theme was causing a ... Read more

Jan 10, 2017 Chanette Kennedy

Certified Magento Enterprise developer Certified Magento developer Certified Magento theme developer Certified Magento specialist

Manadev is certified extension and theme
developer for Magento

Configuring Special Conditions

Predefined Rules

Attribute Rules

Operators

Special Conditions are XML based language for specifying a subset of store products; this language defines a set of criterion (or rules) products must meet.

The "Tags and Labels" and "Shop by Special Price, Catalog Price Rules, New Arrivals, Attribute Option, Bestseller" extensions both use Special Conditions which are store in Condition field.

Special Conditions have different types. These types are:

  • Attribute Rules - select products based on attribute option like "Red Products"
  • Predefined Rules - select products based not on attribute options but rather on some other conditions like new products, promotion rules etc
  • Operators - this type is used to combine or intersect product lists

Predefined Rules

<new />

Prepares a collection of products set as new

New Product

<special_price />

Prepares a collection of products with special price.

Special Price Product

<promo />

Prepares a collection of products that is used by a catalog price rule. Uses the following XML attribute:

  • id - The ID of the catalog price rule that will be used as a filter. If not mentioned, all products that belong to an active catalog price rule will be used as the condition.

<price />

Prepares a collection of products with specified product final price (including all effective special prices and catalog price rules).

Price attribute uses the following XML attributes:

  • from - The starting price.
  • to - The ending price. Its value should be bigger than from.

At least one of these attributes needs to be mentioned. Both can be mentioned at the same time to use as a range.

Example: To get all products with a price from 0 to 500:

<price to="500" />

To get all products with a price of 1,000 above:

<price from="1000" />

To get all products with a price between 1,000 and 5,000:

<price from="1000" to="5000" />

Back to Top

Attribute Rules

Unlike Predefined Rules, Attribute Rules depends on what attributes are available in a Magento store.

Attribute code will work as a rule (e.g. <cpu_speed equals="2.0 GHz" />). However, Special Filters only support a few input types and each input type uses different XML attribute format.

If an attribute has the same name as any of the Predefined Rules, it will be used as Predefined Rule instead of an Attribute Rule.

Here are the supported input types and their format:

Supported Input Types

To optimize special tags loading from Tags and Labels Extension, it is advised to set Used in Product Listing to Yes.

Set Used in Product Listing to Yes

Date

Attribute of date type uses the following XML attributes:

  • since - Possible values are 1 day, 40 days, N days, 1 month, 36 months, N months, 1 year, 2 years, N years. Note that N should be bigger than 1.

Example: To get all products updated from today up to the last 1 month.

<updated_at since="1 month" />

Dropdown

Attribute of dropdown type uses the following XML attributes:

  • equals - Must be an option in the dropdown.

Example: Let's say we want to filter products with a specific color. First, we need to find out the possible options for the Color attribute.

Color Options

If we want to filter products with the color Red, we should use the following XML tag:

<color equals="Red" />

Value of equals is case sensitive, so <color equals="red" /> will not work because it must be Red and not red.

Price

Works the same as <price /> predefined rule. Attribute of price type uses the following XML attributes:

  • from - The starting price.
  • to - The ending price. Its value should be bigger than from.

At least one of these attributes needs to be mentioned. Both can be mentioned at the same time to use as a range.

Example: To get all products with a custom price from 0 to 500:

<custom_price to="500" />

To get all products with a custom price of 1,000 above:

<custom_price from="1000" />

To get all products with a custom price between 1,000 and 5,000:

<custom_price from="1000" to="5000" />

Back to Top

Operators

Operators are used to combine different rules. In XML, they are the parent tag of each rule. Here are the operators supported:

<and>

<and> is used to get products that is qualified in all the rules that it contains.

Example:

<and>
    <new />
    <price to="1000" />
</and>

This will prepare all new products with price of 0 up to 1,000.

<or>

<or> is used to get products that is qualified in **at least one rule ** that it contains.

<or>
    <color equals="Red" />
    <color equals="Black" />
    <color equals="Blue" />
</or>

This will prepare products that has either Red, Black, or Blue.

<not>

<not> is used to get products that is not qualified in the rule that it contains. It should have one rule inside it. If it has multiple children rules, then it will only negate the first rule and ignore the others.

To apply negation of multiple rules, then nest it with either <and> or <or> operators.

Example:

<not>
    <new />
</not>

This will filter all products except new products.

Back to Top

We Accept: PayPal Visa MasterCard American Express Discover