| 1 |
<?php |
| 2 |
/** |
| 3 |
* Confirm page template |
| 4 |
* |
| 5 |
* @package Welcart |
| 6 |
*/ |
| 7 |
|
| 8 |
global $usces_entries, $usces_carts, $usces_members; |
| 9 |
|
| 10 |
usces_get_members(); |
| 11 |
usces_get_entries(); |
| 12 |
usces_get_carts(); |
| 13 |
|
| 14 |
$html = '<div id="info-confirm"> |
| 15 |
|
| 16 |
<div class="usccart_navi"> |
| 17 |
<ol class="ucart"> |
| 18 |
<li class="ucart usccart">' . esc_html__( '1.Cart', 'usces' ) . '</li> |
| 19 |
<li class="ucart usccustomer">' . esc_html__( '2.Customer Info', 'usces' ) . '</li> |
| 20 |
<li class="ucart uscdelivery">' . esc_html__( '3.Deli. & Pay.', 'usces' ) . '</li> |
| 21 |
<li class="ucart uscconfirm usccart_confirm">' . esc_html__( '4.Confirm', 'usces' ) . '</li> |
| 22 |
</ol> |
| 23 |
</div>'; |
| 24 |
|
| 25 |
$html .= '<div class="header_explanation">'; |
| 26 |
$header = ''; |
| 27 |
$html .= apply_filters( 'usces_filter_confirm_page_header', $header ); |
| 28 |
$html .= '</div>'; |
| 29 |
$html .= '<div class="error_message">' . $this->error_message . '</div>'; |
| 30 |
|
| 31 |
$confirm_table_head = '<div id="cart"> |
| 32 |
<div class="currency_code">' . esc_html__( 'Currency', 'usces' ) . ' : ' . __( usces_crcode( 'return' ), 'usces') . '</div> |
| 33 |
<table cellspacing="0" id="cart_table"> |
| 34 |
<thead> |
| 35 |
<tr> |
| 36 |
<th scope="row" class="num">' . esc_html__( 'No.', 'usces' ) . '</th> |
| 37 |
<th class="thumbnail"> </th> |
| 38 |
<th class="productname">' . esc_html__( 'Items', 'usces' ) . '</th> |
| 39 |
<th class="unitprice">' . esc_html__( 'Unit price', 'usces' ) . '</th> |
| 40 |
<th class="quantity">' . esc_html__( 'Quantity', 'usces' ) . '</th> |
| 41 |
<th class="subtotal">' . esc_html__( 'Amount', 'usces' ) . '</th> |
| 42 |
<th class="action"></th> |
| 43 |
</tr> |
| 44 |
</thead> |
| 45 |
<tbody>'; |
| 46 |
$html .= apply_filters( 'usces_filter_confirm_table_head', $confirm_table_head ); |
| 47 |
|
| 48 |
$member = $this->get_member(); |
| 49 |
|
| 50 |
$html .= usces_get_confirm_rows( 'return' ); |
| 51 |
|
| 52 |
$confirm_table_footer = '</tbody> |
| 53 |
<tfoot> |
| 54 |
<tr class="total_items_price"> |
| 55 |
<th class="num"> </th> |
| 56 |
<th class="thumbnail"> </th> |
| 57 |
<th colspan="3" class="aright totallabel">' . esc_html__( 'total items', 'usces' ) . '</th> |
| 58 |
<th class="aright totalend">' . usces_crform( $usces_entries['order']['total_items_price'], true, false, 'return' ) . '</th> |
| 59 |
<th class="action"> </th> |
| 60 |
</tr>'; |
| 61 |
if ( ! empty( $usces_entries['order']['discount'] ) ) { |
| 62 |
$confirm_table_footer .= '<tr class="discount"> |
| 63 |
<td class="num"> </td> |
| 64 |
<td class="thumbnail"> </td> |
| 65 |
<td colspan="3" class="aright totallabel">' . apply_filters( 'usces_confirm_discount_label', esc_html__( 'Campaign discount', 'usces' ) ) . '</td> |
| 66 |
<td class="aright totalend" style="color:#FF0000">' . usces_crform( $usces_entries['order']['discount'], true, false, 'return' ) . '</td> |
| 67 |
<td class="action"> </td> |
| 68 |
</tr>'; |
| 69 |
} |
| 70 |
if ( usces_is_tax_display() && 'products' === $this->options['tax_target'] ) { |
| 71 |
$confirm_table_footer .= '<tr class="tax"> |
| 72 |
<td class="num"> </td> |
| 73 |
<td class="thumbnail"> </td> |
| 74 |
<td colspan="3" class="aright totallabel">' . usces_tax_label( array(), 'return' ) . '</td> |
| 75 |
<td class="aright totalend">' . usces_tax( $usces_entries, 'return' ) . '</td> |
| 76 |
<td class="action"> </td> |
| 77 |
</tr>'; |
| 78 |
} |
| 79 |
if ( 'activate' === $this->options['membersystem_state'] && 'activate' === $this->options['membersystem_point'] && ! empty( $usces_entries['order']['usedpoint'] ) && 0 === (int) $this->options['point_coverage'] ) { |
| 80 |
$confirm_table_footer .= '<tr class="usedpoint"> |
| 81 |
<td class="num"> </td> |
| 82 |
<td class="thumbnail"> </td> |
| 83 |
<td colspan="3" class="aright totallabel">' . esc_html__( 'Used points', 'usces' ) . '</td> |
| 84 |
<td class="aright totalend" style="color:#FF0000">' . number_format( $usces_entries['order']['usedpoint'] ) . '</td> |
| 85 |
<td class="action"> </td> |
| 86 |
</tr>'; |
| 87 |
} |
| 88 |
$confirm_table_footer .= '<tr class="shipping_charge"> |
| 89 |
<td class="num"> </td> |
| 90 |
<td class="thumbnail"> </td> |
| 91 |
<td colspan="3" class="aright totallabel">' . esc_html__( 'Shipping', 'usces' ) . '</td> |
| 92 |
<td class="aright totalend">' . usces_crform( $usces_entries['order']['shipping_charge'], true, false, 'return' ) . '</td> |
| 93 |
<td class="action"> </td> |
| 94 |
</tr>'; |
| 95 |
if ( ! empty( $usces_entries['order']['cod_fee'] ) ) { |
| 96 |
$confirm_table_footer .= '<tr class="cod_fee"> |
| 97 |
<td class="num"> </td> |
| 98 |
<td class="thumbnail"> </td> |
| 99 |
<td colspan="3" class="aright totallabel">' . apply_filters( 'usces_filter_cod_label', esc_html__( 'COD fee', 'usces' ) ) . '</td> |
| 100 |
<td class="aright totalend">' . usces_crform( $usces_entries['order']['cod_fee'], true, false, 'return' ) . '</td> |
| 101 |
<td class="action"> </td> |
| 102 |
</tr>'; |
| 103 |
} |
| 104 |
if ( usces_is_tax_display() && 'all' === $this->options['tax_target'] ) { |
| 105 |
$confirm_table_footer .= '<tr class="tax"> |
| 106 |
<td class="num"> </td> |
| 107 |
<td class="thumbnail"> </td> |
| 108 |
<td colspan="3" class="aright totallabel">' . usces_tax_label( array(), 'return' ) . '</td> |
| 109 |
<td class="aright totalend">' . usces_tax( $usces_entries, 'return' ) . '</td> |
| 110 |
<td class="action"> </td> |
| 111 |
</tr>'; |
| 112 |
} |
| 113 |
if ( 'activate' === $this->options['membersystem_state'] && 'activate' === $this->options['membersystem_point'] && ! empty( $usces_entries['order']['usedpoint'] ) && 1 === (int) $this->options['point_coverage'] ) { |
| 114 |
$confirm_table_footer .= '<tr class="usedpoint"> |
| 115 |
<td class="num"> </td> |
| 116 |
<td class="thumbnail"> </td> |
| 117 |
<td colspan="3" class="aright totallabel">' . esc_html__( 'Used points', 'usces' ) . '</td> |
| 118 |
<td class="aright totalend" style="color:#FF0000">' . number_format( $usces_entries['order']['usedpoint'] ) . '</td> |
| 119 |
<td class="action"> </td> |
| 120 |
</tr>'; |
| 121 |
} |
| 122 |
$confirm_table_footer .= '<tr class="total_full_price"> |
| 123 |
<th class="num"> </th> |
| 124 |
<th class="thumbnail"> </th> |
| 125 |
<th colspan="3" class="aright totallabel">' . esc_html__( 'Total Amount', 'usces' ) . '</th> |
| 126 |
<th class="aright totalend">' . usces_crform( $usces_entries['order']['total_full_price'], true, false, 'return' ) . '</th> |
| 127 |
<th class="action"> </th> |
| 128 |
</tr> |
| 129 |
</tfoot> |
| 130 |
</table>'; |
| 131 |
$html .= apply_filters( 'usces_filter_confirm_table_footer', $confirm_table_footer ); |
| 132 |
$html .= apply_filters( 'usces_filter_confirm_table_after', '' ); |
| 133 |
|
| 134 |
if ( 'activate' === $this->options['membersystem_state'] && 'activate' === $this->options['membersystem_point'] && $this->is_member_logged_in() ) { |
| 135 |
$confirm_point_table = '<form action="' . esc_url( USCES_CART_URL ) . '" method="post" onKeyDown="if (event.keyCode == 13) {return false;}"> |
| 136 |
<div class="error_message">' . $this->error_message . '</div> |
| 137 |
<table cellspacing="0" id="point_table"> |
| 138 |
<tr> |
| 139 |
<td>' . esc_html__( 'The current point', 'usces' ) . '</td> |
| 140 |
<td><span class="point">' . $member['point'] . '</span>pt</td> |
| 141 |
</tr> |
| 142 |
<tr> |
| 143 |
<td>' . esc_html__( 'Points you are using here', 'usces' ) . '</td> |
| 144 |
<td><input name="offer[usedpoint]" class="used_point" type="text" value="' . esc_attr( $usces_entries['order']['usedpoint'] ) . '" />pt</td> |
| 145 |
</tr> |
| 146 |
<tr> |
| 147 |
<td colspan="2"><input name="use_point" type="submit" class="use_point_button" value="' . esc_html__( 'Use the points', 'usces' ) . '" /></td> |
| 148 |
</tr> |
| 149 |
</table>'; |
| 150 |
$confirm_point_table = apply_filters( 'usces_filter_confirm_point_table', $confirm_point_table ); |
| 151 |
$html = apply_filters( 'usces_filter_confirm_point_inform', $html . $confirm_point_table ); |
| 152 |
|
| 153 |
$noncekey = $this->member_nonce_key( 'use_point' ); |
| 154 |
$html .= wp_nonce_field( $noncekey, 'wc_nonce', true, false ); |
| 155 |
$html .= '</form>'; |
| 156 |
} |
| 157 |
$html .= apply_filters( 'usces_filter_confirm_after_form', null ); |
| 158 |
$html .= '</div>'; |
| 159 |
$customer_info_table = ' |
| 160 |
<table id="confirm_table"> |
| 161 |
<tr class="ttl"> |
| 162 |
<td colspan="2"><h3>' . esc_html__( 'Customer Information', 'usces' ) . '</h3></td> |
| 163 |
</tr> |
| 164 |
<tr> |
| 165 |
<th>' . esc_html__( 'e-mail adress', 'usces' ) . '</th> |
| 166 |
<td>' . esc_html( $usces_entries['customer']['mailaddress1'] ) . '</td> |
| 167 |
</tr>'; |
| 168 |
|
| 169 |
$customer_info_table .= uesces_addressform( 'confirm', $usces_entries ); |
| 170 |
|
| 171 |
$customer_info_table .= '<tr>'; |
| 172 |
$customer_info_table .= '<td class="ttl" colspan="2"><h3>' . esc_html__( 'Others', 'usces' ) . '</h3></td> |
| 173 |
</tr>'; |
| 174 |
$shipping_info = '<tr> |
| 175 |
<th>' . esc_html__( 'shipping option', 'usces' ) . '</th><td>' . esc_html( usces_delivery_method_name( $usces_entries['order']['delivery_method'], 'return' ) ) . '</td> |
| 176 |
</tr> |
| 177 |
<tr> |
| 178 |
<th>' . esc_html__( 'Delivery date', 'usces' ) . '</th><td>' . esc_html( $usces_entries['order']['delivery_date'] ) . '</td> |
| 179 |
</tr> |
| 180 |
<tr class="bdc"> |
| 181 |
<th>' . esc_html__( 'Delivery Time', 'usces' ) . '</th><td>' . esc_html( $usces_entries['order']['delivery_time'] ) . '</td> |
| 182 |
</tr>'; |
| 183 |
$customer_info_table .= apply_filters( 'usces_filter_confirm_shipping_info', $shipping_info ); |
| 184 |
|
| 185 |
$customer_info_table .= '<tr> |
| 186 |
<th>' . esc_html__( 'payment method', 'usces' ) . '</th><td>' . esc_html( $usces_entries['order']['payment_name'] . usces_payment_detail( $usces_entries ) ) . '</td> |
| 187 |
</tr>'; |
| 188 |
$customer_info_table .= usces_custom_field_info( $usces_entries, 'order', '', 'return' ); |
| 189 |
$customer_info_table .= '<tr> |
| 190 |
<th>' . esc_html__( 'Notes', 'usces' ) . '</th><td>' . nl2br( esc_html( $usces_entries['order']['note'] ) ) . '</td> |
| 191 |
</tr>'; |
| 192 |
$customer_info_table .= '</table>'; |
| 193 |
$html .= apply_filters( 'usces_filter_confirm_customer_info_table', $customer_info_table ); |
| 194 |
$html .= apply_filters( 'usces_filter_confirm_page_notes', '' ); |
| 195 |
|
| 196 |
require USCES_PLUGIN_DIR . '/includes/purchase_button.php'; |
| 197 |
|
| 198 |
$html .= '<div class="footer_explanation">'; |
| 199 |
$footer = ''; |
| 200 |
$html .= apply_filters( 'usces_filter_confirm_page_footer', $footer ); |
| 201 |
$html .= '</div>'; |
| 202 |
|
| 203 |
$html .= '</div>'; |
| 204 |
|