Hi All,
When I run " php bin/magento setup:di:compile" it's stops at 1/7 process
And in the error_log:
PHP Fatal error: Class 'Magento\SalesRule\Observer\SalesOrderAfterPlaceObserver' not found in /home/xxxxxxx/public_html/app/code/Amasty/Promo/Observer/FixCouponsUsageObserver.php on line 19
Can you please help me what was the issue and how to solve this.
Hi @RizeTech
Looks like error is coming from your Amasty extension.
In Amasty extension somewhere they mention this - Magento\SalesRule\Observer\SalesOrderAfterPlaceObserver observer, but it actually not there or some how FixCouponsUsageObserver.php file is not able to get that observer class.
so that is the reason you are getting this error !!
to resolve this , either you need to disable this extension as of now
second generate a support ticket on amasty support forum they will definitely helps you in this case.
third and important thing here is i have checked in magento224 open source - there is no SalesOrderAfterPlaceObserver.php file on this location Magento\SalesRule\Observer\
so there might be a reason as well ! so either you need to change code in amasty FixCouponsUsageObserver.php file or disable it as of now !
Hope it helps !!
Hi @Manthan Dave
Thanks for your Quick Response.
I have checked disabling the "Amasty_Promo" and still the same issue and compilation stops..
Hi @RizeTech
after disabling extension have you run below commands : ?
rm -rf generated rm -rf var/generation php bin/magento setup:upgrade php bin/magento setup:di:compile php bin/magento cache:clean php bin/magento cache:flush
Yes i run those commands,
Except compilation everything works..
Hi @RizeTech
Strange !! can you please remove this extension from the app/code directory and then try ?
As its fatal error , so try to remove this extension from app/code directory
then run above mention commands again !!
Then check , it will works
Hi @RizeTech
So is it worked for you ? or you still have issue on the same ? share if the issue is solved/marked answer as solution and share how you resolved that issue so other user gets helped on the same !!
In error_log file gets the following Fatal error related to Amasty extension every time when we run the compile command:
PHP Fatal error: Class 'Magento\SalesRule\Observer\SalesOrderAfterPlaceObserver' not found in /home/xxxxxxxxxxxxx/public_html/app/code/Amasty/Promo/Observer/FixCouponsUsageObserver.php on line 19
We have checked that the above error is because of missing a file "SalesOrderAfterPlaceObserver.php" in /vendor/magento/module-sales-rule/Observer/
Why this file is missing?
For testing we have created file named "SalesOrderAfterPlaceObserver.php" in /vendor/magento/module-sales-rule/Observer/ and copied all the code from github:
https://github.com/pepe1518/magento2/blob/master/vendor/magento/module-sales-rule/Observer/SalesOrde...
Then the compilation was done successfully and also showing no errors in error_log.
But now the another issue is checkout page getting blank????
Any suggestion please......
Hi @RizeTech
Firstly - as you said for testing purpose you have created that file on the defined location, that's actually not feasible.
As i mention previously just remove/delete that Amasty_Promo extension completely from app/code directory.
then run the mention command like setup:upgrade and setup:di:compile again !
Then check it will definitely works !
Second thing as you mention you have error in checkout - check log again , is there any error log for checkout ? then post here for the same.
Hope it helps !
We have removed the Amasty_Promo from app/code and run the required commands.
Compilation runs successfully.
But the checkout page is still getting blank:
There is nothing in the error_log file.
But in system.log file:
main.CRITICAL: Unable to unserialize value. [] []