Created
May 1, 2023 13:25
-
-
Save clifgriffin/55647fc417b3da24fb4b1159b5987ec7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function custom_output_pickup_instructions( \WC_Order $order ) { | |
$location = $order->get_meta( '_cfw_pickup_location', true ); | |
if ( empty( $location ) ) { | |
return; | |
} | |
$raw_address = get_post_meta( $location, 'cfw_pl_address', true ); | |
/** | |
* Whether to link the local pickup address to Google Maps for directions | |
* | |
* @since 7.3.2 | |
* @param bool $link Whether to link the local pickup address to Google Maps | |
*/ | |
if ( apply_filters( 'cfw_local_pickup_use_google_address_link', true ) ) { | |
$address = sprintf( '<a href="https://www.google.com/maps/dir/?api=1&destination=%s">%s</a>', rawurlencode( $raw_address ), wpautop( $raw_address ) ); | |
} else { | |
$address = wpautop( $raw_address ); | |
} | |
?> | |
<h3> | |
<?php | |
/** | |
* Filter the pickup instructions | |
* | |
* @since 7.3.2 | |
* @param string $instructions The pickup instructions | |
* @param WC_Order $order The order | |
*/ | |
echo esc_html( apply_filters( 'cfw_order_updates_heading', __( 'Pickup instructions', 'checkout-wc' ), $order ) ); | |
?> | |
</h3> | |
<?php | |
/** | |
* Filters pickup instructions text | |
* | |
* @since 7.3.0 | |
* | |
* @param string $pickup_instructions_text Thank you page order updates text | |
*/ | |
echo wp_kses_post( wpautop( apply_filters( 'cfw_pickup_instructions_text', get_post_meta( $location, 'cfw_pl_instructions', true ), $order ) ) ); | |
?> | |
<h4> | |
<?php cfw_e( 'Address', 'woocommerce' ); ?> | |
</h4> | |
<?php | |
echo wp_kses_post( $address ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment