Fee ID returns null
-
there is a problem i have faced with , When Additonal service price added to cart the id returns
null
and 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
echo
andvar_dump
gives 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>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Fee ID returns null’ is closed to new replies.