1

I'm getting this error when i try to go to my shopping cart:

Fatal error: Uncaught Error: Call to undefined method Cart::hasCart() in /****/****.****/public_html/vqmod/vqcache/vq2-catalog_controller_checkout_checkout.php:12 Stack trace: #0 /****/****.****/public_html/vqmod/vqcache/vq2-system_modification_system_engine_action.php(65): ControllerCheckoutCheckout->index(Array) #1 /****/****.****/public_html/system/engine/front.php(34): Action->execute(Object(Registry)) #2 /****/****.****/public_html/system/engine/front.php(29): Front->execute(Object(Action)) #3 /****/****.****/public_html/index.php(260): Front->dispatch(Object(Action), Object(Action)) #4 {main} thrown in /****/****.****/public_html/vqmod/vqcache/vq2-catalog_controller_checkout_checkout.php on line 12

I have amended the URL for privacy reason, so don't mind about its syntax please.

How can I solve this error?

BiOS
  • 2,282
  • 3
  • 10
  • 24
mremregok
  • 23
  • 5
  • Does this answer your question? ["Notice: Undefined variable", "Notice: Undefined index", and "Notice: Undefined offset" using PHP](https://stackoverflow.com/questions/4261133/notice-undefined-variable-notice-undefined-index-and-notice-undefined) – Syscall Feb 28 '21 at 07:41

1 Answers1

1

You did not create the relationship in your model class Cart. Check the class Cart and see if you have a function hasCart(). The access modifier must be public.

public function hasCart() {
    // the relationship
}
Aaron
  • 138
  • 1
  • 7