Title: Function submit_form() returns false
Last modified: October 13, 2021

---

# Function submit_form() returns false

 *  Resolved [hexist](https://wordpress.org/support/users/hexist/)
 * (@hexist)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/function-submit_form-returns-false/)
 * Hello,
    Everything works great except, after submitting form it shows “There 
   are no product added in the enquiry cart” instead of “Enquiry submitted”. I found
   function submit_form() that returns false in my case, so function saveEnquiry()
   also must give 0, but I can see saved enquiries in “Enquiries” tab and in emails.
   Please help. Thank You.

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [PI Web Solution](https://wordpress.org/support/users/rajeshsingh520/)
 * (@rajeshsingh520)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/function-submit_form-returns-false/#post-14968335)
 * Hi,
 * Are you able to receive the email and see the saved enquiry in backend ??
 *  Thread Starter [hexist](https://wordpress.org/support/users/hexist/)
 * (@hexist)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/function-submit_form-returns-false/#post-14970491)
 * Yes, everything works as it should. I receive both emails (as admin and as client)
   and all enquiries are saved in backend. I tried var_dump to see what gives what,
   and inside “if( count($this->errors) <= 0 && !empty($_POST))” variable $save 
   gives bool(false), $email gives NULL and $clear_product gives NULL, but everything
   is sent on email and saved in backend.
    Thank You for quick response.
    -  This reply was modified 4 years, 7 months ago by [hexist](https://wordpress.org/support/users/hexist/).
 *  Plugin Author [PI Web Solution](https://wordpress.org/support/users/rajeshsingh520/)
 * (@rajeshsingh520)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/function-submit_form-returns-false/#post-14972132)
 * Hi,
 *     ```
       function submit_form(){
               if( count($this->errors) <= 0 && !empty($_POST)){
                   $save = $this->saveEnquiry();  // you are saying this comes false, but if this is false then the remaining function of send email and clear session will not run so you should not receive any email as well but you are receving email 
                   if($save !== false){
                       $email = $this->sendEmail($save);
                       $clear_product = $this->clearSession();
                       return true;
                   }
               }
               return false;
           }
       ```
   
 * if $save comes out to be false then it will not trigger the other function of
   sendEmail() and clearSession() but you are getting email
 *  Thread Starter [hexist](https://wordpress.org/support/users/hexist/)
 * (@hexist)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/function-submit_form-returns-false/#post-14994096)
 * I tried changing main theme to default wp, and same result.
    PLease tell me how
   to remove any data from database, so I can download your plugin again as new.
   Cause on virtual server it works perfect (no plugins, only WC). All I find I 
   will report to you. Thank you
    -  This reply was modified 4 years, 7 months ago by [hexist](https://wordpress.org/support/users/hexist/).
 *  Plugin Author [PI Web Solution](https://wordpress.org/support/users/rajeshsingh520/)
 * (@rajeshsingh520)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/function-submit_form-returns-false/#post-14994426)
 * Sorry there is no option of resetting the plugin, which PHP version you are using
   on the live site as it worked on your test site
 * create a copy of the site on virtual server and go on activating other plugin
   one by one and keep checking then you may find the conflict causing plugin
 *  Thread Starter [hexist](https://wordpress.org/support/users/hexist/)
 * (@hexist)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/function-submit_form-returns-false/#post-15001708)
 * I found conflicting plugin: All in one SEO.
    Now your plugin works perfectly (
   after submitting form, the “Enquiry submitted” message shows up). THANK YOU SO
   MUCH!

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Function submit_form() returns false’ is closed to new replies.

 * ![](https://ps.w.org/enquiry-quotation-for-woocommerce/assets/icon.svg?rev=3327961)
 * [PiWeb Product Enquiry or product catalog for WooCommerce](https://wordpress.org/plugins/enquiry-quotation-for-woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/enquiry-quotation-for-woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/enquiry-quotation-for-woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/enquiry-quotation-for-woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/enquiry-quotation-for-woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/enquiry-quotation-for-woocommerce/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [hexist](https://wordpress.org/support/users/hexist/)
 * Last activity: [4 years, 7 months ago](https://wordpress.org/support/topic/function-submit_form-returns-false/#post-15001708)
 * Status: resolved