> $locations */ public static function render_checkout_rate_markup( array $locations, int $selected_location_id, bool $is_selected_rate ): string { if ( [] === $locations ) { return ''; } ob_start(); ?>
1 ) : ?>

$location ) : ?> 0 && $location_id === $selected_location_id; ?>
1 ) : ?>
$location */ public static function render_order_summary( array $location ): string { ob_start(); ?>

$location */ public static function render_email_summary( array $location, bool $plain_text = false ): string { $location_name = trim( (string) ( $location['locationName'] ?? '' ) ); $address_lines = self::get_address_lines( $location ); $estimate = trim( (string) ( $location['estimatePickupTimeText'] ?? '' ) ); $instructions = trim( (string) ( $location['instructionText'] ?? '' ) ); if ( $plain_text ) { $lines = [ __( 'Pickup location', 'ips-order-cart' ) . ':' ]; if ( '' !== $location_name ) { $lines[] = $location_name; } foreach ( $address_lines as $address_line ) { $lines[] = $address_line; } if ( ! empty( $location['estimatePickupTimeActive'] ) && '' !== $estimate ) { $lines[] = __( 'Estimated pickup time:', 'ips-order-cart' ) . ' ' . $estimate; } if ( ! empty( $location['instructionsActive'] ) && '' !== $instructions ) { $lines[] = __( 'Pickup instructions:', 'ips-order-cart' ) . ' ' . preg_replace( "/\\s+/", ' ', $instructions ); } return implode( "\n", $lines ) . "\n"; } ob_start(); ?>

$location */ private static function render_location_summary( array $location ): string { $lines = self::get_address_lines( $location ); $location_name = trim( (string) ( $location['locationName'] ?? '' ) ); ob_start(); ?>
0 && ! empty( $location['addressActive'] ) ) : ?>

$location * @return array */ private static function get_address_lines( array $location ): array { $lines = preg_split( "/\\r\\n|\\n|\\r/", (string) ( $location['addressText'] ?? '' ) ) ?: []; return array_values( array_filter( array_map( static function ( $line ): string { return trim( (string) $line ); }, $lines ), static function ( string $line ): bool { return '' !== $line; } ) ); } }