Fatal error: Call to a member function add_to_cart() on null

Home Forums WPLMS AddOns WPLMS WooCommerce Fatal error: Call to a member function add_to_cart() on null

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #80004
    musicale
    Spectator
    Hi, I can't understand when and when but from few days ago I have a big problem with theme and woocommerce appointments plugin. At the beginner everythings work fine. Now when a customer  try to book a lesson the site redirect him to home page with no booking actions. I tried to reserve from back end and I get back this error: <b style="color: #000000; font-family: Times; font-size: medium;">Fatal error</b><span style="color: #000000; font-family: Times; font-size: medium;">: Call to a member function add_to_cart() on null in </span><b style="color: #000000; font-family: Times; font-size: medium;">/home/cantaf5/staging/2/wp-content/plugins/woocommerce/includes/class-wc-form-handler.php</b><span style="color: #000000; font-family: Times; font-size: medium;"> on line </span><b style="color: #000000; font-family: Times; font-size: medium;">746</b> So I tried to do that:
    • check plugin udate
    • deactivate all plugin
    • change setup in all possible solution
    • change themes
    All this problem disappear when I set another theme. Please can you help me to resolve this problem? thank you Alessandra  
    #80005
    musicale
    Spectator
    sorry the error is: Call to a member function add_to_cart() on null in /home/cantaf5/staging/2/wp-content/plugins/woocommerce/includes/class-wc-form-handler.php on line 746
    #80185
    H.K. Latiyan
    Participant
    This is a very very rare issue, infact this is the first time someone has reported this. Also note that the error is displayed in the core file of WooCommerce plugin which indicates the possibility that the woocommerce plugin might be corrupt or some files unreadable. Suggestions to fix :  1. Go to WP admin - Plugins, deactivate and delete the WooCommerce plugin. To remove it via FTP, simply go to wp-content/plugins folder and remove the folder. 2. Re-install the WooCommerce plugin from WP Admin - Plugins area. 3. Optimise your database, try installing this plugin : https://wordpress.org/plugins/wp-optimize/ and optimise your database. ----  
    #81014
    musicale
    Spectator
    Ok! after a lot of test I found where the problem was: If you enable "show woocommerce profile" in LMS setup some plugin that use woocommerce can't access to it any more. When I deselected this option all works fine. Now ... there is a way to show customers woocommerce profile on them personal area? Thanks roberto  
    #81400
    H.K. Latiyan
    Participant
    Thanks for the information. I am adding this to our issue log and will check this issue.
    #180634
    info2grow
    Spectator
    We are also having the same issue with WooCommerce Bookings.  I can confirm that musicale's solutions works but we would prefer to have this WPLMS feature checked. Any updates on this?   Thanks, Lawrence
    #180801
    Diana
    Participant
    @info2grow After activating that setting from LMS > Settings You are also getting the same error in the profile area?
Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Fatal error: Call to a member function add_to_cart() on null’ is closed to new replies.