Placeholder for Your City

Hello,

It seems there is no placeholder/code for “Your city” to add in the Confirmation email Message. Maybe i’m missing something, please help.

  • Vaughan
    • Support/SLS MockingJay

    Hi @pixelone

    thanks for posting.

    Does the ADDRESS placeholder not cover it?

    If not, then I think this would need to be custom coded. you might be able to find it in the plugin functions & add the city to it there.

    in appointments.php

    /**
    * Replace placeholders with real values for email subject and content
    */
    function _replace( $text, $user, $service, $worker, $datetime, $price, $deposit, $phone, $note, $address, $email ) {
    return str_replace(
    array( "SITE_NAME", "CLIENT", "SERVICE_PROVIDER", "SERVICE", "DATE_TIME", "PRICE", "DEPOSIT", "PHONE", "NOTE", "ADDRESS", "EMAIL" ),
    array( wp_specialchars_decode(get_option('blogname'), ENT_QUOTES), $user, $worker, $service, mysql2date( $this->datetime_format, $datetime ), $price, $deposit, $phone, $note, $address, $email ),
    $text
    );
    }

    if you can find the $var for city, you could add it to the list.

    hope this helps, if you require any further assistance, please let us know.

    thanks.

  • Vaughan
    • Support/SLS MockingJay

    hiya

    you would add it to the function i posted above in appointments.php

    of course you’d need to find out what the $var is for city.

    like $address = ADDRESS, $phone = PHONE make sure you place them in the correct order.

    just search until you find where $address is defined, then look for the 1 that reads for city, it might be $city or $your_city. just do a search for city.

    hope this helps.

    example >

    /**
    * Replace placeholders with real values for email subject and content
    */
    function _replace( $text, $user, $service, $worker, $datetime, $price, $deposit, $phone, $note, $address, $email, $city ) {
    return str_replace(
    array( "SITE_NAME", "CLIENT", "SERVICE_PROVIDER", "SERVICE", "DATE_TIME", "PRICE", "DEPOSIT", "PHONE", "NOTE", "ADDRESS", "EMAIL", "CITY" ),
    array( wp_specialchars_decode(get_option('blogname'), ENT_QUOTES), $user, $worker, $service, mysql2date( $this->datetime_format, $datetime ), $price, $deposit, $phone, $note, $address, $email, $city ),
    $text
    );
    }

  • Vaughan
    • Support/SLS MockingJay

    hiya

    sorry for the delay

    Can you try this.

    unpack the zip file attached, then upload the file appointments.php to your wp-content/plugins/appointments folder

    overwriting existing file.

    make sure you are using appointments 1.2.5.1 (latest version). before you replace it

    let us know if this works.

    please be aware though, if it does work, these changes will be lost the next time you update the plugin.

    I will ask Hakan if he can include the changes in a future version if it works ok.

    hope this helps

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.