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

Checkout not possible because of fatal error: Call to a member function getCarrierCode() on boolean #9

Closed
NoorulBhoelai opened this issue Aug 16, 2018 · 3 comments
Labels

Comments

@NoorulBhoelai
Copy link

NoorulBhoelai commented Aug 16, 2018

I am testing the checkout but we are getting a fatal error in Magento version 2.2.3.

Can you please take a look? Even when the shipping method is disabled, the checkout does not work. The shop keeps loading while doing a checkout. Not being able to checkout.

[16-Aug-2018 15:07:26 UTC] PHP Fatal error: Uncaught Error: Call to a member function getCarrierCode() on boolean in .../vendor/smile/module-store-delivery/Observer/QuoteSubmit.php:64
Stack trace:
#0 .../vendor/magento/framework/Event/Invoker/InvokerDefault.php(72): Smile\StoreDelivery\Observer\QuoteSubmit->execute(Object(Magento\Framework\Event\Observer))
#1 .../vendor/magento/framework/Event/Invoker/InvokerDefault.php(60): Magento\Framework\Event\Invoker\InvokerDefault->_callObserverMethod(Object(Smile\StoreDelivery\Observer\QuoteSubmit), Object(Magento\Framework\Event\Observer))
#2 .../vendor/magento/framework/Event/Manager.php(66): Magento\Framework\Event\Invoker\InvokerDefault->dispatch(Array, Object(Magento\Framework\Event\Observer))
#3 .../vendor/smile/module-store-delivery/Observer/QuoteSubmit.php on line 64

@delyriand
Copy link

Hi @NoorulBhoelai ,

Thank you for report this issue.
Do you have the same error when "store delivery" shipping method is enabled?

But, i confirm when this method is disabled, i have the error. We will seek to fix this problem.

Best regard

@delyriand delyriand added the bug label Aug 27, 2018
@NoorulBhoelai
Copy link
Author

When the "Store Delivery" shipping method is enabled we don't have the error.

Kind Regard

@romainruaud
Copy link
Contributor

It's my mistake :)

line 64 is :

$carrier    = $this->carrierFactory->getIfActive($methodCode);

And then we do things on $carrier directly while it could be equal to false if the carrier is not active.

Should be easy to fix.

@Fdec Fdec closed this as completed in 7f40c91 Sep 4, 2018
Fdec added a commit that referenced this issue Sep 4, 2018
Fix #9 - Fix observer when store delivery method is disabled
marcatos added a commit to Hevelop/magento2-module-store-delivery that referenced this issue Nov 23, 2018
…livery

* 'master' of github.com:Smile-SA/magento2-module-store-delivery:
  Create README.md
  Fix Smile-SA#9 - Fix observer when store delivery method is disabled
  Add issue template
  Rename Carrier Model to prevent magento failure when exploding on underscores.
  Fix Temando erratic observer.
  Remove page layout update
  Remove PHP dependency. Let Magento handle it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants