function eddwc_get_general_date($value, $seperator = ' - ') { $general_option = eddwc_option('product_general_date_settings'); $val = explode(',', $value); $final_date = ''; if (isset($val[0]) && !isset($val[1])) { $final_date = $val[0]; } else { if (isset($val[0]) && isset($val[1])) { if ($val[0] == $val[1]) { $final_date = $val[0]; } else { if (isset($general_option['actual_date'])) { $final_date = eddwc_get_dispatch_date($val[0]) . $seperator . eddwc_get_dispatch_date($val[1]); } else { $final_date = $val[0] . $seperator . $val[1]; } } } } return $final_date; }
public function eddwc_display_order() { $where_to_show = eddwc_option('where_to_display'); $general_options = eddwc_option('product_general_date_settings'); if (isset($general_options['range_date_checkout'])) { $cuzd_current_cart = $this->eddwc_cart_max_range(); } else { $cuzd_current_cart = eddwc_get_dispatch_date($this->eddwc_cart_max_date()); } if (isset($where_to_show['order_page'])) { if ($cuzd_current_cart != '') { echo '<tr><th>' . esc_attr(eddwc_option('order_page_title')) . '</th><td>' . $cuzd_current_cart . '</td></tr>'; } } }
public function eddwc_add_order_meta($order_id) { $general_options = eddwc_option('product_general_date_settings'); if (isset($general_options['actual_date'])) { update_post_meta($order_id, '_eddwc_order_range', $this->eddwc_cart_max_range()); } update_post_meta($order_id, '_eddwc_order_date', eddwc_get_dispatch_date($this->eddwc_cart_max_date())); update_post_meta($order_id, '_eddwc_order_format', eddwc_option('date_display_format')); }