cancel
Showing results for 
Search instead for 
Did you mean: 

Load Sales Rule - Get Details

Load Sales Rule - Get Details

In Magento EE1, I was able to get sales rule information from product list page with the following...

 

 

$rule = Mage::getModel('salesrule/rule')->load($ruleId);
$isActive = $rule->getIsActive(); $fromDate = $rule->getFromDate(); $toDate = $rule->getToDate();
$label = $rule->getStoreLabel();

How can I achieve the same in Magento 2?

 

Thank you.

Mike

1 REPLY 1

Re: Load Sales Rule - Get Details

I was able to get rule information with this.

 

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$rule = $objectManager->create('Magento\SalesRule\Model\Rule')->load($ruleId);