I have a configurable product that has 12 associated products. One of those associated products needs to be part of a promotion.

Let's say the SKU for the configurable is J001 and the SKU for the simple product is J001-2D.

The attribute in the promotion is Container Size. The configurable doesn't have that attribute, but the associated products do.

If I create a shopping cart price rule that looks like the following:


That doesn't match anything. If I exclude everything (IE, Container Size Is Not whatever), it matches everything in the cart. This says to me that the promotion isn't matching the simple associated product.

Is this intended behavior? Is there a workaround?

  • Wouldnt this work out of the box. I mean cart rules validate the simple products - the problem we have is the opposite. We need to validate the parent attributes instead of the simple ones .... was this behavior changed in Magento?
    – snh_nl
    Jun 15, 2018 at 8:34

1 Answer 1


Apparently Magento does not support this by default. Instead, we overrode Mage_SalesRule_Model_Validator and created a salesrule rewrite. In that we check to see if the associated product matches the sales rule.


<?xml version="1.0"?>


* * *

private function _hasChildInCart($product){
    $quote = Mage::getSingleton('checkout/session')->getQuote();
    $childProducts = Mage::getModel('catalog/product_type_configurable')->getUsedProducts(null,$product);
    $childrenIds = $this->_getChildrenIds($childProducts);

    foreach($quote->getAllItems() as $item){
            $registeredItem = Mage::registry('rule_config_product_'.$product->getId());
            if($registeredItem != null && $registeredItem->getId() != $item->getId()){
            if($registeredItem == null){
            return true;
    return false;

private function _getChildrenIds($childProducts){
    $childrenIds = array();
    foreach($childProducts as $child){
        $childrenIds[] = $child->getId();

    return $childrenIds;

* * *

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.