Magento no es compatible con esto por defecto. En su lugar, anulamos Mage_SalesRule_Model_Validator y creamos una reescritura de salesrule. En eso, verificamos si el producto asociado coincide con la regla de ventas.
app / code / local / AAA / SalesRule / etc / config.xml
<?xml version="1.0"?>
<config>
<modules>
<AAA_SalesRule>
<version>0.1.0</version>
</AAA_SalesRule>
</modules>
<global>
<models>
<aaa_salesrule>
<class>AAA_SalesRule_Model</class>
</aaa_salesrule>
<salesrule>
<rewrite>
<validator>AAA_SalesRule_Model_SalesRule_Validator</validator>
</rewrite>
</salesrule>
</models>
</global>
</config>
app / code / local / AAA / SalesRule / Model / SalesRule / Validator.php
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) {
if (in_array($item->getProductId(), $childrenIds)) {
$registeredItem = Mage::registry('rule_config_product_' . $product->getId());
if ($registeredItem != null && $registeredItem->getId() != $item->getId()) {
Mage::unregister('rule_config_product_' . $product->getId());
}
if ($registeredItem == null) {
Mage::register('rule_config_product_' . $product->getId(), $item);
}
return true;
}
}
return false;
}
private function _getChildrenIds($childProducts) {
$childrenIds = array();
foreach ($childProducts as $child) {
$childrenIds[] = $child->getId();
}
return $childrenIds;
}