Magento validating cart price rules always returni…


I’ve created a cart worth rule for a configurable product. The rule situation has the SKU of the mother or father product. The performance is working appropriately. Now I wish to present the outline of the rule on the product web page. The difficulty is that the outline is displaying for all of the merchandise whereas it ought to present just for this specific product.

 

$objrules = $objectManager->create('MagentoSalesRuleModelRuleFactory')->create();
$guidelines = $objrules->getCollection();
foreach ($guidelines as $tmprule) {
          $rule = $objectManager->create('MagentoSalesRuleModelRule')->load($tmprule->getId());
          $product = $objectManager->get('MagentoCatalogModelProduct')->load($currentProduct->getId());
          $merchandise = $objectManager->create('MagentoCatalogModelProduct');
          $item->setProduct($product);                                
          if ($rule->getActions()->validate($merchandise) && $rule->getIsActive()) {
              $product_disctxt=$rule->getDescription();
          }
  }
}

The rule validation code 

$rule->getActions()->validate($merchandise)

 is all the time returning true for all of the merchandise.