Magento1.8 – Catalog Price Rules Not Working

catalog-price-rulesmagento-1.8

I'm on Mage 1.8 with custom data.

  • I have created a catalog rule that give 10% discount when sku = 'n2610' ( relative product id is 16 )
  • saved the rule
  • apply all the rule

Now I m testing the rule with the following code:

<?php
require_once './app/Mage.php';
umask(0);
Mage::app();
//Mage::setIsDeveloperMode(true);

$rule = Mage::getModel('catalogRule/rule')->load(5);

var_dump($rule->getData());
var_dump($rule->getMatchingProductIds());

getMatchingProductIds() gives me back an array() with all prod. here the part for the interested product.

RESULT:

16 => 
array (size=3)
  0 => int 0
  1 => int 0
  2 => int 0

I expect that the array contains some 1.

If I debug the following method, I can see that the $validatedValue is always empty so the rule never match.

Mage_Rule_Model_Condition_Abstract::validateAttribute($validatedValue)

Anyone can point me to the error ? is it a bug on 1.8 ( I'm quite sure I haven't touched any core file.)

Best Answer

According to this answer: https://stackoverflow.com/questions/19857309/magento-1-8-0-0-promotion-catalog-price-rules-does-not-work-when-condition-i

It's a bug/feature in 1.8, Catalog Rules work with conditions for attributes with scope other than Global.

Related Topic