0

I have magento 1.6.2.

In my store sale labels are being shown on products which have a special price (set per product)

Here for the following code is being used:

  function getProductLabel($_product, $list_mode)
    {
        if (!$list_mode) return;
        $output = '';
        if (Mage::getStoreConfig('product_labels/show_sale_label')) {

            $now = date("Y-m-d");
            $specialFrom = substr($_product->getData('special_from_date'), 0, 10);
            $specialTo = substr($_product->getData('special_to_date'), 0, 10);

            $special = false;

            if (!empty($specialFrom) && !empty($specialTo)) {
                if ($now >= $specialFrom && $now <= $specialTo) $special = true;

            } elseif (!empty($specialFrom) && empty($specialTo)) {
                if ($now >= $specialFrom) $special = true;

            } elseif (empty($specialFrom) && !empty($specialTo)) {
                if ($now <= $specialTo) $special = true;
            }
            if ($special) $output .= '<div class="label_sale_' . Mage::getStoreConfig('product_labels/sale_label_position') . '"></div>';

        }

But this doens't work with products which have a sale price set by the catalog price rules.

How can i change this code so the sale label will also be shown when a special price is being generated by the catalog rules?

Thanks in advance.

Ronny
  • 531
  • 14
  • 36
  • Check below link please.. that may help you, http://stackoverflow.com/questions/14093500/magento-how-to-get-the-price-of-a-product-with-catalog-rules-applied – Nidheesh Sep 09 '13 at 05:45
  • hi needheesh, Thanks, i gonna take a look there – Ronny Sep 09 '13 at 06:52

0 Answers0