• heraldtech

    (@heraldtech)


    Hello Everyone,

    I am using wprentals theme and i would like modificate a pice of code which is keeping the balance of a room when is booked. This function it triggers an email notification reminding customers that they have a balance to pay. All my clients are paying full amount so this email is never triggered but i want this email to be triggered because i want to send them an email reminder with tripping details. I have contact the theme developers and they told me it needs custom codes so here i am. The thing i want to do is on the below function code te change the parameters so the email it can be sent even when the paid value is equal to the price of the room. I am attaching the code below:

    if( !function_exists('wpestate_full_invoice_payment_reminder_function') ):
    function wpestate_full_invoice_payment_reminder_function(){
    $args = array(
    'cache_results' => false,
    'update_post_meta_cache' => false,
    'update_post_term_cache' => false,
    'post_type' => 'wpestate_booking',
    'post_status' => 'publish',
    'posts_per_page' => -1,
    'order' => 'DESC',
    'meta_query' => array(

                            array(
                                'key'       => 'booking_status',
                                'value'     => 'confirmed',
                                'compare'   => '='
                            ),
    
                            array(
                                'key'       => 'booking_status_full',
                                'value'     => 'confirmed',
                                'compare'   => '!='
                            ),
    
    
                           array(
                                'key'       => 'total_price',
                                'type'      =>  'numeric',
                                'meta_value_num'     => '0',
                                'compare'   => '>'
                            ),
    
    
            )
    );

    I think somthing the last array compare should be ”=” and not greater but i am not sure.

    I would appreciate if you could assist.

    Thank you,

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    If your theme includes if( !function_exists(... before its function declaration, this means the function is “pluggable” and one can override the default function with a customized version. This may be done from a custom plugin since plugins load before the theme.

    If this function is only normally triggered when there’s a balance due, you’d need to identify some other event that would call the function for you. IMO you will likely be better off writing a completely bespoke function to send an appropriate email once a trigger event occurs.

    These forums are not for getting free programming services, though help is available for those doing their own coding. If writing custom code is not part of your skill set, I recommend seeking professional help through sites such as jobs.wordpress.net .

Viewing 1 replies (of 1 total)

The topic ‘Custom code in php worpdress’ is closed to new replies.