Question

I have a Magento 1.5.0.1 site and have recently come across a problem which I cannot so far seem to solve. I have created many catalog price rules in the past and they've worked fine.

I'm using the condition 'is one of' and I'm selecting a bunch of SKUs. When I save the rule and go and check the selected SKUs, for some reason is has de-selected some of them - and it seems completely random. (see pic below)

All SKUs are virtually identical, and there's nothing to differentiate the ones that have worked with the one's that haven't. No other rules have been applied, there's no correlation with regards to stock levels. I'm at a loss at the moment!

If any one has come across a similar issue or has been made aware of a bug in this version then please let me know. I'd appreciate any help!

enter image description here

Was it helpful?

Solution

I figured out the cause of this problem. It's 50% a bug and 50% our fault.

There was a spacebar space at the end of some of the SKU's (the ones highlighted), and even though the space was included in the comma-separated string that applied the rules to, it didn't count them.

So the moral of the story is to check your SKU data has absolutely no spaces to ensure it works with catalogue promotions.

OTHER TIPS

Additionally, you can use this method to apply rules to any product.

$product = Mage::getModel('catalog/product') -> load($productId);

$rules = Mage::getModel('catalogrule/rule')->getCollection()->addFieldToFilter('is_active', 1);

foreach ($rules as $rule) {
      $rule->applyAllRulesToProduct($product);
}

echo "Applied rules to " . $productId;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top