# Can you apply a category rule programmatically?

I've been using $product->getSpecialPrice() to build a custom price range on configurable products: Hat$3.50-$10.00 special price$2.00-$8.00 This works fine on the product page (templates/catalog/view.phtml) as I'm updating it dynamically by pulling data from the json product object. However, the getSpecialPrice() is not being picked up on the category pages: Hat$3.50-$10.00 special price$0.00-\$0.00

as getSpecialPrice() is returning null.

Is there a method to extract the price with the applied catalog rule?

thx

• So you basically need like this when you enter price at category level then that price will added into that product base price ? – Keyul Shah Jan 29 '14 at 3:35
• Edit the special_price attribute and set Used in product listing to Yes. Reindex and you will have the attribute available in product list. – Marius Feb 21 '14 at 7:46

## 1 Answer

Edit the special_price attribute and set Used in product listing to Yes. Reindex and you will have the attribute available in product list.