문제

I followed mageworx blog to add Conditions fieldset in my custom module and I added it successfully.

https://blog.mageworx.com/2016/09/magento-2-module-with-conditions-model-fieldset/

Now, how can I apply it to order complete observer?

Would anyone please help me?

도움이 되었습니까?

해결책

I finally got an answer to apply validation to my custom rule. Below is working code if it helps to anyone.

  $rule->afterLoad();
  if ($quote->isVirtual()) {
    $address = $quote->getBillingAddress();
  } else {
    $address = $quote->getShippingAddress();
  }
  if($rule->validate($address)){
    return $rule;
  }
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 magento.stackexchange
scroll top