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

有帮助吗?

解决方案

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.

其他提示

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;
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top