How the cart price rule is applied in custom module?
문제
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;
}
제휴하지 않습니다 magento.stackexchange