• there is a problem i have faced with , When Additonal service price added to cart the id returns nulland i cant remove it from checkout with using remove_fee() function.

    So i have tried to add Fee id manually (tried both character and integer like : 123 or abc ) for check if it get fix but fee doesn’t even added to checkout after using fee id in manually way!

    So question is why Fee ID returns null after echoand var_dumpgives boolan(false)?

    This is my Whole function :
    `

    function myfunction() {
    
    			$feeTitle = 'Example Additonal Service';
    			$feeid_gen = chr(rand(97,122)) . chr(rand(65,90)) . chr(rand(97,122)) . chr(rand(65,90)) . chr(rand(97,122)) . chr(rand(65,90)) . chr(rand(97,122)) . chr(rand(97,122)) . chr(rand(65,90));
    			
    
    			// Check If This Product has Additonal Price by checking is>0
    			// If yes The function will run
    			$gt_metakey = get_post_meta( get_the_ID(), 'my_meta_key');
    			$int_val = (int)$gt_metakey[0];
    
    			// Additional Services Price START here
    					$fee = array(
    			'amount'      => $int_val,	// Fee Amount
    			'label'       => $feeTitle,	// Fee Label
    			'id'          => $feeid_gen,	// Fee ID
    			'no_tax'      => false,	// If tax on Fee
    			'type'        => 'fee',	// Type
    			'download_id' => $download_id,	// Product ID
    			'price_id'    => NULL	// On Specific Product Price ID
    				);
    			EDD()->fees->add_fee( $fee );
    			/// Additional Services Price END here
    				}
    				add_action( 'init', 'myfunction' );
    <code></code><code></code>
    • This topic was modified 4 years, 6 months ago by TheXrion.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter TheXrion

    (@negarehgfx)

    WHAT A AWESOME SUPPORT!

    Hi @negarehgfx

    Sorry for the inconvenience. Due to the recent situation around the world the support is little bit slower.

    Can you please tell me what exactly you are printing?

    add_fee function returns the array of Fee on success.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Fee ID returns null’ is closed to new replies.