| 1 |
<?php |
| 2 |
/** |
| 3 |
* Delivery info page template |
| 4 |
* |
| 5 |
* @package Welcart |
| 6 |
*/ |
| 7 |
|
| 8 |
global $usces_entries, $usces_carts; |
| 9 |
|
| 10 |
usces_get_entries(); |
| 11 |
usces_get_carts(); |
| 12 |
|
| 13 |
$html = ''; |
| 14 |
|
| 15 |
$html .= '<div id="delivery-info"> |
| 16 |
|
| 17 |
<div class="usccart_navi"> |
| 18 |
<ol class="ucart"> |
| 19 |
<li class="ucart usccart">' . esc_html__( '1.Cart', 'usces' ) . '</li> |
| 20 |
<li class="ucart usccustomer">' . esc_html__( '2.Customer Info', 'usces' ) . '</li> |
| 21 |
<li class="ucart uscdelivery usccart_delivery">' . esc_html__( '3.Deli. & Pay.', 'usces' ) . '</li> |
| 22 |
<li class="ucart uscconfirm">' . esc_html__( '4.Confirm', 'usces' ) . '</li> |
| 23 |
</ol> |
| 24 |
</div>'; |
| 25 |
|
| 26 |
$html .= '<div class="header_explanation">'; |
| 27 |
$header = ''; |
| 28 |
$html .= apply_filters( 'usces_filter_delivery_page_header', $header ); |
| 29 |
$html .= '</div>'; |
| 30 |
|
| 31 |
$html .= '<div class="error_message">' . $this->error_message . '</div>'; |
| 32 |
|
| 33 |
$html .= '<form action="' . esc_url( USCES_CART_URL ) . '" method="post">'; |
| 34 |
|
| 35 |
$html .= '<table class="customer_form"> |
| 36 |
<tr> |
| 37 |
<th rowspan="2" scope="row">' . esc_html__( 'shipping address', 'usces' ) . '</th> |
| 38 |
<td><input name="delivery[delivery_flag]" type="radio" id="delivery_flag1" onclick="document.getElementById(\'delivery_table\').style.display = \'none\';" value="0"'; |
| 39 |
if ( 0 === (int) $usces_entries['delivery']['delivery_flag'] ) { |
| 40 |
$html .= ' checked="checked"'; |
| 41 |
} |
| 42 |
$html .= ' onKeyDown="if (event.keyCode == 13) {return false;}" /> <label for="delivery_flag1">' . esc_html__( 'same as customer information', 'usces' ) . '</label></td> |
| 43 |
</tr> |
| 44 |
<tr> |
| 45 |
<td><input name="delivery[delivery_flag]" id="delivery_flag2" onclick="document.getElementById(\'delivery_table\').style.display = \'table\'" type="radio" value="1"'; |
| 46 |
if ( 1 === (int) $usces_entries['delivery']['delivery_flag'] ) { |
| 47 |
$html .= ' checked="checked"'; |
| 48 |
} |
| 49 |
$html .= ' onKeyDown="if (event.keyCode == 13) {return false;}" /> <label for="delivery_flag2">' . esc_html__( 'Chose another shipping address.', 'usces' ) . '</label></td> |
| 50 |
</tr> |
| 51 |
</table>'; |
| 52 |
$html = apply_filters( 'usces_filter_delivery_flag', $html ); |
| 53 |
$html .= '<table class="customer_form" id="delivery_table">'; |
| 54 |
|
| 55 |
$html .= uesces_addressform( 'delivery', $usces_entries ); |
| 56 |
|
| 57 |
$html .= '</table>'; |
| 58 |
$html .= '<table class="customer_form" id="time">'; |
| 59 |
$cart_delivery_field = '<tr> |
| 60 |
<th scope="row">' . esc_html__( 'shipping option', 'usces' ) . '</th> |
| 61 |
<td colspan="2">' . usces_the_delivery_method( $usces_entries['order']['delivery_method'], 'return' ) . '</td> |
| 62 |
</tr> |
| 63 |
<tr> |
| 64 |
<th scope="row">' . esc_html__( 'Delivery date', 'usces' ) . '</th> |
| 65 |
<td colspan="2">' . usces_the_delivery_date( $usces_entries['order']['delivery_date'], 'return' ) . '</td> |
| 66 |
</tr> |
| 67 |
<tr> |
| 68 |
<th scope="row">' . esc_html__( 'Delivery Time', 'usces' ) . '</th> |
| 69 |
<td colspan="2">' . usces_the_delivery_time( $usces_entries['order']['delivery_time'], 'return' ) . '</td> |
| 70 |
</tr>'; |
| 71 |
$cart_delivery_field .= '<tr> |
| 72 |
<th scope="row"><em>' . esc_html__( '*', 'usces' ) . '</em>' . __( 'payment method', 'usces' ) . '</th> |
| 73 |
<td colspan="2">' . usces_the_payment_method( $usces_entries['order']['payment_name'], 'return' ) . '</td> |
| 74 |
</tr>'; |
| 75 |
$html .= apply_filters( 'usces_filter_cart_delivery_field', $cart_delivery_field, $usces_entries ); |
| 76 |
$html .= '</table>'; |
| 77 |
|
| 78 |
require USCES_PLUGIN_DIR . '/includes/delivery_secure_form.php'; |
| 79 |
|
| 80 |
$meta = usces_has_custom_field_meta( 'order' ); |
| 81 |
if ( ! empty( $meta ) && is_array( $meta ) ) { |
| 82 |
$html .= ' |
| 83 |
<table class="customer_form" id="custom_order">'; |
| 84 |
|
| 85 |
$html .= usces_custom_field_input( $usces_entries, 'order', '', 'return' ); |
| 86 |
|
| 87 |
$html .= ' |
| 88 |
</table>'; |
| 89 |
} |
| 90 |
|
| 91 |
$entry_order_note = empty( $usces_entries['order']['note'] ) ? apply_filters( 'usces_filter_default_order_note', null ) : $usces_entries['order']['note']; |
| 92 |
$html .= '<table class="customer_form" id="notes_table"> |
| 93 |
<tr> |
| 94 |
<th scope="row">' . esc_html__( 'Notes', 'usces' ) . '</th> |
| 95 |
<td colspan="2"><textarea name="offer[note]" id="note" class="notes">' . esc_html( $entry_order_note ) . '</textarea></td> |
| 96 |
</tr> |
| 97 |
</table> |
| 98 |
|
| 99 |
<div class="send"><input name="offer[cus_id]" type="hidden" value="" /> |
| 100 |
<input name="backCustomer" type="submit" class="back_to_customer_button" value="' . esc_html__( 'Back', 'usces' ) . '"' . apply_filters( 'usces_filter_deliveryinfo_prebutton', null ) . ' /> |
| 101 |
<input name="confirm" type="submit" class="to_confirm_button" value="' . esc_html__( ' Next ', 'usces' ) . '"' . apply_filters( 'usces_filter_deliveryinfo_nextbutton', null ) . ' /></div> |
| 102 |
</form>'; |
| 103 |
|
| 104 |
$html .= '<div class="footer_explanation">'; |
| 105 |
$footer = ''; |
| 106 |
$html .= apply_filters( 'usces_filter_delivery_page_footer', $footer ); |
| 107 |
$html .= '</div>'; |
| 108 |
|
| 109 |
$html .= '</div>'; |
| 110 |
|