v2.2.7: How to fix installing error if Klarna payment was removed?

Created by Jane D, Modified on Tue, 17 May, 2022 at 2:21 PM by Jane D

QUESTION:


On attempting to install your module v2.2.7 on my site M2.4.3, we got the error as below:

 

PHP Fatal error:  Uncaught Error: Class 'Klarna\Core\Model\Checkout\Orderline\AbstractLine' not found in /home/xxx/xxx/xxxxx/public/app/code/Bss/OneStepCheckout/Model/Checkout/Orderlines/GiftWrapper.php:23

 

Stack trace:

#0 /home//xxx/xxx/xxxxx/public/vendor/composer/ClassLoader.php(571): include()

#1 /home/xxx/xxx/xxxxx/public/vendor/composer/ClassLoader.php(428): Composer\Autoload\includeFile()

#2 [internal function]: Composer\Autoload\ClassLoader->loadClass()

#3 [internal function]: spl_autoload_call()

#4 /home/xxx/xxx/xxxxx/public/vendor/magento/framework/ObjectManager/Relations/Runtime.php(38): class_exists()

#5 /home/xxx/xxx/xxxxx/public/vendor/magento/framework/Interception/Config/Config.php(157): Magento\Framework\ObjectManager\Relations\Runtime->has()

#6 /home//xxx/xxx/xxxxx/public/vendor/magento/framework/Interception/Config/Config.php(15 in /home/xxx/xxx/xxxxx/ public/app/code/Bss/OneStepCheckout/Model/Checkout/Orderlines/GiftWrapper.php on line 23


Please note that we remove Klarna's payment on our site.


ANSWER:


The error happens due to the fact that our module was built to be compatible with Klarna payment. Hence, the error appears when this payment method is removed from the site.


To fix this error, please remove the file klarna.xml in app/code/Bss/OneStepCheckout/etc.

Remove the folder checkout in app/code/Bss/OneStepCheckout/Model.

And in the file app/code/OneStepCheckout/etc/di.xml, please remove the line:

<virtualType name="BssOscGiftWrapOrderlines" type="Bss\OneStepCheckout\Model\Checkout\Orderlines\GiftWrapper"/>


If you have any other questions or concerns, please feel free to contact us.


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article