• Resolved TheXrion

    (@negarehgfx)


    Im using EDD_Fees class for adding extra fee to products, Iv’e used this class before and it works like charm but now i can’t figure it out why amount is 0 (it seems returning null)
    Here is my full class code

    
    	$feeid_gen = date("Ydhis") . $download_id;
    			function cencored_function() {
    			// Additional Services Price START here
    					$cencored_fee = array(
    			'amount'      => $int_val,
    			'label'       => 'hbbl',	
    			'id'          => $feeid_gen,	
    			'no_tax'      => false,
    			'type'        => 'fee',
    			'download_id' => $download_id,
    			'price_id'    => NULL	
    				);
    			EDD()->fees->add_fee( $cencored_fee);
    			/// Additional Services Price END here
    			}
    			add_action( 'init', 'cencored_function' );
    			cencored_function(); // Runned
    			
Viewing 1 replies (of 1 total)
  • Thread Starter TheXrion

    (@negarehgfx)

    Ouh I didn’t attention to puting cencored_function() in scope and that was it.

    • This reply was modified 4 years, 6 months ago by TheXrion.
Viewing 1 replies (of 1 total)
  • The topic ‘Cant add extra amount with EDD_Fees class’ is closed to new replies.