mollie / magento2

Mollie Payments for Magento 2
https://www.mollie.com
Other
101 stars 53 forks source link

Front is broken #256

Closed franckcharpentier closed 4 years ago

franckcharpentier commented 4 years ago

We have installed v1.13.0 of your module in Magento 2.3.4 and PHP 7.2. When we activate the module no more frontend pages are accessible and we get this error : Got error 'PHP message: PHP Fatal error: Uncaught Error: Call to undefined method Magento\\Quote\\Api\\Data\\CartExtension::setMolliePaymentFee() in vendor/mollie/magento2/Plugin/Sales/Cart/AddPaymentFeeToCart.php:54\nStack trace:\n#0 vendor/mollie/magento2/Plugin/Sales/Cart/AddPaymentFeeToCart.php(29): Mollie\\Payment\\Plugin\\Sales\\Cart\\AddPaymentFeeToCart->processCart(Object(Magento\\Quote\\Model\\Quote\\Interceptor))\n#1 vendor/magento/framework/Interception/Interceptor.php(146): Mollie\\Payment\\Plugin\\Sales\\Cart\\AddPaymentFeeToCart->afterGet(Object(Magento\\Quote\\Model\\QuoteRepository\\Interceptor), Object(Magento\\Quote\\Model\\Quote\\Interceptor), '538', Array)\n#2 vendor/magento/framework/Interception/Interceptor.php(153): Magento\\Quote\\Model\\QuoteRepository\\Interceptor->Magento\\Framework\\Interception\\{closure}('538', Array)...\n'

I tried to replace:

$extensionAttributes->setMolliePaymentFee($cart->getData('mollie_payment_fee'));
$extensionAttributes->setBaseMolliePaymentFee($cart->getData('base_mollie_payment_fee'));
$extensionAttributes->setMolliePaymentFeeTax($cart->getData('mollie_payment_fee_tax'));        $extensionAttributes->setBaseMolliePaymentFeeTax($cart->getData('base_mollie_payment_fee_tax'));

By:

$extensionAttributes->setData('mollie_payment_fee',$cart->getData('mollie_payment_fee'));
$extensionAttributes->setData('base_mollie_payment_fee',$cart->getData('base_mollie_payment_fee'));
$extensionAttributes->setData('mollie_payment_fee_tax',$cart->getData('mollie_payment_fee_tax'));
$extensionAttributes->setData('base_mollie_payment_fee_tax',$cart->getData('base_mollie_payment_fee_tax'));

Thus, the pages are displayed again.

But adding to the shopping cart no longer works.

Frank-Magmodules commented 4 years ago

Hi @franckcharpentier ,

Thank you for opening this issue, can you please confirm that you have executed the command; setup:di:compile after the update?

If you are and still have this issue, please contact us through our contact form so we can exchange more details about this and help you out.

Frank

franckcharpentier commented 4 years ago

Yes, we use https://github.com/davidalger/capistrano-magento2 for our deployments.

Frank-Magmodules commented 4 years ago

HI @franckcharpentier , strange, that should be sufficient. Can you please contact us through our contact form so we can exchange the server/store details so we can help you out?

Thanks!

franckcharpentier commented 4 years ago

it seems to be a server-side issue

Thanks