Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action( 'woocommerce_email_order_meta', function( $order, $is_plain = 0, $is_admin = 0, $email = null, $preferred_vendor = 0 ) {
- global $WCFMd;
- if( ! apply_filters('wcfm_is_pref_delivery_time', true) || ! apply_filters( 'wcfm_is_allow_delivery_time', true ) ) return;
- if ( function_exists( 'is_wcfm_page' ) && is_wcfm_page() ) return;
- if ( !$email || !in_array($email->id, ['store-new-order', 'new_order'])) return;
- $wcfmd_delvery_times = $order->get_meta( '_wcfmd_delvery_times', true );
- if( empty( $wcfmd_delvery_times ) ) return;
- echo "<br />";
- echo "<h2 style='font-size: 18px; color: #17a2b8; line-height: 20px;margin-top: 6px;margin-bottom: 10px;padding: 0px;text-decoration: underline;'>" . __( 'Delivery Time(s)', 'wc-frontend-manager-delivery' ) . "</h2>";
- echo "<table width='100%' style='width:100%;'><tbody>";
- foreach ( $wcfmd_delvery_times as $vendor_id => $wcfmd_delvery_time ) {
- if( $preferred_vendor && ( $preferred_vendor != $vendor_id) ) continue;
- $store_name = wcfm_get_vendor_store_name( $vendor_id );
- $time_format = $WCFMd->wcfmd_delivery_time->get_time_format($vendor_id);
- ?>
- <tr>
- <td colspan="3" style="background-color: #eeeeee;padding: 1em 1.41575em;line-height: 1.5;font-weight:600;">
- <?php
- echo $store_name;
- ?>
- </td>
- <td colspan="5" style="background-color: #f8f8f8;padding: 1em;"><?php echo $WCFMd->wcfmd_delivery_time->format_delivery_time_checkout_field($time_format, $wcfmd_delvery_time ); ?></td>
- </tr>
- <?php
- }
- echo "</tbody></table>";
- echo "<br />";
- if($order->get_customer_note()) {
- echo "<h2 style='font-size: 18px; color: #17a2b8; line-height: 20px;margin-top: 6px;margin-bottom: 10px;padding: 0px;text-decoration: underline;'>" . __( 'Note', 'wc-frontend-manager-delivery' ) . "</h2>";
- echo "<table width='100%' style='width:100%;'><tbody>";
- echo "<tr><td>". wp_kses_post( nl2br( wptexturize( $order->get_customer_note() ) ) ) . "</td></tr>";
- echo "</tbody><table>";
- echo "<br />";
- }
- }, 10, 5 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement