0

In Magento 1.x and 2.0.x, used the event adminhtml_block_salesrule_actions_prepareform to add custom cart price rule type.

But, from 2.1.0 onwards it is not working. Can anybody help on how to integrate custom rule types in cart price rule?

The code for the observer code in 2.0.0 is as below and it was working.

public function execute(Observer $observer) {
    $actionsSelect = $observer->getForm()->getElement('simple_action');
    if ($actionsSelect) {

        $values = $actionsSelect->getValues();
        $values[] = array(
            'value' => 'my_promotions_percent',
            'label' => __('Reset price to percentage of actual price'),
        );
        $values[] = array(
            'value' => 'my_promotions_fixed',
            'label' => __('Reset price to new fixed price'),
        );

        $actionsSelect->setValues($values);
    }
    return $this;
}
  • Any updates on this? I am also facing the same issue in Magento2.1.0 – MagePsycho Jul 30 '16 at 20:13
  • Sorry, no. I have not checked it after that. Will check it when current work is finished and update here. – santhoshnsscoe Aug 1 '16 at 9:34
1

This event adminhtml_block_salesrule_actions_prepareform also used into Magento 2 so please make sure events.xml is proper.

You can also refer link "How to handle events"

  • yeah there is event, but i am not able to add it via the old code which i used for 2.0.0. There is some change in the form, not able to get it out. – santhoshnsscoe Jul 21 '16 at 9:31

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.