| 1 |
<?php |
| 2 |
usces_the_item(); |
| 3 |
|
| 4 |
$html = '<div id="itempage">'."\n"; |
| 5 |
$html .= '<form action="' . USCES_CART_URL . '" method="post">'."\n"; |
| 6 |
|
| 7 |
$html .= '<div class="itemimg">'."\n"; |
| 8 |
$html .= '<a href="' . usces_the_itemImageURL(0, 'return') . '"'; |
| 9 |
$html = apply_filters('usces_itemimg_anchor_rel', $html); |
| 10 |
$html .= '>'; |
| 11 |
$itemImage = usces_the_itemImage(0, 200, 250, $post, 'return'); |
| 12 |
$html .= apply_filters('usces_filter_the_itemImage', $itemImage, $post); |
| 13 |
$html .= '</a>'."\n"; |
| 14 |
$html .= '</div>'."\n"; |
| 15 |
|
| 16 |
if(usces_sku_num() === 1) { //1SKU |
| 17 |
usces_have_skus(); |
| 18 |
|
| 19 |
$html .= '<h3>' . esc_html(usces_the_itemName( 'return' )) . ' (' . esc_html(usces_the_itemCode( 'return' )) . ') </h3>'."\n"; |
| 20 |
$html .= '<div class="exp clearfix">'."\n"; |
| 21 |
$html .= '<div class="field">'."\n"; |
| 22 |
if( usces_the_itemCprice('return') > 0 ){ |
| 23 |
$usces_listprice = __('List price', 'usces') . usces_guid_tax('return'); |
| 24 |
$html .= '<div class="field_name">' . apply_filters('usces_filter_listprice_label', $usces_listprice, __('List price', 'usces'), usces_guid_tax('return')) . '</div>'."\n"; |
| 25 |
$html .= '<div class="field_cprice">' . usces_the_itemCpriceCr('return') . '</div>'; |
| 26 |
} |
| 27 |
$usces_sellingprice = __('selling price', 'usces') . usces_guid_tax('return'); |
| 28 |
$html .= '<div class="field_name">' . apply_filters('usces_filter_sellingprice_label', $usces_sellingprice, __('selling price', 'usces'), usces_guid_tax('return')) . '</div>'."\n"; |
| 29 |
$html .= '<div class="field_price">' . usces_the_itemPriceCr('return') . '</div>'."\n"; |
| 30 |
$html .= '</div>'."\n"; |
| 31 |
$singlestock = '<div class="field">' . __('stock status', 'usces') . ' : ' . esc_html(usces_get_itemZaiko( 'name' )) . '</div>'."\n"; |
| 32 |
$html .= apply_filters('single_item_stock_field', $singlestock); |
| 33 |
$item_custom = usces_get_item_custom( $post->ID, 'list', 'return' ); |
| 34 |
if($item_custom){ |
| 35 |
$html .= '<div class="field">'."\n"; |
| 36 |
$html .= $item_custom; |
| 37 |
$html .= '</div>'."\n"; |
| 38 |
} |
| 39 |
|
| 40 |
$html .= $content."\n"; |
| 41 |
$html .= '</div><!-- end of exp -->'."\n"; |
| 42 |
$html .= usces_the_itemGpExp('return'); |
| 43 |
$html .= '<div class="skuform" align="right">'."\n"; |
| 44 |
if (usces_is_options()) { |
| 45 |
$html .= "<table class='item_option'><caption>" . apply_filters('usces_filter_single_item_options_caption', __('Please appoint an option.', 'usces'), $post) . "</caption>\n"; |
| 46 |
while (usces_have_options()) { |
| 47 |
$opttr = "<tr><th>" . esc_html(usces_getItemOptName()) . '</th><td>' . usces_the_itemOption(usces_getItemOptName(),'','return') . "</td></tr>"; |
| 48 |
$html .= apply_filters('usces_filter_singleitem_option', $opttr, usces_getItemOptName(), NULL) . "\n"; |
| 49 |
} |
| 50 |
$html .= "</table>\n"; |
| 51 |
} |
| 52 |
if( !usces_have_zaiko() ){ |
| 53 |
$html .= '<div class="zaiko_status">' . apply_filters('usces_filters_single_sku_zaiko_message', esc_html(usces_get_itemZaiko( 'name' ))) . '</div>'."\n"; |
| 54 |
}else{ |
| 55 |
$html .= '<div style="margin-top:10px">'.__('Quantity', 'usces').usces_the_itemQuant('return') . esc_html(usces_the_itemSkuUnit('return')) . usces_the_itemSkuButton(__('Add to Shopping Cart', 'usces'), 0, 'return') . '</div>'."\n"; |
| 56 |
$html .= '<div class="error_message">' . usces_singleitem_error_message($post->ID, usces_the_itemSku('return'), 'return') . '</div>'."\n"; |
| 57 |
} |
| 58 |
|
| 59 |
$html .= '</div><!-- end of skuform -->'."\n"; |
| 60 |
$html .= apply_filters('single_item_single_sku_after_field', NULL); |
| 61 |
|
| 62 |
} elseif(usces_sku_num() > 1) { //some SKU |
| 63 |
usces_have_skus(); |
| 64 |
$html .= '<h3>' . usces_the_itemName( 'return' ) . ' (' . usces_the_itemCode( 'return' ) . ') </h3>'."\n"; |
| 65 |
$html .= '<div class="exp clearfix">'."\n"; |
| 66 |
$html .= $content."\n"; |
| 67 |
$item_custom = usces_get_item_custom( $post->ID, 'list', 'return' ); |
| 68 |
if($item_custom){ |
| 69 |
$html .= '<div class="field">'."\n"; |
| 70 |
$html .= $item_custom; |
| 71 |
$html .= '</div>'."\n"; |
| 72 |
} |
| 73 |
$html .= '</div>'."\n"; |
| 74 |
|
| 75 |
$html .= '<div class="skuform">'."\n"; |
| 76 |
$html .= '<table class="skumulti">'."\n"; |
| 77 |
$html .= '<thead>'."\n"; |
| 78 |
$html .= '<tr>'."\n"; |
| 79 |
$html .= '<th rowspan="2" class="thborder">'.__('order number', 'usces').'</th>'."\n"; |
| 80 |
$html .= '<th colspan="2">'.__('Title', 'usces').'</th>'."\n"; |
| 81 |
if( usces_the_itemCprice('return') > 0 ){ |
| 82 |
$usces_bothprice = '('.__('List price', 'usces').')'.__('selling price', 'usces') . usces_guid_tax('return'); |
| 83 |
$html .= '<th colspan="2">'.apply_filters('usces_filter_bothprice_label', $usces_bothprice, __('List price', 'usces'), __('selling price', 'usces'), usces_guid_tax('return')) . '</th>'."\n"; |
| 84 |
}else{ |
| 85 |
$usces_sellingprice = __('selling price', 'usces') . usces_guid_tax('return'); |
| 86 |
$html .= '<th colspan="2">'.apply_filters('usces_filter_sellingprice_label', $usces_sellingprice, __('selling price', 'usces'), usces_guid_tax('return')) . '</th>'."\n"; |
| 87 |
} |
| 88 |
$html .= '</tr>'."\n"; |
| 89 |
$html .= '<tr>'."\n"; |
| 90 |
$html .= '<th class="thborder">'.__('stock status', 'usces').'</th>'."\n"; |
| 91 |
$html .= '<th class="thborder">'.__('Quantity', 'usces').'</th>'."\n"; |
| 92 |
$html .= '<th class="thborder">'.__('unit', 'usces').'</th>'."\n"; |
| 93 |
$html .= '<th class="thborder"> </th>'."\n"; |
| 94 |
$html .= '</tr>'."\n"; |
| 95 |
$html .= '</thead>'."\n"; |
| 96 |
$html .= '<tbody>'."\n"; |
| 97 |
do { |
| 98 |
$html .= '<tr>'."\n"; |
| 99 |
$html .= '<td rowspan="2">' . esc_html(usces_the_itemSku('return')) . '</td>'."\n"; |
| 100 |
$html .= '<td colspan="2" class="skudisp subborder">' . apply_filters('usces_filter_singleitem_skudisp', esc_html(usces_the_itemSkuDisp('return')))."\n"; |
| 101 |
if (usces_is_options()) { |
| 102 |
$html .= "<table class='item_option'><caption>" . apply_filters('usces_filter_single_item_options_caption', __('Please appoint an option.', 'usces'), $post) . "</caption>\n"; |
| 103 |
while (usces_have_options()) { |
| 104 |
$opttr = "<tr><th>" . esc_html(usces_getItemOptName()) . '</th><td>' . usces_the_itemOption(usces_getItemOptName(),'','return') . "</td></tr>"; |
| 105 |
$html .= apply_filters('usces_filter_singleitem_option', $opttr, usces_getItemOptName(), NULL) . "\n"; |
| 106 |
} |
| 107 |
$html .= "</table>\n"; |
| 108 |
// while (usces_have_options()) { |
| 109 |
// $html .= '<br />' . usces_the_itemOption(usces_getItemOptName(),'', 'return'); |
| 110 |
// } |
| 111 |
} |
| 112 |
$html .= '</td>'."\n"; |
| 113 |
$html .= '<td colspan="2" class="subborder price">'."\n"; |
| 114 |
if( usces_the_itemCprice('return') > 0 ){ |
| 115 |
$html .= '<span class="cprice">(' . usces_the_itemCpriceCr('return') . ')</span>'."\n"; |
| 116 |
} |
| 117 |
$html .= '<span class="price">' . usces_the_itemPriceCr('return') . '</span><br />' . usces_the_itemGpExp('return') . '</td>'."\n"; |
| 118 |
$html .= '</tr>'."\n"; |
| 119 |
$html .= '<tr>'."\n"; |
| 120 |
$html .= '<td class="zaiko">' . usces_get_itemZaiko( 'name' ) . '</td>'."\n"; |
| 121 |
$html .= '<td class="quant">' . usces_the_itemQuant('return') . '</td>'."\n"; |
| 122 |
$html .= '<td class="unit">' . usces_the_itemSkuUnit('return') . '</td>'."\n"; |
| 123 |
if( !usces_have_zaiko() ){ |
| 124 |
$html .= '<td class="button">' . apply_filters('usces_filters_single_sku_zaiko_message', esc_html(usces_get_itemZaiko( 'name' ))) . '</td>'."\n"; |
| 125 |
}else{ |
| 126 |
$html .= '<td class="button">' . usces_the_itemSkuButton(__('Add to Shopping Cart', 'usces'), 0, 'return') . '</td>'."\n"; |
| 127 |
} |
| 128 |
$html .= '</tr>'."\n"; |
| 129 |
$html .= '<tr><td colspan="5" class="error_message">' . usces_singleitem_error_message($post->ID, usces_the_itemSku('return'), 'return') . '</td></tr>'."\n"; |
| 130 |
|
| 131 |
} while (usces_have_skus()); |
| 132 |
$html .= '</tbody>'."\n"; |
| 133 |
$html .= '</table>'."\n"; |
| 134 |
$html .= '</div><!-- end of skuform -->'."\n"; |
| 135 |
$html .= apply_filters('single_item_multi_sku_after_field', NULL); |
| 136 |
} |
| 137 |
|
| 138 |
$html .= '<div class="itemsubimg">'."\n"; |
| 139 |
$imageid = usces_get_itemSubImageNums(); |
| 140 |
foreach ( $imageid as $id ) { |
| 141 |
$html .= '<a href="' . usces_the_itemImageURL($id, 'return') . '"'; |
| 142 |
$html = apply_filters('usces_itemimg_anchor_rel', $html); |
| 143 |
$html .= '>'; |
| 144 |
$itemImage = usces_the_itemImage($id, 137, 200, $post, 'return'); |
| 145 |
$html .= apply_filters('usces_filter_the_SubImage', $itemImage, $post, $id); |
| 146 |
$html .= '</a>'."\n"; |
| 147 |
} |
| 148 |
$html .= '</div><!-- end of itemsubimg -->'."\n"; |
| 149 |
|
| 150 |
if (usces_get_assistance_id_list($post->ID)) { |
| 151 |
$org_opst = $post; |
| 152 |
$html .= '<div class="assistance_item">'."\n"; |
| 153 |
$assistanceposts = get_posts('include='.usces_get_assistance_id_list($post->ID)); |
| 154 |
if ($assistanceposts) { |
| 155 |
$assistance_item_title = '<h3>' . usces_the_itemCode( 'return' ) . __('An article concerned', 'usces').'</h3>'."\n"; |
| 156 |
$html .= apply_filters('usces_assistance_item_title', $assistance_item_title); |
| 157 |
$html .= '<ul class="clearfix">'."\n"; |
| 158 |
foreach ($assistanceposts as $post) { |
| 159 |
setup_postdata($post); |
| 160 |
usces_the_item(); |
| 161 |
$html .= '<li><div class="listbox clearfix">'."\n"; |
| 162 |
$html .= '<div class="slit"><a href="' . get_permalink($post->ID) . '" rel="bookmark" title="' . esc_attr($post->post_title) . '">' . usces_the_itemImage(0, 100, 100, $post, 'return') . '</a></div>'."\n"; |
| 163 |
$html .= '<div class="detail">'."\n"; |
| 164 |
$html .= '<h4>' . usces_the_itemName('return') . '</h4>'."\n"; |
| 165 |
$html .= $post->post_excerpt; |
| 166 |
$html .= '<p>'."\n"; |
| 167 |
if (usces_is_skus()) { |
| 168 |
$html .= __('$', 'usces') . usces_the_firstPrice('return'); |
| 169 |
} |
| 170 |
$html .= '<br />'."\n"; |
| 171 |
$html .= '» <a href="' . get_permalink($post->ID) . '" rel="bookmark" title="' . esc_attr($post->post_title) . '">'.__('see the details', 'usces').'</a></p>'."\n"; |
| 172 |
$html .= '</div>'."\n"; |
| 173 |
$html .= '</div>'."\n"; |
| 174 |
$html .= '</li>'."\n"; |
| 175 |
} |
| 176 |
$html .= '</ul>'."\n"; |
| 177 |
} |
| 178 |
|
| 179 |
$html .= '</div><!-- end of assistance_item -->'."\n"; |
| 180 |
$post = $org_opst; |
| 181 |
setup_postdata($post); |
| 182 |
} |
| 183 |
|
| 184 |
$html = apply_filters('usces_filter_single_item_inform', $html); |
| 185 |
$html .= '</form>'."\n"; |
| 186 |
$html .= apply_filters('usces_filter_single_item_outform', NULL); |
| 187 |
|
| 188 |
$html .= '</div><!-- end of itemspage -->'."\n"; |
| 189 |
?> |
| 190 |
|