Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal error on Lengow\Connector\Plugin\RulesApplier::aroundApplyRules() with Magento 2.4.4 and above #12

Open
xi-ao opened this issue Feb 23, 2023 · 3 comments

Comments

@xi-ao
Copy link

xi-ao commented Feb 23, 2023

Unfortunately, Magento has changed the signature of applyRules() between 2.4.3 and 2.4.4 which breaks your plugin:

2.4.3
https://github.com/magento/magento2/blob/4c36116dcf878e127059d9be9566a119783583f2/app/code/Magento/SalesRule/Model/RulesApplier.php#L96-L106

2.4.4
https://github.com/magento/magento2/blob/0f9a056c8d83c4f319626b3e56ec52a533999f25/app/code/Magento/SalesRule/Model/RulesApplier.php#L99-L109

$rules is now a simple array and not a Magento\SalesRule\Model\ResourceModel\Rule\Collection anymore.

@micheledalonzo
Copy link

Any update on this issue? We have too in 2.4.6...

@pedrofernando94
Copy link

Having the exact same issue after update.

@tweetyx
Copy link

tweetyx commented Jul 26, 2023

just remove array before $rules like this :

public function aroundApplyRules( RulesApplierModel $subject, Closure $proceed, AbstractItem $item, $rules, bool $skipValidation, $couponCode ) { if ($this->backendSession->getIsFromlengow()) { $rules = $this->ruleFactory->create()->addFieldToFilter('rule_id', ['eq' => 0]); } return $proceed($item, $rules, $skipValidation, $couponCode); }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants