Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Varun Sridharan

    (@varunms)

    hi,

    can i know where did you added the shortcode ?

    Thread Starter Robbie_berns

    (@robbernsteinzgmailcom)

    Thanks for your quick response, Varun.

    I am still building the site https://jenna.bernstein.nz/, and the shortcode is inserted at the bottom

    Hi there,

    I found a fix for this:-

    In the file woocommerce-quick-donation.php:
    Find the function wc_qd_form and add the following 2 lines (or feel free to just replace with the updated function below).

    1. Add ob_start(); at the beginning to enable output buffering and not echo the form contents to the screen, but instead to an output buffer.
    2. Add return ob_get_clean(); at the end of the function to get and return the buffer contents.

    Full code below:

    public function wc_qd_form(){
    
    		ob_start();
    		global $woocommerce; 
    
    		$donate = isset($woocommerce->session->jc_donation) ? floatval($woocommerce->session->jc_donation) : 0;
    		if(!$this->donation_exsits()){
    			unset($woocommerce->session->jc_donation);
    			unset($woocommerce->session->projects);
    		}
    
    		// $donate = jc_round_donation($woocommerce->cart->total );
    		$show_form_donatio_exist = get_option('wc_quick_donation_hide_form');
    		if($this->donation_exsits() && $show_form_donatio_exist){
    			$this->_load_donation_form();
    		}else if(! $this->donation_exsits()){
    			$this->_load_donation_form();
    
    		}
    
    		return ob_get_clean();
    
    	}
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Shortode position’ is closed to new replies.