Payment – Extra Cost

function lsdc_pro_extra_payment_code( $extras ){
    if( empty( $extras ) ) $extras = array(); // Return to Array if Empty

    $transient = null;
    if( isset($_COOKIE["lsdcommerce_payment"]) ){ // Payment Key Empty
        $token_browser = $_COOKIE["lsdcommerce_payment"];
        $transient = get_transient( 'lsdc_key_' . $token_browser ); // Getting Trnasient by Browser token
    }
    // Merging into One
    return array_merge( $extras, $transient );
}
add_filter( 'lsdcommerce_payment_extras', 'lsdc_pro_extra_payment_code' );

you can add payment code with this.

Was this page helpful?

Leave a Reply

Your email address will not be published. Required fields are marked *