| 1 |
<?php |
| 2 |
$status = $this->action_status; |
| 3 |
$message = $this->action_message; |
| 4 |
$this->action_status = 'none'; |
| 5 |
$this->action_message = ''; |
| 6 |
$delivery_method = isset($this->options['delivery_method']) ? $this->options['delivery_method'] : array(); |
| 7 |
$shipping_charge = isset($this->options['shipping_charge']) ? $this->options['shipping_charge'] : array(); |
| 8 |
// $prefs = get_option('usces_pref'); |
| 9 |
//20110317ysk start |
| 10 |
//$prefs = $this->options['province']; |
| 11 |
//array_shift($prefs); |
| 12 |
//global $usces_states; |
| 13 |
$target_market = ( isset($this->options['system']['target_market']) && !empty($this->options['system']['target_market']) ) ? $this->options['system']['target_market'] : usces_get_local_target_market(); |
| 14 |
foreach((array)$target_market as $tm) { |
| 15 |
//20110331ysk start |
| 16 |
//$prefs[$tm] = $usces_states[$tm]; |
| 17 |
$prefs[$tm] = get_usces_states($tm); |
| 18 |
//20110331ysk end |
| 19 |
array_shift($prefs[$tm]); |
| 20 |
} |
| 21 |
//20110317ysk end |
| 22 |
//20101208ysk start |
| 23 |
$delivery_time_limit['hour'] = isset($this->options['delivery_time_limit']['hour']) ? $this->options['delivery_time_limit']['hour'] : '00'; |
| 24 |
$delivery_time_limit['min'] = isset($this->options['delivery_time_limit']['min']) ? $this->options['delivery_time_limit']['min'] : '00'; |
| 25 |
$shortest_delivery_time = isset($this->options['shortest_delivery_time']) ? $this->options['shortest_delivery_time'] : '0'; |
| 26 |
$delivery_after_days = (empty($this->options['delivery_after_days'])) ? 15 : (int)$this->options['delivery_after_days']; |
| 27 |
$delivery_days = isset($this->options['delivery_days']) ? $this->options['delivery_days'] : array(); |
| 28 |
//20101208ysk end |
| 29 |
//20110317ysk start |
| 30 |
$base_country = $this->options['system']['base_country']; |
| 31 |
//20110317ysk end |
| 32 |
?> |
| 33 |
<script type="text/javascript"> |
| 34 |
jQuery(function($){ |
| 35 |
<?php if($status == 'success'){ ?> |
| 36 |
$("#anibox").animate({ backgroundColor: "#ECFFFF" }, 2000); |
| 37 |
<?php }else if($status == 'caution'){ ?> |
| 38 |
$("#anibox").animate({ backgroundColor: "#FFF5CE" }, 2000); |
| 39 |
<?php }else if($status == 'error'){ ?> |
| 40 |
$("#anibox").animate({ backgroundColor: "#FFE6E6" }, 2000); |
| 41 |
<?php } ?> |
| 42 |
|
| 43 |
$(".charge_text").bind("change", function(){ usces_check_money($(this)); }); |
| 44 |
$(".days_text").bind("change", function(){ usces_check_num($(this)); }); |
| 45 |
|
| 46 |
//20110317ysk start |
| 47 |
//20120710ysk start 0000472 |
| 48 |
<?php |
| 49 |
//$target_market_arr = ''; |
| 50 |
//foreach((array)$target_market as $tm) $target_market_arr .= "'".$tm."',"; |
| 51 |
//$target_market_arr = rtrim($target_market_arr, ","); |
| 52 |
if(!array_key_exists($base_country, (array)$target_market)) $base_country = $target_market[0];//20110509ysk |
| 53 |
$i = 0; |
| 54 |
?> |
| 55 |
var target_market = []; |
| 56 |
<?php foreach( (array)$target_market as $tm ) : ?> |
| 57 |
target_market[<?php echo $i; ?>] = "<?php echo $tm; ?>"; |
| 58 |
<?php $i++; ?> |
| 59 |
<?php endforeach; ?> |
| 60 |
//20120710ysk end |
| 61 |
var base_country = "<?php echo $base_country; ?>"; |
| 62 |
//20110317ysk end |
| 63 |
|
| 64 |
var delivery_method = []; |
| 65 |
<?php for($i=0; $i<count((array)$delivery_method); $i++){ $lines = split("\n", $delivery_method[$i]['time']); ?> |
| 66 |
delivery_method[<?php echo $i; ?>] = []; |
| 67 |
delivery_method[<?php echo $i; ?>]['id'] = <?php echo (int)$delivery_method[$i]['id']; ?>; |
| 68 |
delivery_method[<?php echo $i; ?>]['name'] = "<?php echo $delivery_method[$i]['name']; ?>"; |
| 69 |
delivery_method[<?php echo $i; ?>]['charge'] = <?php echo (int)$delivery_method[$i]['charge']; ?>; |
| 70 |
//20101228ysk start |
| 71 |
delivery_method[<?php echo $i; ?>]['days'] = <?php echo (int)$delivery_method[$i]['days']; ?>; |
| 72 |
//20101228ysk end |
| 73 |
sttr = ''; |
| 74 |
<?php foreach((array)$lines as $line){ if(trim($line) != ''){ ?> |
| 75 |
sttr += "<?php echo trim($line); ?>\n"; |
| 76 |
<?php } } ?> |
| 77 |
delivery_method[<?php echo $i; ?>]['time'] = sttr; |
| 78 |
//20101119ysk start |
| 79 |
delivery_method[<?php echo $i; ?>]['nocod'] = "<?php echo $delivery_method[$i]['nocod']; ?>"; |
| 80 |
//20101119ysk end |
| 81 |
//20110317ysk start |
| 82 |
//20110422ysk start |
| 83 |
delivery_method[<?php echo $i; ?>]['intl'] = "<?php echo (!empty($delivery_method[$i]['intl'])) ? $delivery_method[$i]['intl'] : '0'; ?>"; |
| 84 |
//20110422ysk end |
| 85 |
//20110317ysk end |
| 86 |
<?php } ?> |
| 87 |
|
| 88 |
//20110317ysk start |
| 89 |
var pref = []; |
| 90 |
<?php //foreach((array)$prefs as $pref){ ?> |
| 91 |
<?php //} ?> |
| 92 |
<?php foreach((array)$target_market as $tm){ ?> |
| 93 |
pref["<?php echo $tm; ?>"] = []; |
| 94 |
<?php foreach((array)$prefs[$tm] as $pref){ ?> |
| 95 |
pref["<?php echo $tm; ?>"].push("<?php echo $pref; ?>"); |
| 96 |
<?php }} ?> |
| 97 |
//20110317ysk end |
| 98 |
var shipping_charge = []; |
| 99 |
<?php for($i=0; $i<count((array)$shipping_charge); $i++){ ?> |
| 100 |
shipping_charge[<?php echo $i; ?>] = []; |
| 101 |
shipping_charge[<?php echo $i; ?>]["id"] = <?php echo (int)$shipping_charge[$i]['id']; ?>; |
| 102 |
shipping_charge[<?php echo $i; ?>]["name"] = "<?php echo $shipping_charge[$i]['name']; ?>"; |
| 103 |
//20120710ysk start 0000472 |
| 104 |
<?php foreach((array)$target_market as $tm) { ?> |
| 105 |
shipping_charge[<?php echo $i; ?>]["<?php echo $tm; ?>"] = []; |
| 106 |
//20110317ysk start |
| 107 |
<?php //$country = (empty($shipping_charge[$i]['country'])) ? $base_country : $shipping_charge[$i]['country']; ?> |
| 108 |
<?php //foreach((array)$prefs as $pref){ ?> |
| 109 |
<?php //foreach((array)$prefs[$country] as $pref){ ?> |
| 110 |
<?php foreach( (array)$prefs[$tm] as $pref ) { ?> |
| 111 |
//20110317ysk end |
| 112 |
<?php if( isset($shipping_charge[$i][$tm][$pref]) ) : ?> |
| 113 |
shipping_charge[<?php echo $i; ?>]["<?php echo $tm; ?>"]["<?php echo $pref; ?>"] = "<?php echo (int)$shipping_charge[$i][$tm][$pref]; ?>"; |
| 114 |
<?php else : ?> |
| 115 |
shipping_charge[<?php echo $i; ?>]["<?php echo $tm; ?>"]["<?php echo $pref; ?>"] = "0"; |
| 116 |
<?php endif; ?> |
| 117 |
<?php //}} ?> |
| 118 |
<?php }}} ?> |
| 119 |
//20120710ysk end |
| 120 |
|
| 121 |
//20101208ysk start |
| 122 |
var delivery_days = []; |
| 123 |
<?php for($i=0; $i<count((array)$delivery_days); $i++){ ?> |
| 124 |
delivery_days[<?php echo $i; ?>] = []; |
| 125 |
delivery_days[<?php echo $i; ?>]["id"] = <?php echo (int)$delivery_days[$i]['id']; ?>; |
| 126 |
delivery_days[<?php echo $i; ?>]["name"] = "<?php echo $delivery_days[$i]['name']; ?>"; |
| 127 |
//20120710ysk start 0000472 |
| 128 |
<?php foreach((array)$target_market as $tm) { ?> |
| 129 |
delivery_days[<?php echo $i; ?>]["<?php echo $tm; ?>"] = []; |
| 130 |
//20110317ysk start |
| 131 |
<?php //$country = (empty($delivery_days[$i]['country'])) ? $base_country : $delivery_days[$i]['country']; ?> |
| 132 |
<?php //foreach((array)$prefs as $pref){ ?> |
| 133 |
<?php //foreach((array)$prefs[$country] as $pref){ ?> |
| 134 |
<?php foreach( (array)$prefs[$tm] as $pref ) { ?> |
| 135 |
//20110317ysk end |
| 136 |
<?php if( isset($delivery_days[$i][$tm][$pref]) ) : ?> |
| 137 |
delivery_days[<?php echo $i; ?>]["<?php echo $tm; ?>"]["<?php echo $pref; ?>"] = "<?php echo (int)$delivery_days[$i][$tm][$pref]; ?>"; |
| 138 |
<?php else : ?> |
| 139 |
delivery_days[<?php echo $i; ?>]["<?php echo $tm; ?>"]["<?php echo $pref; ?>"] = "0"; |
| 140 |
<?php endif; ?> |
| 141 |
<?php //}} ?> |
| 142 |
<?php }}} ?> |
| 143 |
//20120710ysk end |
| 144 |
//20101208ysk end |
| 145 |
|
| 146 |
var selected_method = 0; |
| 147 |
function get_delivery_method_charge(selected){ |
| 148 |
var index = 0; |
| 149 |
for(var i=0; i<delivery_method.length; i++){ |
| 150 |
if(selected === delivery_method[i]['id']){ |
| 151 |
index = i; |
| 152 |
} |
| 153 |
} |
| 154 |
if(undefined === delivery_method[index]){ |
| 155 |
return -1; |
| 156 |
}else{ |
| 157 |
return delivery_method[index]['charge']; |
| 158 |
} |
| 159 |
} |
| 160 |
|
| 161 |
$("#delivery_method_charge").click(function () { |
| 162 |
if(shipping_charge.length == 0){ |
| 163 |
alert('<?php _e('Please set the shipping price', 'usces'); ?>'); |
| 164 |
} |
| 165 |
}); |
| 166 |
|
| 167 |
//20101208ysk start |
| 168 |
function get_delivery_method_days(selected){ |
| 169 |
var index = 0; |
| 170 |
for(var i=0; i<delivery_method.length; i++){ |
| 171 |
if(selected === delivery_method[i]['id']){ |
| 172 |
index = i; |
| 173 |
} |
| 174 |
} |
| 175 |
if(undefined === delivery_method[index]){ |
| 176 |
return -1; |
| 177 |
}else{ |
| 178 |
return delivery_method[index]['days']; |
| 179 |
} |
| 180 |
} |
| 181 |
|
| 182 |
$("#delivery_method_days").click(function () { |
| 183 |
if(delivery_days.length == 0){ |
| 184 |
alert('<?php _e('Please set the delivery days', 'usces'); ?>'); |
| 185 |
} |
| 186 |
}); |
| 187 |
//20101208ysk end |
| 188 |
|
| 189 |
$("#new_delivery_method_action").click(function () { |
| 190 |
if(delivery_method.length === 0) return false; |
| 191 |
$("#delivery_method_name").html('<input name="delivery_method_name" type="text" value="" />'); |
| 192 |
$("#delivery_method_name2").html(''); |
| 193 |
$("#delivery_method_time").val(''); |
| 194 |
$("#delivery_method_button").html('<input name="cancel_delivery_method" id="cancel_delivery_method" type="button" value="<?php _e('Cancel', 'usces'); ?>" onclick="operation.disp_delivery_method(0);" /><input name="add_delivery_method" id="add_delivery_method" type="button" value="<?php _e('Add', 'usces'); ?>" onclick="operation.add_delivery_method();" />'); |
| 195 |
//20101119ysk start |
| 196 |
$("#delivery_method_nocod").html('<input name="delivery_method_nocod" type="checkbox" value="1" />'); |
| 197 |
//20101119ysk end |
| 198 |
//20110317ysk start |
| 199 |
$("#delivery_method_intl").html('<input name="delivery_method_intl" id="delivery_method_intl_0" type="radio" value="0" checked /><label for="delivery_method_intl_0"><?php _e('Domestic Shipment', 'usces'); ?></label> <input name="delivery_method_intl" id="delivery_method_intl_1" type="radio" value="1" /><label for="delivery_method_intl_1"><?php _e('International Shipment', 'usces'); ?></label>'); |
| 200 |
//20110317ysk end |
| 201 |
$("input[name='delivery_method_name']").focus().select(); |
| 202 |
operation.make_delivery_method_charge(-1); |
| 203 |
//20101208ysk start |
| 204 |
operation.make_delivery_method_days(-1); |
| 205 |
//20101208ysk end |
| 206 |
}); |
| 207 |
|
| 208 |
$("#moveup_action").click(function () { |
| 209 |
var id = $("#delivery_method_name_select option:selected").val()-0; |
| 210 |
operation.moveup_delivery_method(id); |
| 211 |
operation.disp_delivery_method(id); |
| 212 |
}); |
| 213 |
|
| 214 |
$("#movedown_action").click(function () { |
| 215 |
var id = $("#delivery_method_name_select option:selected").val()-0; |
| 216 |
operation.movedown_delivery_method(id); |
| 217 |
operation.disp_delivery_method(id); |
| 218 |
}); |
| 219 |
|
| 220 |
$("#new_shipping_charge_action").click(function () { |
| 221 |
//if(shipping_charge.length === 0) return false; |
| 222 |
var valuehtml = ''; |
| 223 |
//20110317ysk start |
| 224 |
//for(var i=0; i<pref.length; i++){ |
| 225 |
// valuehtml += "<div class='clearfix'><label class='shipping_charge_label'>" + pref[i] + "</label><input type='text' name='shipping_charge_value[" + pref[i] + "]' value='' class='charge_text' /><?php usces_crcode(); ?></div>\n"; |
| 226 |
//} |
| 227 |
//20120710ysk start 0000472 |
| 228 |
//for(var i=0; i<pref[base_country].length; i++){ |
| 229 |
// valuehtml += "<div class='clearfix'><label class='shipping_charge_label'>" + pref[base_country][i] + "</label><input type='text' name='shipping_charge_value[" + pref[base_country][i] + "]' value='' class='charge_text' /><?php usces_crcode(); ?></div>\n"; |
| 230 |
//} |
| 231 |
for( var j = 0; j < target_market.length; j++ ) { |
| 232 |
var tm = target_market[j]; |
| 233 |
valuehtml += "<div id='shipping_charge_"+tm+"'>"; |
| 234 |
for( var i = 0; i < pref[tm].length; i++ ) { |
| 235 |
var p = pref[tm][i]; |
| 236 |
valuehtml += "<div class='clearfix'><label class='shipping_charge_label'>"+p+"</label><input type='text' name=\"shipping_charge_value_"+tm+"["+p+"]\" value='' class='charge_text' /><?php usces_crcode(); ?></div>\n"; |
| 237 |
} |
| 238 |
valuehtml += "</div>"; |
| 239 |
} |
| 240 |
//20120710ysk end |
| 241 |
$("#shipping_charge_country").val(base_country); |
| 242 |
//20110317ysk end |
| 243 |
$("#shipping_charge_name").html('<input name="shipping_charge_name" type="text" value="" />'); |
| 244 |
$("#shipping_charge_name2").html(''); |
| 245 |
$("#shipping_charge_value").html(valuehtml); |
| 246 |
$("#shipping_charge_button").html('<input name="cancel_shipping_charge" id="cancel_shipping_charge" type="button" value="<?php _e('Cancel', 'usces'); ?>" onclick="operation.disp_shipping_charge(0);" /><input name="add_shipping_charge" id="add_shipping_charge" type="button" value="<?php _e('Add', 'usces'); ?>" onclick="operation.add_shipping_charge();" />'); |
| 247 |
$("input[name='shipping_charge_name']").focus().select(); |
| 248 |
$(".charge_text").bind("change", function(){ usces_check_money($(this)); }); |
| 249 |
//20120710ysk start 0000472 |
| 250 |
for( var i = 0; i < target_market.length; i++ ) { |
| 251 |
if( base_country == target_market[i] ) { |
| 252 |
$("#shipping_charge_"+target_market[i]).css("display",""); |
| 253 |
} else { |
| 254 |
$("#shipping_charge_"+target_market[i]).css("display","none"); |
| 255 |
} |
| 256 |
} |
| 257 |
//20120710ysk end |
| 258 |
}); |
| 259 |
|
| 260 |
//20101208ysk start |
| 261 |
$("#new_delivery_days_action").click(function () { |
| 262 |
//if(delivery_days.length === 0) return false; |
| 263 |
var valuehtml = ''; |
| 264 |
//20110317ysk start |
| 265 |
//for(var i=0; i<pref.length; i++){ |
| 266 |
// valuehtml += "<div class='clearfix'><label class='delivery_days_label'>" + pref[i] + "</label><input type='text' name='delivery_days_value[" + pref[i] + "]' value='' class='days_text' /><?php _e('day', 'usces'); ?></div>\n"; |
| 267 |
//} |
| 268 |
//20120710ysk start 0000472 |
| 269 |
//for(var i=0; i<pref[base_country].length; i++){ |
| 270 |
// valuehtml += "<div class='clearfix'><label class='delivery_days_label'>" + pref[base_country][i] + "</label><input type='text' name='delivery_days_value[" + pref[base_country][i] + "]' value='' class='days_text' /><?php _e('day', 'usces'); ?></div>\n"; |
| 271 |
//} |
| 272 |
for( var j = 0; j < target_market.length; j++ ) { |
| 273 |
var tm = target_market[j]; |
| 274 |
valuehtml += "<div id='delivery_days_"+tm+"'>"; |
| 275 |
for( var i = 0; i < pref[tm].length; i++ ) { |
| 276 |
var p = pref[tm][i]; |
| 277 |
valuehtml += "<div class='clearfix'><label class='delivery_days_label'>"+p+"</label><input type='text' name=\"delivery_days_value_"+tm+"["+p+"]\" value='' class='days_text' /><?php _e('day', 'usces'); ?></div>\n"; |
| 278 |
} |
| 279 |
valuehtml += "</div>"; |
| 280 |
} |
| 281 |
//20120710ysk end |
| 282 |
$("#delivery_days_country").val(base_country); |
| 283 |
//20110317ysk end |
| 284 |
$("#delivery_days_name").html('<input name="delivery_days_name" type="text" value="" />'); |
| 285 |
$("#delivery_days_name2").html(''); |
| 286 |
$("#delivery_days_value").html(valuehtml); |
| 287 |
$("#delivery_days_button").html('<input name="cancel_delivery_days" id="cancel_delivery_days" type="button" value="<?php _e('Cancel', 'usces'); ?>" onclick="operation.disp_delivery_days(0);" /><input name="add_delivery_days" id="add_delivery_days" type="button" value="<?php _e('Add', 'usces'); ?>" onclick="operation.add_delivery_days();" />'); |
| 288 |
$("input[name='delivery_days_name']").focus().select(); |
| 289 |
$(".days_text").bind("change", function(){ usces_check_num($(this)); }); |
| 290 |
//20120710ysk start 0000472 |
| 291 |
for( var i = 0; i < target_market.length; i++ ) { |
| 292 |
if( base_country == target_market[i] ) { |
| 293 |
$("#delivery_days_"+target_market[i]).css("display",""); |
| 294 |
} else { |
| 295 |
$("#delivery_days_"+target_market[i]).css("display","none"); |
| 296 |
} |
| 297 |
} |
| 298 |
//20120710ysk end |
| 299 |
}); |
| 300 |
//20101208ysk end |
| 301 |
|
| 302 |
operation = { |
| 303 |
disp_delivery_method :function (id){ |
| 304 |
selected_method = id; |
| 305 |
var index = false; |
| 306 |
for(var i=0; i<delivery_method.length; i++){ |
| 307 |
if(id === delivery_method[i]['id']){ |
| 308 |
index = i; |
| 309 |
} |
| 310 |
} |
| 311 |
if(false === index){ |
| 312 |
selected = 0; |
| 313 |
}else{ |
| 314 |
selected = index; |
| 315 |
} |
| 316 |
if(delivery_method.length === 0) { |
| 317 |
$("#delivery_method_name").html('<input name="delivery_method_name" type="text" value="" />'); |
| 318 |
$("#delivery_method_name2").html(''); |
| 319 |
$("#delivery_method_time").val(''); |
| 320 |
$("#delivery_method_button").html('<input name="add_delivery_method" id="add_delivery_method" type="button" value="<?php _e('Add', 'usces'); ?>" onclick="operation.add_delivery_method();" />'); |
| 321 |
//20101119ysk start |
| 322 |
$("#delivery_method_nocod").html('<input name="delivery_method_nocod" type="checkbox" value="1" />'); |
| 323 |
//20101119ysk end |
| 324 |
//20110317ysk start |
| 325 |
$("#delivery_method_intl").html('<input name="delivery_method_intl" id="delivery_method_intl_0" type="radio" value="0" checked /><label for="delivery_method_intl_0"><?php _e('Domestic Shipment', 'usces'); ?></label> <input name="delivery_method_intl" id="delivery_method_intl_1" type="radio" value="1" /><label for="delivery_method_intl_1"><?php _e('International Shipment', 'usces'); ?></label>'); |
| 326 |
//20110317ysk end |
| 327 |
operation.make_delivery_method_charge(-1); |
| 328 |
//20101208ysk start |
| 329 |
operation.make_delivery_method_days(-1); |
| 330 |
//20101208ysk end |
| 331 |
}else{ |
| 332 |
var name_select = '<select name="delivery_method_name_select" id="delivery_method_name_select" onchange="operation.onchange_delivery_select(this.selectedIndex);">'+"\n"; |
| 333 |
for(var i=0; i<delivery_method.length; i++){ |
| 334 |
if(selected === i){ |
| 335 |
name_select += '<option value="'+delivery_method[i]['id']+'" selected="selected">'+(i)+' : '+delivery_method[i]['name']+'</option>'+"\n"; |
| 336 |
}else{ |
| 337 |
name_select += '<option value="'+delivery_method[i]['id']+'">'+(i)+' : '+delivery_method[i]['name']+'</option>'+"\n"; |
| 338 |
} |
| 339 |
} |
| 340 |
name_select += "</select>\n"; |
| 341 |
$("#delivery_method_name").html(name_select); |
| 342 |
$("#delivery_method_name2").html('<input name="delivery_method_name" type="text" value="'+delivery_method[selected]['name']+'" />'); |
| 343 |
$("#delivery_method_time").val(delivery_method[selected]['time']); |
| 344 |
$("#delivery_method_button").html("<input name='delete_delivery_method' id='delete_delivery_method' type='button' value='<?php _e('Delete', 'usces'); ?>' onclick='operation.delete_delivery_method();' /><input name='update_delivery_method' id='update_delivery_method' type='button' value='<?php _e('update', 'usces'); ?>' onclick='operation.update_delivery_method();' />"); |
| 345 |
//20110317ysk start |
| 346 |
//20101119ysk start |
| 347 |
var checked_nocod = (delivery_method[selected]['nocod'] == '1') ? ' checked' : ''; |
| 348 |
$("#delivery_method_nocod").html('<input name="delivery_method_nocod" type="checkbox" value="1"'+checked_nocod+' />'); |
| 349 |
//20101119ysk end |
| 350 |
var checked_intl_0 = (delivery_method[selected]['intl'] == '0') ? ' checked' : ''; |
| 351 |
var checked_intl_1 = (delivery_method[selected]['intl'] == '1') ? ' checked' : ''; |
| 352 |
$("#delivery_method_intl").html('<input name="delivery_method_intl" id="delivery_method_intl_0" type="radio" value="0"'+checked_intl_0+' /><label for="delivery_method_intl_0"><?php _e('Domestic Shipment', 'usces'); ?></label> <input name="delivery_method_intl" id="delivery_method_intl_1" type="radio" value="1"'+checked_intl_1+' /><label for="delivery_method_intl_1"><?php _e('International Shipment', 'usces'); ?></label>'); |
| 353 |
//20110317ysk end |
| 354 |
operation.make_delivery_method_charge(get_delivery_method_charge(selected_method)); |
| 355 |
//20101208ysk start |
| 356 |
operation.make_delivery_method_days(get_delivery_method_days(selected_method)); |
| 357 |
//20101208ysk end |
| 358 |
} |
| 359 |
}, |
| 360 |
|
| 361 |
add_delivery_method : function() { |
| 362 |
if($("input[name='delivery_method_name']").val() == "") return; |
| 363 |
|
| 364 |
$("#delivery_method_loading").html('<img src="<?php echo USCES_PLUGIN_URL; ?>/images/loading-publish.gif" />'); |
| 365 |
var name = encodeURIComponent($("input[name='delivery_method_name']").val()); |
| 366 |
var time = encodeURIComponent($("#delivery_method_time").val()); |
| 367 |
var charge = $("#delivery_method_charge option:selected").val(); |
| 368 |
//20101208ysk start |
| 369 |
var days = $("#delivery_method_days option:selected").val(); |
| 370 |
//20101208ysk end |
| 371 |
//20101119ysk start |
| 372 |
var nocod = ($(':input[name=delivery_method_nocod]').attr('checked')) ? '1' : '0'; |
| 373 |
//20101119ysk end |
| 374 |
//20110317ysk start |
| 375 |
var intl = $(':radio[name=delivery_method_intl]:checked').val(); |
| 376 |
//20110317ysk end |
| 377 |
|
| 378 |
var s = operation.settings; |
| 379 |
//20101208ysk start |
| 380 |
//20101119ysk start |
| 381 |
//20110317ysk start |
| 382 |
//s.data = "action=shop_options_ajax&mode=add_delivery_method&name=" + name + "&charge=" + charge + "&time=" + time; |
| 383 |
//s.data = "action=shop_options_ajax&mode=add_delivery_method&name=" + name + "&charge=" + charge + "&time=" + time + "&nocod=" + nocod; |
| 384 |
//s.data = "action=shop_options_ajax&mode=add_delivery_method&name=" + name + "&time=" + time + "&charge=" + charge + "&days=" + days + "&nocod=" + nocod; |
| 385 |
s.data = "action=shop_options_ajax&mode=add_delivery_method&name=" + name + "&time=" + time + "&charge=" + charge + "&days=" + days + "&nocod=" + nocod + "&intl=" + intl; |
| 386 |
//20110317ysk end |
| 387 |
//20101119ysk end |
| 388 |
//20101208ysk end |
| 389 |
s.success = function(data, dataType){ |
| 390 |
var strs = data.split('#usces#'); |
| 391 |
var id = strs[0] - 0; |
| 392 |
var name = strs[1]; |
| 393 |
var time = strs[2]; |
| 394 |
var charge = strs[3] - 0; |
| 395 |
//20101208ysk start |
| 396 |
var days = strs[4] - 0; |
| 397 |
//20101119ysk start |
| 398 |
//var nocod = strs[4]; |
| 399 |
var nocod = strs[5]; |
| 400 |
//20101119ysk end |
| 401 |
//20101208ysk end |
| 402 |
//20110317ysk start |
| 403 |
var intl = strs[6]; |
| 404 |
//20110317ysk end |
| 405 |
var index = delivery_method.length; |
| 406 |
delivery_method[index] = []; |
| 407 |
delivery_method[index]['id'] = id; |
| 408 |
delivery_method[index]['name'] = name; |
| 409 |
delivery_method[index]['time'] = time; |
| 410 |
delivery_method[index]['charge'] = charge; |
| 411 |
//20101208ysk start |
| 412 |
delivery_method[index]['days'] = days; |
| 413 |
//20101208ysk end |
| 414 |
//20101119ysk start |
| 415 |
delivery_method[index]['nocod'] = nocod; |
| 416 |
//20101119ysk end |
| 417 |
//20110317ysk start |
| 418 |
delivery_method[index]['intl'] = intl; |
| 419 |
//20110317ysk end |
| 420 |
operation.disp_delivery_method(id); |
| 421 |
$("#delivery_method_loading").html(''); |
| 422 |
}; |
| 423 |
$.ajax( s ); |
| 424 |
return false; |
| 425 |
}, |
| 426 |
|
| 427 |
update_delivery_method : function() { |
| 428 |
if($("input[name='delivery_method_name']").val() == "") return; |
| 429 |
|
| 430 |
$("#delivery_method_loading").html('<img src="<?php echo USCES_PLUGIN_URL; ?>/images/loading-publish.gif" />'); |
| 431 |
var id = $("#delivery_method_name_select option:selected").val(); |
| 432 |
var name = encodeURIComponent($("input[name='delivery_method_name']").val()); |
| 433 |
var time = encodeURIComponent($("#delivery_method_time").val()); |
| 434 |
var charge = $("#delivery_method_charge option:selected").val(); |
| 435 |
//20101208ysk start |
| 436 |
var days = $("#delivery_method_days option:selected").val(); |
| 437 |
//20101208ysk end |
| 438 |
//20101119ysk start |
| 439 |
var nocod = ($(':input[name=delivery_method_nocod]').attr('checked')) ? '1' : '0'; |
| 440 |
//20101119ysk end |
| 441 |
//20110317ysk start |
| 442 |
var intl = $(':radio[name=delivery_method_intl]:checked').val(); |
| 443 |
//20110317ysk end |
| 444 |
|
| 445 |
var s = operation.settings; |
| 446 |
//20101208ysk start |
| 447 |
//20101119ysk start |
| 448 |
//20110317ysk start |
| 449 |
//s.data = "action=shop_options_ajax&mode=update_delivery_method&name=" + name + "&id=" + id + "&time=" + time + "&charge=" + charge; |
| 450 |
//s.data = "action=shop_options_ajax&mode=update_delivery_method&name=" + name + "&id=" + id + "&time=" + time + "&charge=" + charge + "&nocod=" + nocod; |
| 451 |
//s.data = "action=shop_options_ajax&mode=update_delivery_method&name=" + name + "&id=" + id + "&time=" + time + "&charge=" + charge + "&days=" + days + "&nocod=" + nocod; |
| 452 |
s.data = "action=shop_options_ajax&mode=update_delivery_method&name=" + name + "&id=" + id + "&time=" + time + "&charge=" + charge + "&days=" + days + "&nocod=" + nocod + "&intl=" + intl; |
| 453 |
//20110317ysk end |
| 454 |
//20101119ysk end |
| 455 |
//20101208ysk end |
| 456 |
s.success = function(data, dataType){ |
| 457 |
var strs = data.split('#usces#'); |
| 458 |
var id = strs[0] - 0; |
| 459 |
var name = strs[1]; |
| 460 |
var time = strs[2]; |
| 461 |
var charge = strs[3]-0; |
| 462 |
//20101208ysk start |
| 463 |
var days = strs[4] - 0; |
| 464 |
//20101119ysk start |
| 465 |
//var nocod = strs[4]; |
| 466 |
var nocod = strs[5]; |
| 467 |
//20101119ysk end |
| 468 |
//20101208ysk end |
| 469 |
//20110317ysk start |
| 470 |
var intl = strs[6]; |
| 471 |
//20110317ysk end |
| 472 |
for(var i=0; i<delivery_method.length; i++){ |
| 473 |
if(id === delivery_method[i]['id']){ |
| 474 |
index = i; |
| 475 |
} |
| 476 |
} |
| 477 |
delivery_method[index]['name'] = name; |
| 478 |
delivery_method[index]['time'] = time; |
| 479 |
delivery_method[index]['charge'] = charge; |
| 480 |
//20101208ysk start |
| 481 |
delivery_method[index]['days'] = days; |
| 482 |
//20101208ysk end |
| 483 |
//20101119ysk start |
| 484 |
delivery_method[index]['nocod'] = nocod; |
| 485 |
//20101119ysk end |
| 486 |
//20110317ysk start |
| 487 |
delivery_method[index]['intl'] = intl; |
| 488 |
//20110317ysk end |
| 489 |
operation.disp_delivery_method(id); |
| 490 |
$("#delivery_method_loading").html(''); |
| 491 |
}; |
| 492 |
$.ajax( s ); |
| 493 |
return false; |
| 494 |
}, |
| 495 |
|
| 496 |
delete_delivery_method : function() { |
| 497 |
var delname = $("#delivery_method_name_select option:selected").html(); |
| 498 |
if(!confirm(<?php _e("'Are you sure of deleting the delivery method ' + delname + ' ?'", 'usces'); ?>)) return false; |
| 499 |
|
| 500 |
$("#delivery_method_loading").html('<img src="<?php echo USCES_PLUGIN_URL; ?>/images/loading-publish.gif" />'); |
| 501 |
var id = $("#delivery_method_name_select option:selected").val(); |
| 502 |
|
| 503 |
var s = operation.settings; |
| 504 |
s.data = "action=shop_options_ajax&mode=delete_delivery_method&id=" + id; |
| 505 |
s.success = function(data, dataType){ |
| 506 |
var strs = data.split('#usces#'); |
| 507 |
var id = strs[0] - 0; |
| 508 |
for(var i=0; i<delivery_method.length; i++){ |
| 509 |
if(id === delivery_method[i]['id']){ |
| 510 |
index = i; |
| 511 |
} |
| 512 |
} |
| 513 |
delivery_method.splice(index, 1); |
| 514 |
//operation.disp_delivery_method(delivery_method[0]['id']); |
| 515 |
operation.disp_delivery_method(0); |
| 516 |
$("#delivery_method_loading").html(''); |
| 517 |
}; |
| 518 |
$.ajax( s ); |
| 519 |
return false; |
| 520 |
}, |
| 521 |
|
| 522 |
onchange_delivery_select : function(index) { |
| 523 |
var id = $("#delivery_method_name_select option:eq("+index+")").val()-0; |
| 524 |
operation.disp_delivery_method(id); |
| 525 |
}, |
| 526 |
|
| 527 |
make_delivery_method_charge : function(selected) { |
| 528 |
var option = '<select name="delivery_method_charge" id="delivery_method_charge">'+"\n"; |
| 529 |
if(selected === -1){ |
| 530 |
option += '<option value="-1" selected="selected"><?php _e('Not fixing shipping.', 'usces'); ?></option>'+"\n"; |
| 531 |
}else{ |
| 532 |
option += '<option value="-1"><?php _e('Not fixing shipping.', 'usces'); ?></option>'+"\n"; |
| 533 |
} |
| 534 |
for(var i=0; i<shipping_charge.length; i++){ |
| 535 |
if(selected === shipping_charge[i]['id']){ |
| 536 |
option += '<option value="'+shipping_charge[i]['id']+'" selected="selected">'+shipping_charge[i]['name']+'</option>'+"\n"; |
| 537 |
}else{ |
| 538 |
option += '<option value="'+shipping_charge[i]['id']+'">'+shipping_charge[i]['name']+'</option>'+"\n"; |
| 539 |
} |
| 540 |
} |
| 541 |
option += '</select>'; |
| 542 |
$("#delivery_method_charge_td").html(option); |
| 543 |
}, |
| 544 |
//20101208ysk start |
| 545 |
make_delivery_method_days : function(selected) { |
| 546 |
var option = '<select name="delivery_method_days" id="delivery_method_days">'+"\n"; |
| 547 |
if(selected === -1){ |
| 548 |
option += '<option value="-1" selected="selected"><?php _e('Delivery Date Not Specified', 'usces'); ?></option>'+"\n"; |
| 549 |
}else{ |
| 550 |
option += '<option value="-1"><?php _e('Delivery Date Not Specified', 'usces'); ?></option>'+"\n"; |
| 551 |
} |
| 552 |
for(var i=0; i<delivery_days.length; i++){ |
| 553 |
if(selected === delivery_days[i]['id']){ |
| 554 |
option += '<option value="'+delivery_days[i]['id']+'" selected="selected">'+delivery_days[i]['name']+'</option>'+"\n"; |
| 555 |
}else{ |
| 556 |
option += '<option value="'+delivery_days[i]['id']+'">'+delivery_days[i]['name']+'</option>'+"\n"; |
| 557 |
} |
| 558 |
} |
| 559 |
option += '</select>'; |
| 560 |
$("#delivery_method_days_td").html(option); |
| 561 |
}, |
| 562 |
//20101208ysk end |
| 563 |
|
| 564 |
moveup_delivery_method : function(selected) { |
| 565 |
var index = 0; |
| 566 |
for(var i=0; i<delivery_method.length; i++){ |
| 567 |
if(selected === delivery_method[i]['id']){ |
| 568 |
index = i; |
| 569 |
} |
| 570 |
} |
| 571 |
if( 0 === index ) return; |
| 572 |
|
| 573 |
$("#delivery_method_loading").html('<img src="<?php echo USCES_PLUGIN_URL; ?>/images/loading-publish.gif" />'); |
| 574 |
|
| 575 |
var s = operation.settings; |
| 576 |
s.data = "action=shop_options_ajax&mode=moveup_delivery_method&id=" + selected; |
| 577 |
s.success = function(data, dataType){ |
| 578 |
var strs = data.split('#usces#'); |
| 579 |
var id = strs[0].split(','); |
| 580 |
var name = strs[1].split(','); |
| 581 |
var time = strs[2].split(','); |
| 582 |
var charge = strs[3].split(','); |
| 583 |
//20101208ysk start |
| 584 |
var days = strs[4].split(','); |
| 585 |
//20101119ysk start |
| 586 |
//var nocod = strs[4].split(','); |
| 587 |
////var selected = strs[4]-0; |
| 588 |
//var selected = strs[5]-0; |
| 589 |
var nocod = strs[5].split(','); |
| 590 |
//20110317ysk start |
| 591 |
var intl = strs[6].split(','); |
| 592 |
//var selected = strs[6]-0; |
| 593 |
var selected = strs[7]-0; |
| 594 |
//20110317ysk end |
| 595 |
//20101119ysk end |
| 596 |
//20101208ysk end |
| 597 |
var ct = delivery_method.length; |
| 598 |
for(var i=0; i<ct; i++){ |
| 599 |
delivery_method[i]['id'] = id[i]-0; |
| 600 |
delivery_method[i]['name'] = name[i]; |
| 601 |
delivery_method[i]['time'] = time[i]; |
| 602 |
delivery_method[i]['charge'] = charge[i]-0; |
| 603 |
//20101208ysk start |
| 604 |
delivery_method[i]['days'] = days[i]-0; |
| 605 |
//20101208ysk end |
| 606 |
//20101119ysk start |
| 607 |
delivery_method[i]['nocod'] = nocod[i]; |
| 608 |
//20101119ysk end |
| 609 |
//20110317ysk start |
| 610 |
delivery_method[i]['intl'] = intl[i]; |
| 611 |
//20110317ysk end |
| 612 |
} |
| 613 |
operation.disp_delivery_method(selected); |
| 614 |
$("#delivery_method_loading").html(''); |
| 615 |
}; |
| 616 |
$.ajax( s ); |
| 617 |
return false; |
| 618 |
}, |
| 619 |
|
| 620 |
movedown_delivery_method : function(selected) { |
| 621 |
var index = 0; |
| 622 |
var ct = delivery_method.length; |
| 623 |
for(var i=0; i<ct; i++){ |
| 624 |
if(selected === delivery_method[i]['id']){ |
| 625 |
index = i; |
| 626 |
} |
| 627 |
} |
| 628 |
if( index >= ct-1 ) return; |
| 629 |
|
| 630 |
$("#delivery_method_loading").html('<img src="<?php echo USCES_PLUGIN_URL; ?>/images/loading-publish.gif" />'); |
| 631 |
|
| 632 |
var s = operation.settings; |
| 633 |
s.data = "action=shop_options_ajax&mode=movedown_delivery_method&id=" + selected; |
| 634 |
s.success = function(data, dataType){ |
| 635 |
var strs = data.split('#usces#'); |
| 636 |
var id = strs[0].split(','); |
| 637 |
var name = strs[1].split(','); |
| 638 |
var time = strs[2].split(','); |
| 639 |
var charge = strs[3].split(','); |
| 640 |
//20101208ysk start |
| 641 |
var days = strs[4].split(','); |
| 642 |
//20101119ysk start |
| 643 |
//var nocod = strs[4].split(','); |
| 644 |
////var selected = strs[4]-0; |
| 645 |
//var selected = strs[5]-0; |
| 646 |
var nocod = strs[5].split(','); |
| 647 |
//20110317ysk start |
| 648 |
var intl = strs[6].split(','); |
| 649 |
//var selected = strs[6]-0; |
| 650 |
var selected = strs[7]-0; |
| 651 |
//20110317ysk end |
| 652 |
//20101119ysk end |
| 653 |
//20101208ysk end |
| 654 |
var ct = delivery_method.length; |
| 655 |
for(var i=0; i<ct; i++){ |
| 656 |
delivery_method[i]['id'] = id[i]-0; |
| 657 |
delivery_method[i]['name'] = name[i]; |
| 658 |
delivery_method[i]['time'] = time[i]; |
| 659 |
delivery_method[i]['charge'] = charge[i]-0; |
| 660 |
//20101208ysk start |
| 661 |
delivery_method[i]['days'] = days[i]-0; |
| 662 |
//20101208ysk end |
| 663 |
//20101119ysk start |
| 664 |
delivery_method[i]['nocod'] = nocod[i]; |
| 665 |
//20101119ysk end |
| 666 |
//20110317ysk start |
| 667 |
delivery_method[i]['intl'] = intl[i]; |
| 668 |
//20110317ysk end |
| 669 |
} |
| 670 |
operation.disp_delivery_method(selected); |
| 671 |
$("#delivery_method_loading").html(''); |
| 672 |
}; |
| 673 |
$.ajax( s ); |
| 674 |
return false; |
| 675 |
}, |
| 676 |
|
| 677 |
disp_shipping_charge : function (id){ |
| 678 |
var valuehtml = ''; |
| 679 |
if(shipping_charge.length === 0) { |
| 680 |
//20110317ysk start |
| 681 |
//for(var i=0; i<pref.length; i++){ |
| 682 |
// valuehtml += "<div class='clearfix'><label class='shipping_charge_label'>" + pref[i] + "</label><input type='text' name='shipping_charge_value[" + pref[i] + "]' value='' class='charge_text' /><?php usces_crcode(); ?></div>\n"; |
| 683 |
//} |
| 684 |
//20120710ysk start 0000472 |
| 685 |
//for(var i=0; i<pref[base_country].length; i++){ |
| 686 |
// valuehtml += "<div class='clearfix'><label class='shipping_charge_label'>" + pref[base_country][i] + "</label><input type='text' name='shipping_charge_value[" + pref[base_country][i] + "]' value='' class='charge_text' /><?php usces_crcode(); ?></div>\n"; |
| 687 |
//} |
| 688 |
for( var j = 0; j < target_market.length; j++ ) { |
| 689 |
var tm = target_market[j]; |
| 690 |
valuehtml += "<div id='shipping_charge_"+tm+"'>"; |
| 691 |
for( var i = 0; i < pref[tm].length; i++ ) { |
| 692 |
var p = pref[tm][i]; |
| 693 |
valuehtml += "<div class='clearfix'><label class='shipping_charge_label'>"+p+"</label><input type='text' name=\"shipping_charge_value_"+tm+"["+p+"]\" value='' class='charge_text' /><?php usces_crcode(); ?></div>\n"; |
| 694 |
} |
| 695 |
valuehtml += "</div>"; |
| 696 |
} |
| 697 |
//$("#shipping_charge_country").val(base_country); |
| 698 |
//20120710ysk end |
| 699 |
//20110317ysk end |
| 700 |
$("#shipping_charge_name").html('<input name="shipping_charge_name" type="text" value="" />'); |
| 701 |
$("#shipping_charge_name2").html(''); |
| 702 |
$("#shipping_charge_value").html(valuehtml); |
| 703 |
$("#shipping_charge_button").html('<input name="add_shipping_charge" id="add_shipping_charge" type="button" value="<?php _e('Add', 'usces'); ?>" onclick="operation.add_shipping_charge();" />'); |
| 704 |
}else{ |
| 705 |
var selected = 0; |
| 706 |
//20110317ysk start |
| 707 |
//var country = base_country;//20120710ysk 0000472 |
| 708 |
//20110317ysk end |
| 709 |
var name_select = '<select name="shipping_charge_name_select" id="shipping_charge_name_select" onchange="operation.onchange_shipping_charge(this.selectedIndex);">'+"\n"; |
| 710 |
for(var i=0; i<shipping_charge.length; i++){ |
| 711 |
if(shipping_charge[i]['id'] === id){ |
| 712 |
selected = i; |
| 713 |
//20110317ysk start |
| 714 |
//country = shipping_charge[i]['country'];//20120710ysk 0000472 |
| 715 |
//20110317ysk end |
| 716 |
name_select += '<option value="'+shipping_charge[i]['id']+'" selected="selected">'+shipping_charge[i]['name']+'</option>'+"\n"; |
| 717 |
}else{ |
| 718 |
name_select += '<option value="'+shipping_charge[i]['id']+'">'+shipping_charge[i]['name']+'</option>'+"\n"; |
| 719 |
} |
| 720 |
} |
| 721 |
name_select += "</select>\n"; |
| 722 |
//20110317ysk start |
| 723 |
var value = ''; |
| 724 |
//for(var i=0; i<pref.length; i++){ |
| 725 |
// valuehtml += "<div class='clearfix'><label class='shipping_charge_label'>" + pref[i] + "</label><input type='text' name='shipping_charge_value[" + pref[i] + "]' value='" + shipping_charge[selected]['value'][pref[i]] + "' class='charge_text' /><?php usces_crcode(); ?></div>\n"; |
| 726 |
//} |
| 727 |
//20120710ysk start 0000472 |
| 728 |
//for(var i=0; i<pref[country].length; i++){ |
| 729 |
// value = (shipping_charge[selected]['value'][pref[country][i]] == undefined) ? '' : shipping_charge[selected]['value'][pref[country][i]]; |
| 730 |
// valuehtml += "<div class='clearfix'><label class='shipping_charge_label'>" + pref[country][i] + "</label><input type='text' name='shipping_charge_value[" + pref[country][i] + "]' value='" + value + "' class='charge_text' /><?php usces_crcode(); ?></div>\n"; |
| 731 |
//} |
| 732 |
for( var j = 0; j < target_market.length; j++ ) { |
| 733 |
var tm = target_market[j]; |
| 734 |
valuehtml += "<div id='shipping_charge_"+tm+"'>"; |
| 735 |
for( var i = 0; i < pref[tm].length; i++ ) { |
| 736 |
var p = pref[tm][i]; |
| 737 |
value = ( shipping_charge[selected][tm][p] == undefined ) ? '' : shipping_charge[selected][tm][p]; |
| 738 |
valuehtml += "<div class='clearfix'><label class='shipping_charge_label'>"+p+"</label><input type='text' name=\"shipping_charge_value_"+tm+"["+p+"]\" value='"+value+"' class='charge_text' /><?php usces_crcode(); ?></div>\n"; |
| 739 |
} |
| 740 |
valuehtml += "</div>"; |
| 741 |
} |
| 742 |
//$("#shipping_charge_country").val(country); |
| 743 |
//20120710ysk end |
| 744 |
//20110317ysk end |
| 745 |
$("#shipping_charge_name").html(name_select); |
| 746 |
$("#shipping_charge_name2").html('<input name="shipping_charge_name" type="text" value="'+shipping_charge[selected]['name']+'" />'); |
| 747 |
$("#shipping_charge_value").html(valuehtml); |
| 748 |
$("#shipping_charge_button").html("<input name='delete_shipping_charge' id='delete_shipping_charge' type='button' value='<?php _e('Delete', 'usces'); ?>' onclick='operation.delete_shipping_charge();' /><input name='update_shipping_charge' id='update_shipping_charge' type='button' value='<?php _e('update', 'usces'); ?>' onclick='operation.update_shipping_charge();' />"); |
| 749 |
} |
| 750 |
$(".charge_text").bind("change", function(){ usces_check_money($(this)); }); |
| 751 |
//20120710ysk start 0000472 |
| 752 |
var country = $("#shipping_charge_country option:selected").val(); |
| 753 |
for( var i = 0; i < target_market.length; i++ ) { |
| 754 |
if( country == target_market[i] ) { |
| 755 |
$("#shipping_charge_"+target_market[i]).css("display",""); |
| 756 |
} else { |
| 757 |
$("#shipping_charge_"+target_market[i]).css("display","none"); |
| 758 |
} |
| 759 |
} |
| 760 |
//20120710ysk end |
| 761 |
}, |
| 762 |
|
| 763 |
add_shipping_charge : function() { |
| 764 |
var error = 0; |
| 765 |
if($("input[name='shipping_charge_name']").val() == "") { |
| 766 |
error++; |
| 767 |
$("input[name='shipping_charge_name']").css({'background-color': '#FFA'}).click(function() { |
| 768 |
$(this).css({'background-color': '#FFF'}); |
| 769 |
}); |
| 770 |
} |
| 771 |
//20120710ysk start 0000472 |
| 772 |
//var country = $("#shipping_charge_country").val(); |
| 773 |
//for(var i=0; i<pref[country].length; i++){ |
| 774 |
// var value = $("input[name='shipping_charge_value\[" + pref[country][i] + "\]']").val(); |
| 775 |
// if( "" == value || !checkNum(value) ) { |
| 776 |
// error++; |
| 777 |
// $("input[name='shipping_charge_value\[" + pref[country][i] + "\]']").css({'background-color': '#FFA'}).click(function() { |
| 778 |
// $(this).css({'background-color': '#FFF'}); |
| 779 |
// }); |
| 780 |
// } |
| 781 |
//} |
| 782 |
for( var j = 0; j < target_market.length; j++ ) { |
| 783 |
var tm = target_market[j]; |
| 784 |
for( var i = 0; i < pref[tm].length; i++ ) { |
| 785 |
var p = pref[tm][i]; |
| 786 |
var value = $("input[name=\"shipping_charge_value_"+tm+"\["+p+"\]\"]").val(); |
| 787 |
if( "" == value || !checkNum(value) ) { |
| 788 |
error++; |
| 789 |
$("input[name=\"shipping_charge_value_"+tm+"\["+p+"\]\"]").css({'background-color': '#FFA'}).click(function() { |
| 790 |
$(this).css({'background-color': '#FFF'}); |
| 791 |
}); |
| 792 |
} |
| 793 |
} |
| 794 |
} |
| 795 |
//20120710ysk end |
| 796 |
if( 0 < error ) { |
| 797 |
alert("データに不備があります。"); |
| 798 |
return false; |
| 799 |
} |
| 800 |
|
| 801 |
$("#shipping_charge_loading").html('<img src="<?php echo USCES_PLUGIN_URL; ?>/images/loading-publish.gif" />'); |
| 802 |
var name = encodeURIComponent($("input[name='shipping_charge_name']").val()); |
| 803 |
var query = ''; |
| 804 |
//20110317ysk start |
| 805 |
//var country = $("#shipping_charge_country").val(); |
| 806 |
//for(var i=0; i<pref.length; i++){ |
| 807 |
// query += '&value[]=' + $("input[name='shipping_charge_value\[" + pref[i] + "\]']").val(); |
| 808 |
//} |
| 809 |
//20120710ysk start 0000472 |
| 810 |
//for(var i=0; i<pref[country].length; i++){ |
| 811 |
// query += '&value[]=' + $("input[name='shipping_charge_value\[" + pref[country][i] + "\]']").val(); |
| 812 |
//} |
| 813 |
for( var j = 0; j < target_market.length; j++ ) { |
| 814 |
var tm = target_market[j]; |
| 815 |
for( var i = 0; i < pref[tm].length; i++ ) { |
| 816 |
query += '&value_'+tm+'[]='+$("input[name=\"shipping_charge_value_"+tm+"\["+pref[tm][i]+"\]\"]").val(); |
| 817 |
} |
| 818 |
} |
| 819 |
//20120710ysk end |
| 820 |
//20110317ysk end |
| 821 |
|
| 822 |
var s = operation.settings; |
| 823 |
//20110317ysk start |
| 824 |
//s.data = "action=shop_options_ajax&mode=add_shipping_charge&name=" + name + query; |
| 825 |
//20120710ysk start 0000472 |
| 826 |
//s.data = "action=shop_options_ajax&mode=add_shipping_charge&name=" + name + "&country=" + country + query; |
| 827 |
s.data = "action=shop_options_ajax&mode=add_shipping_charge&name="+name+query; |
| 828 |
//20120710ysk end |
| 829 |
//20110317ysk end |
| 830 |
s.success = function(data, dataType){ |
| 831 |
//20120710ysk start 0000472 |
| 832 |
//var strs = data.split('#usces#'); |
| 833 |
//var id = strs[0] - 0; |
| 834 |
var id = data - 0; |
| 835 |
//var name = strs[1]; |
| 836 |
//20110317ysk start |
| 837 |
//var country = strs[2]; |
| 838 |
//var value = strs[2].split(','); |
| 839 |
//var value = strs[3].split(','); |
| 840 |
//20120710ysk end |
| 841 |
//20110317ysk end |
| 842 |
var index = shipping_charge.length; |
| 843 |
shipping_charge[index] = []; |
| 844 |
shipping_charge[index]['id'] = id; |
| 845 |
//20120710ysk start 0000472 |
| 846 |
//shipping_charge[index]['name'] = name; |
| 847 |
shipping_charge[index]['name'] = $("input[name='shipping_charge_name']").val(); |
| 848 |
//shipping_charge[index]['value'] = []; |
| 849 |
//20110317ysk start |
| 850 |
//shipping_charge[index]['country'] = country; |
| 851 |
//for(var i=0; i<pref.length; i++){ |
| 852 |
// shipping_charge[index]['value'][pref[i]] = value[i]; |
| 853 |
//} |
| 854 |
//for(var i=0; i<pref[country].length; i++){ |
| 855 |
// shipping_charge[index]['value'][pref[country][i]] = value[i]; |
| 856 |
//} |
| 857 |
for( var j = 0; j < target_market.length; j++ ) { |
| 858 |
var tm = target_market[j]; |
| 859 |
shipping_charge[index][tm] = []; |
| 860 |
for( var i = 0; i < pref[tm].length; i++ ) { |
| 861 |
var p = pref[tm][i]; |
| 862 |
shipping_charge[index][tm][p] = $("input[name=\"shipping_charge_value_"+tm+"\["+p+"\]\"]").val(); |
| 863 |
} |
| 864 |
} |
| 865 |
//20120710ysk end |
| 866 |
//20110317ysk end |
| 867 |
operation.disp_shipping_charge(id); |
| 868 |
operation.make_delivery_method_charge(get_delivery_method_charge(selected_method)); |
| 869 |
$("#shipping_charge_loading").html(''); |
| 870 |
|
| 871 |
}; |
| 872 |
$.ajax( s ); |
| 873 |
return false; |
| 874 |
}, |
| 875 |
|
| 876 |
update_shipping_charge : function() { |
| 877 |
var error = 0; |
| 878 |
if($("input[name='shipping_charge_name']").val() == "") { |
| 879 |
error++; |
| 880 |
$("input[name='shipping_charge_name']").css({'background-color': '#FFA'}).click(function() { |
| 881 |
$(this).css({'background-color': '#FFF'}); |
| 882 |
}); |
| 883 |
} |
| 884 |
//20120710ysk start 0000472 |
| 885 |
//var country = $("#shipping_charge_country").val(); |
| 886 |
//for(var i=0; i<pref[country].length; i++){ |
| 887 |
// var value = $("input[name='shipping_charge_value\[" + pref[country][i] + "\]']").val(); |
| 888 |
// if( "" == value || !checkNum(value) ) { |
| 889 |
// error++; |
| 890 |
// $("input[name='shipping_charge_value\[" + pref[country][i] + "\]']").css({'background-color': '#FFA'}).click(function() { |
| 891 |
// $(this).css({'background-color': '#FFF'}); |
| 892 |
// }); |
| 893 |
// } |
| 894 |
//} |
| 895 |
for( var j = 0; j < target_market.length; j++ ) { |
| 896 |
var tm = target_market[j]; |
| 897 |
for( var i = 0; i < pref[tm].length; i++ ) { |
| 898 |
var p = pref[tm][i]; |
| 899 |
var value = $("input[name=\"shipping_charge_value_"+tm+"\["+p+"\]\"]").val(); |
| 900 |
if( "" == value || !checkNum(value) ) { |
| 901 |
error++; |
| 902 |
$("input[name=\"shipping_charge_value_"+tm+"\["+p+"\]\"]").css({'background-color': '#FFA'}).click(function() { |
| 903 |
$(this).css({'background-color': '#FFF'}); |
| 904 |
}); |
| 905 |
} |
| 906 |
} |
| 907 |
} |
| 908 |
//20120710ysk end |
| 909 |
if( 0 < error ) { |
| 910 |
alert("データに不備があります。"); |
| 911 |
return false; |
| 912 |
} |
| 913 |
|
| 914 |
$("#shipping_charge_loading").html('<img src="<?php echo USCES_PLUGIN_URL; ?>/images/loading-publish.gif" />'); |
| 915 |
var id = $("#shipping_charge_name_select option:selected").val(); |
| 916 |
var name = encodeURIComponent($("input[name='shipping_charge_name']").val()); |
| 917 |
var query = ''; |
| 918 |
//20110317ysk start |
| 919 |
//var country = $("#shipping_charge_country").val(); |
| 920 |
//for(var i=0; i<pref.length; i++){ |
| 921 |
// query += '&value[]=' + $("input[name='shipping_charge_value\[" + pref[i] + "\]']").val(); |
| 922 |
//} |
| 923 |
//20120710ysk start 0000472 |
| 924 |
//for(var i=0; i<pref[country].length; i++){ |
| 925 |
// query += '&value[]=' + $("input[name='shipping_charge_value\[" + pref[country][i] + "\]']").val(); |
| 926 |
//} |
| 927 |
for( var j = 0; j < target_market.length; j++ ) { |
| 928 |
var tm = target_market[j]; |
| 929 |
for( var i = 0; i < pref[tm].length; i++ ){ |
| 930 |
query += '&value_'+tm+'[]='+$("input[name=\"shipping_charge_value_"+tm+"\["+pref[tm][i]+"\]\"]").val(); |
| 931 |
} |
| 932 |
} |
| 933 |
//20120710ysk end |
| 934 |
//20110317ysk end |
| 935 |
var s = operation.settings; |
| 936 |
//20110317ysk start |
| 937 |
//s.data = "action=shop_options_ajax&mode=update_shipping_charge&id=" + id + "&name=" + name + query; |
| 938 |
//20120710ysk start 0000472 |
| 939 |
//s.data = "action=shop_options_ajax&mode=update_shipping_charge&id=" + id + "&name=" + name + "&country=" + country + query; |
| 940 |
s.data = "action=shop_options_ajax&mode=update_shipping_charge&id="+id+"&name="+name+query; |
| 941 |
//20120710ysk end |
| 942 |
//20110317ysk end |
| 943 |
s.success = function(data, dataType){ |
| 944 |
//20120710ysk start 0000472 |
| 945 |
//var strs = data.split('#usces#'); |
| 946 |
//var id = strs[0] - 0; |
| 947 |
var id = data - 0; |
| 948 |
//var name = strs[1]; |
| 949 |
//20110317ysk start |
| 950 |
//var country = strs[2]; |
| 951 |
//var value = strs[2].split(','); |
| 952 |
//var value = strs[3].split(','); |
| 953 |
//20120710ysk end |
| 954 |
//20110317ysk end |
| 955 |
for(var i=0; i<shipping_charge.length; i++){ |
| 956 |
if(id === shipping_charge[i]['id']){ |
| 957 |
index = i; |
| 958 |
} |
| 959 |
} |
| 960 |
//20120710ysk start 0000472 |
| 961 |
// shipping_charge[index]['name'] = name; |
| 962 |
shipping_charge[index]['name'] = $("input[name='shipping_charge_name']").val(); |
| 963 |
//20110317ysk start |
| 964 |
// shipping_charge[index]['value'] = []; |
| 965 |
// shipping_charge[index]['country'] = country; |
| 966 |
// //for(var i=0; i<pref.length; i++){ |
| 967 |
// // shipping_charge[index]['value'][pref[i]] = value[i]; |
| 968 |
// //} |
| 969 |
// for(var i=0; i<pref[country].length; i++){ |
| 970 |
// shipping_charge[index]['value'][pref[country][i]] = value[i]; |
| 971 |
// } |
| 972 |
for( var j = 0; j < target_market.length; j++ ) { |
| 973 |
var tm = target_market[j]; |
| 974 |
for( var i = 0; i < pref[tm].length; i++ ) { |
| 975 |
var p = pref[tm][i]; |
| 976 |
shipping_charge[index][tm][p] = $("input[name=\"shipping_charge_value_"+tm+"\["+p+"\]\"]").val(); |
| 977 |
} |
| 978 |
} |
| 979 |
//20120710ysk end |
| 980 |
//20110317ysk end |
| 981 |
operation.disp_shipping_charge(id); |
| 982 |
operation.make_delivery_method_charge(get_delivery_method_charge(selected_method)); |
| 983 |
$("#shipping_charge_loading").html(''); |
| 984 |
}; |
| 985 |
$.ajax( s ); |
| 986 |
return false; |
| 987 |
}, |
| 988 |
|
| 989 |
delete_shipping_charge : function() { |
| 990 |
var delname = $("#shipping_charge_name_select option:selected").html(); |
| 991 |
if(!confirm(<?php _e("'Are you sure of deleting shipping [' + delname + ']?'", 'usces'); ?>)) return false; |
| 992 |
|
| 993 |
$("#shipping_charge_loading").html('<img src="<?php echo USCES_PLUGIN_URL; ?>/images/loading-publish.gif" />'); |
| 994 |
var id = $("#shipping_charge_name_select option:selected").val(); |
| 995 |
var s = operation.settings; |
| 996 |
s.data = "action=shop_options_ajax&mode=delete_shipping_charge&id=" + id; |
| 997 |
s.success = function(data, dataType){ |
| 998 |
var strs = data.split('#usces#'); |
| 999 |
var id = strs[0] - 0; |
| 1000 |
for(var i=0; i<shipping_charge.length; i++){ |
| 1001 |
if(id === shipping_charge[i]['id']){ |
| 1002 |
index = i; |
| 1003 |
} |
| 1004 |
} |
| 1005 |
shipping_charge.splice(index, 1); |
| 1006 |
operation.disp_shipping_charge(0); |
| 1007 |
operation.make_delivery_method_charge(get_delivery_method_charge(selected_method)); |
| 1008 |
$("#shipping_charge_loading").html(''); |
| 1009 |
}; |
| 1010 |
$.ajax( s ); |
| 1011 |
return false; |
| 1012 |
}, |
| 1013 |
|
| 1014 |
onchange_shipping_charge : function(index) { |
| 1015 |
var id = $("#shipping_charge_name_select option:eq("+index+")").val()-0; |
| 1016 |
operation.disp_shipping_charge(id); |
| 1017 |
}, |
| 1018 |
|
| 1019 |
allCharge : function () { |
| 1020 |
var charge = $("#allcharge").val(); |
| 1021 |
if( charge == '' ) return; |
| 1022 |
if( confirm(<?php echo sprintf(__("'Are you sure of setting shiping to %s' + charge + ' for all the prefecture?'", 'usces'), esc_js(usces_crsymbol('return', 'js'))); ?>) ){ |
| 1023 |
//20110317ysk start |
| 1024 |
var country = $("#shipping_charge_country option:selected").val(); |
| 1025 |
//for(var i=0; i<pref.length; i++){ |
| 1026 |
// $("input[name='shipping_charge_value\[" + pref[i] + "\]']").val(charge); |
| 1027 |
//} |
| 1028 |
//20120710ysk start 0000472 |
| 1029 |
//for(var i=0; i<pref[country].length; i++){ |
| 1030 |
// $("input[name='shipping_charge_value\[" + pref[country][i] + "\]']").val(charge); |
| 1031 |
//} |
| 1032 |
for( var i = 0; i < pref[country].length; i++ ) { |
| 1033 |
$("input[name=\"shipping_charge_value_"+country+"\["+pref[country][i]+"\]\"]").val(charge); |
| 1034 |
} |
| 1035 |
//20120710ysk end |
| 1036 |
//20110317ysk end |
| 1037 |
$("#allcharge").val(""); |
| 1038 |
} |
| 1039 |
}, |
| 1040 |
|
| 1041 |
//20101208ysk start |
| 1042 |
disp_delivery_days :function (id){ |
| 1043 |
var valuehtml = ''; |
| 1044 |
if(delivery_days.length === 0) { |
| 1045 |
//20110317ysk start |
| 1046 |
//for(var i=0; i<pref.length; i++){ |
| 1047 |
// valuehtml += "<div class='clearfix'><label class='delivery_days_label'>" + pref[i] + "</label><input type='text' name='delivery_days_value[" + pref[i] + "]' value='' class='days_text' /><?php _e('day', 'usces'); ?></div>\n"; |
| 1048 |
//} |
| 1049 |
//20120710ysk start 0000472 |
| 1050 |
//for(var i=0; i<pref[base_country].length; i++){ |
| 1051 |
// valuehtml += "<div class='clearfix'><label class='delivery_days_label'>" + pref[base_country][i] + "</label><input type='text' name='delivery_days_value[" + pref[base_country][i] + "]' value='' class='days_text' /><?php _e('day', 'usces'); ?></div>\n"; |
| 1052 |
//} |
| 1053 |
for( var j = 0; j < target_market.length; j++ ) { |
| 1054 |
var tm = target_market[j]; |
| 1055 |
valuehtml += "<div id='delivery_days_"+tm+"'>"; |
| 1056 |
for( var i = 0; i < pref[tm].length; i++ ) { |
| 1057 |
var p = pref[tm][i]; |
| 1058 |
valuehtml += "<div class='clearfix'><label class='delivery_days_label'>"+p+"</label><input type='text' name=\"delivery_days_value_"+tm+"["+p+"]\" value='' class='charge_text' /><?php _e('day', 'usces'); ?></div>\n"; |
| 1059 |
} |
| 1060 |
valuehtml += "</div>"; |
| 1061 |
} |
| 1062 |
//$("#delivery_days_country").val(base_country); |
| 1063 |
//20110317ysk end |
| 1064 |
$("#delivery_days_name").html('<input name="delivery_days_name" type="text" value="" />'); |
| 1065 |
$("#delivery_days_name2").html(''); |
| 1066 |
$("#delivery_days_value").html(valuehtml); |
| 1067 |
$("#delivery_days_button").html('<input name="add_delivery_days" id="add_delivery_days" type="button" value="<?php _e('Add', 'usces'); ?>" onclick="operation.add_delivery_days();" />'); |
| 1068 |
}else{ |
| 1069 |
var selected = 0; |
| 1070 |
//20110317ysk start |
| 1071 |
//var country = base_country;//20120710ysk 0000472 |
| 1072 |
//20110317ysk end |
| 1073 |
var name_select = '<select name="delivery_days_name_select" id="delivery_days_name_select" onchange="operation.onchange_delivery_days(this.selectedIndex);">'+"\n"; |
| 1074 |
for(var i=0; i<delivery_days.length; i++){ |
| 1075 |
if(delivery_days[i]['id'] === id){ |
| 1076 |
selected = i; |
| 1077 |
//20110317ysk start |
| 1078 |
//country = delivery_days[i]['country'];//20120710ysk 0000472 |
| 1079 |
//20110317ysk end |
| 1080 |
name_select += '<option value="'+delivery_days[i]['id']+'" selected="selected">'+delivery_days[i]['name']+'</option>'+"\n"; |
| 1081 |
}else{ |
| 1082 |
name_select += '<option value="'+delivery_days[i]['id']+'">'+delivery_days[i]['name']+'</option>'+"\n"; |
| 1083 |
} |
| 1084 |
} |
| 1085 |
name_select += "</select>\n"; |
| 1086 |
//20110317ysk start |
| 1087 |
var value = ''; |
| 1088 |
//for(var i=0; i<pref.length; i++){ |
| 1089 |
// valuehtml += "<div class='clearfix'><label class='delivery_days_label'>" + pref[i] + "</label><input type='text' name='delivery_days_value[" + pref[i] + "]' value='" + delivery_days[selected]['value'][pref[i]] + "' class='days_text' /><?php _e('day', 'usces'); ?></div>\n"; |
| 1090 |
//} |
| 1091 |
//20120710ysk start 0000472 |
| 1092 |
//for(var i=0; i<pref[country].length; i++){ |
| 1093 |
// //value = (delivery_days[selected]['value'][pref[country][i]] == undefined) ? '' : delivery_days[selected]['value'][pref[country][i]]; |
| 1094 |
// value = (delivery_days[selected] == undefined || delivery_days[selected]['value'][pref[country][i]] == undefined) ? '' : delivery_days[selected]['value'][pref[country][i]]; |
| 1095 |
// valuehtml += "<div class='clearfix'><label class='delivery_days_label'>" + pref[country][i] + "</label><input type='text' name='delivery_days_value[" + pref[country][i] + "]' value='" + value + "' class='days_text' /><?php _e('day', 'usces'); ?></div>\n"; |
| 1096 |
//} |
| 1097 |
for( var j = 0; j < target_market.length; j++ ) { |
| 1098 |
var tm = target_market[j]; |
| 1099 |
valuehtml += "<div id='delivery_days_"+tm+"'>"; |
| 1100 |
for( var i = 0; i < pref[tm].length; i++ ) { |
| 1101 |
var p = pref[tm][i]; |
| 1102 |
value = ( delivery_days[selected][tm][p] == undefined ) ? '' : delivery_days[selected][tm][p]; |
| 1103 |
valuehtml += "<div class='clearfix'><label class='delivery_days_label'>"+p+"</label><input type='text' name=\"delivery_days_value_"+tm+"["+p+"]\" value='"+value+"' class='charge_text' /><?php _e('day', 'usces'); ?></div>\n"; |
| 1104 |
} |
| 1105 |
valuehtml += "</div>"; |
| 1106 |
} |
| 1107 |
//$("#delivery_days_country").val(country); |
| 1108 |
//20120710ysk end |
| 1109 |
//20110317ysk end |
| 1110 |
$("#delivery_days_name").html(name_select); |
| 1111 |
$("#delivery_days_name2").html('<input name="delivery_days_name" type="text" value="'+delivery_days[selected]['name']+'" />'); |
| 1112 |
$("#delivery_days_value").html(valuehtml); |
| 1113 |
$("#delivery_days_button").html("<input name='delete_delivery_days' id='delete_delivery_days' type='button' value='<?php _e('Delete', 'usces'); ?>' onclick='operation.delete_delivery_days();' /><input name='update_delivery_days' id='update_delivery_days' type='button' value='<?php _e('update', 'usces'); ?>' onclick='operation.update_delivery_days();' />"); |
| 1114 |
} |
| 1115 |
$(".days_text").bind("change", function(){ usces_check_num($(this)); }); |
| 1116 |
//20120710ysk start 0000472 |
| 1117 |
var country = $("#delivery_days_country option:selected").val(); |
| 1118 |
for( var i = 0; i < target_market.length; i++ ) { |
| 1119 |
if( country == target_market[i] ) { |
| 1120 |
$("#delivery_days_"+target_market[i]).css("display",""); |
| 1121 |
} else { |
| 1122 |
$("#delivery_days_"+target_market[i]).css("display","none"); |
| 1123 |
} |
| 1124 |
} |
| 1125 |
//20120710ysk end |
| 1126 |
}, |
| 1127 |
|
| 1128 |
add_delivery_days : function() { |
| 1129 |
var error = 0; |
| 1130 |
if($("input[name='delivery_days_name']").val() == "") { |
| 1131 |
error++; |
| 1132 |
$("input[name='delivery_days_name']").css({'background-color': '#FFA'}).click(function() { |
| 1133 |
$(this).css({'background-color': '#FFF'}); |
| 1134 |
}); |
| 1135 |
} |
| 1136 |
//20120710ysk start 0000472 |
| 1137 |
//var country = $("#delivery_days_country").val(); |
| 1138 |
//for(var i=0; i<pref[country].length; i++){ |
| 1139 |
// var value = $("input[name='delivery_days_value\[" + pref[country][i] + "\]']").val(); |
| 1140 |
// if( "" == value || !checkNum(value) ) { |
| 1141 |
// error++; |
| 1142 |
// $("input[name='delivery_days_value\[" + pref[country][i] + "\]']").css({'background-color': '#FFA'}).click(function() { |
| 1143 |
// $(this).css({'background-color': '#FFF'}); |
| 1144 |
// }); |
| 1145 |
// } |
| 1146 |
//} |
| 1147 |
for( var j = 0; j < target_market.length; j++ ) { |
| 1148 |
var tm = target_market[j]; |
| 1149 |
for( var i = 0; i < pref[tm].length; i++ ) { |
| 1150 |
var p = pref[tm][i]; |
| 1151 |
var value = $("input[name=\"delivery_days_value_"+tm+"\["+p+"\]\"]").val(); |
| 1152 |
if( "" == value || !checkNum(value) ) { |
| 1153 |
error++; |
| 1154 |
$("input[name=\"delivery_days_value_"+tm+"\["+p+"\]\"]").css({'background-color': '#FFA'}).click(function() { |
| 1155 |
$(this).css({'background-color': '#FFF'}); |
| 1156 |
}); |
| 1157 |
} |
| 1158 |
} |
| 1159 |
} |
| 1160 |
//20120710ysk end |
| 1161 |
if( 0 < error ) { |
| 1162 |
alert("データに不備があります。"); |
| 1163 |
return false; |
| 1164 |
} |
| 1165 |
|
| 1166 |
$("#delivery_days_loading").html('<img src="<?php echo USCES_PLUGIN_URL; ?>/images/loading-publish.gif" />'); |
| 1167 |
var name = $("input[name='delivery_days_name']").val(); |
| 1168 |
var query = ''; |
| 1169 |
//20110317ysk start |
| 1170 |
//var country = $("#delivery_days_country").val(); |
| 1171 |
//for(var i=0; i<pref.length; i++){ |
| 1172 |
// query += '&value[]=' + $("input[name='delivery_days_value\[" + pref[i] + "\]']").val(); |
| 1173 |
//} |
| 1174 |
//20120710ysk start 0000472 |
| 1175 |
//for(var i=0; i<pref[country].length; i++){ |
| 1176 |
// query += '&value[]=' + $("input[name='delivery_days_value\[" + pref[country][i] + "\]']").val(); |
| 1177 |
//} |
| 1178 |
for( var j = 0; j < target_market.length; j++ ) { |
| 1179 |
var tm = target_market[j]; |
| 1180 |
for( var i = 0; i < pref[tm].length; i++ ) { |
| 1181 |
query += '&value_'+tm+'[]='+$("input[name=\"delivery_days_value_"+tm+"\["+pref[tm][i]+"\]\"]").val(); |
| 1182 |
} |
| 1183 |
} |
| 1184 |
//20120710ysk end |
| 1185 |
//20110317ysk end |
| 1186 |
|
| 1187 |
var s = operation.settings; |
| 1188 |
//20110317ysk start |
| 1189 |
//s.data = "action=shop_options_ajax&mode=add_delivery_days&name=" + name + query; |
| 1190 |
//20120710ysk start 0000472 |
| 1191 |
//s.data = "action=shop_options_ajax&mode=add_delivery_days&name=" + name + "&country=" + country + query; |
| 1192 |
s.data = "action=shop_options_ajax&mode=add_delivery_days&name="+name+query; |
| 1193 |
//20120710ysk end |
| 1194 |
//20110317ysk end |
| 1195 |
s.success = function(data, dataType){ |
| 1196 |
//20120710ysk start 0000472 |
| 1197 |
//var strs = data.split('#usces#'); |
| 1198 |
//var id = strs[0] - 0; |
| 1199 |
var id = data - 0; |
| 1200 |
//var name = strs[1]; |
| 1201 |
//20110317ysk start |
| 1202 |
//var country = strs[2]; |
| 1203 |
//var value = strs[2].split(','); |
| 1204 |
//var value = strs[3].split(','); |
| 1205 |
//20120710ysk end |
| 1206 |
//20110317ysk end |
| 1207 |
var index = delivery_days.length; |
| 1208 |
delivery_days[index] = []; |
| 1209 |
delivery_days[index]['id'] = id; |
| 1210 |
//20120710ysk start 0000472 |
| 1211 |
//delivery_days[index]['name'] = name; |
| 1212 |
delivery_days[index]['name'] = $("input[name='delivery_days_name']").val(); |
| 1213 |
//delivery_days[index]['value'] = []; |
| 1214 |
//20110317ysk start |
| 1215 |
//delivery_days[index]['country'] = country; |
| 1216 |
//for(var i=0; i<pref.length; i++){ |
| 1217 |
// delivery_days[index]['value'][pref[i]] = value[i]; |
| 1218 |
//} |
| 1219 |
//for(var i=0; i<pref[country].length; i++){ |
| 1220 |
// delivery_days[index]['value'][pref[country][i]] = value[i]; |
| 1221 |
//} |
| 1222 |
for( var j = 0; j < target_market.length; j++ ) { |
| 1223 |
var tm = target_market[j]; |
| 1224 |
delivery_days[index][tm] = []; |
| 1225 |
for( var i = 0; i < pref[tm].length; i++ ) { |
| 1226 |
var p = pref[tm][i]; |
| 1227 |
delivery_days[index][tm][p] = $("input[name=\"delivery_days_value_"+tm+"\["+p+"\]\"]").val(); |
| 1228 |
} |
| 1229 |
} |
| 1230 |
//20120710ysk end |
| 1231 |
//20110317ysk end |
| 1232 |
operation.disp_delivery_days(id); |
| 1233 |
operation.make_delivery_method_days(get_delivery_method_days(selected_method)); |
| 1234 |
$("#delivery_days_loading").html(''); |
| 1235 |
|
| 1236 |
}; |
| 1237 |
$.ajax( s ); |
| 1238 |
return false; |
| 1239 |
}, |
| 1240 |
|
| 1241 |
update_delivery_days : function() { |
| 1242 |
var error = 0; |
| 1243 |
if($("input[name='delivery_days_name']").val() == "") { |
| 1244 |
error++; |
| 1245 |
$("input[name='delivery_days_name']").css({'background-color': '#FFA'}).click(function() { |
| 1246 |
$(this).css({'background-color': '#FFF'}); |
| 1247 |
}); |
| 1248 |
} |
| 1249 |
//20120710ysk start 0000472 |
| 1250 |
//var country = $("#delivery_days_country").val(); |
| 1251 |
//for(var i=0; i<pref[country].length; i++){ |
| 1252 |
// var value = $("input[name='delivery_days_value\[" + pref[country][i] + "\]']").val(); |
| 1253 |
// if( "" == value || !checkNum(value) ) { |
| 1254 |
// error++; |
| 1255 |
// $("input[name='delivery_days_value\[" + pref[country][i] + "\]']").css({'background-color': '#FFA'}).click(function() { |
| 1256 |
// $(this).css({'background-color': '#FFF'}); |
| 1257 |
// }); |
| 1258 |
// } |
| 1259 |
//} |
| 1260 |
for( var j = 0; j < target_market.length; j++ ) { |
| 1261 |
var tm = target_market[j]; |
| 1262 |
for( var i = 0; i < pref[tm].length; i++ ) { |
| 1263 |
var p = pref[tm][i]; |
| 1264 |
var value = $("input[name=\"delivery_days_value_"+tm+"\["+p+"\]\"]").val(); |
| 1265 |
if( "" == value || !checkNum(value) ) { |
| 1266 |
error++; |
| 1267 |
$("input[name=\"delivery_days_value_"+tm+"\["+p+"\]\"]").css({'background-color': '#FFA'}).click(function() { |
| 1268 |
$(this).css({'background-color': '#FFF'}); |
| 1269 |
}); |
| 1270 |
} |
| 1271 |
} |
| 1272 |
} |
| 1273 |
//20120710ysk end |
| 1274 |
if( 0 < error ) { |
| 1275 |
alert("データに不備があります。"); |
| 1276 |
return false; |
| 1277 |
} |
| 1278 |
|
| 1279 |
$("#delivery_days_loading").html('<img src="<?php echo USCES_PLUGIN_URL; ?>/images/loading-publish.gif" />'); |
| 1280 |
var id = $("#delivery_days_name_select option:selected").val(); |
| 1281 |
var name = $("input[name='delivery_days_name']").val(); |
| 1282 |
var query = ''; |
| 1283 |
//20110317ysk start |
| 1284 |
//20120710ysk start 0000472 |
| 1285 |
//var country = $("#delivery_days_country").val(); |
| 1286 |
//for(var i=0; i<pref.length; i++){ |
| 1287 |
// query += '&value[]=' + $("input[name='delivery_days_value\[" + pref[i] + "\]']").val(); |
| 1288 |
//} |
| 1289 |
//for(var i=0; i<pref[country].length; i++){ |
| 1290 |
// query += '&value[]=' + $("input[name='delivery_days_value\[" + pref[country][i] + "\]']").val(); |
| 1291 |
//} |
| 1292 |
for( var j = 0; j < target_market.length; j++ ) { |
| 1293 |
var tm = target_market[j]; |
| 1294 |
for( var i = 0; i < pref[tm].length; i++ ){ |
| 1295 |
query += '&value_'+tm+'[]='+$("input[name=\"delivery_days_value_"+tm+"\["+pref[tm][i]+"\]\"]").val(); |
| 1296 |
} |
| 1297 |
} |
| 1298 |
//20120710ysk end |
| 1299 |
//20110317ysk end |
| 1300 |
var s = operation.settings; |
| 1301 |
//20110317ysk start |
| 1302 |
//s.data = "action=shop_options_ajax&mode=update_delivery_days&id=" + id + "&name=" + name + query; |
| 1303 |
//20120710ysk start 0000472 |
| 1304 |
//s.data = "action=shop_options_ajax&mode=update_delivery_days&id=" + id + "&name=" + name + "&country=" + country + query; |
| 1305 |
s.data = "action=shop_options_ajax&mode=update_delivery_days&id="+id+"&name="+name+query; |
| 1306 |
//20120710ysk end |
| 1307 |
//20110317ysk end |
| 1308 |
s.success = function(data, dataType){ |
| 1309 |
//20120710ysk start 0000472 |
| 1310 |
//var strs = data.split('#usces#'); |
| 1311 |
//var id = strs[0] - 0; |
| 1312 |
var id = data - 0; |
| 1313 |
//var name = strs[1]; |
| 1314 |
//20110317ysk start |
| 1315 |
//var country = strs[2]; |
| 1316 |
//var value = strs[2].split(','); |
| 1317 |
//var value = strs[3].split(','); |
| 1318 |
//20120710ysk end |
| 1319 |
//20110317ysk end |
| 1320 |
for(var i=0; i<delivery_days.length; i++){ |
| 1321 |
if(id === delivery_days[i]['id']){ |
| 1322 |
index = i; |
| 1323 |
} |
| 1324 |
} |
| 1325 |
//20120710ysk start 0000472 |
| 1326 |
//delivery_days[index]['name'] = name; |
| 1327 |
delivery_days[index]['name'] = $("input[name='delivery_days_name']").val(); |
| 1328 |
//20110317ysk start |
| 1329 |
//delivery_days[index]['value'] = []; |
| 1330 |
//delivery_days[index]['country'] = country; |
| 1331 |
//for(var i=0; i<pref.length; i++){ |
| 1332 |
// delivery_days[index]['value'][pref[i]] = value[i]; |
| 1333 |
//} |
| 1334 |
//for(var i=0; i<pref[country].length; i++){ |
| 1335 |
// delivery_days[index]['value'][pref[country][i]] = value[i]; |
| 1336 |
//} |
| 1337 |
for( var j = 0; j < target_market.length; j++ ) { |
| 1338 |
var tm = target_market[j]; |
| 1339 |
for( var i = 0; i < pref[tm].length; i++ ) { |
| 1340 |
var p = pref[tm][i]; |
| 1341 |
delivery_days[index][tm][p] = $("input[name=\"delivery_days_value_"+tm+"\["+p+"\]\"]").val(); |
| 1342 |
} |
| 1343 |
} |
| 1344 |
//20120710ysk end |
| 1345 |
//20110317ysk end |
| 1346 |
operation.disp_delivery_days(id); |
| 1347 |
operation.make_delivery_method_days(get_delivery_method_days(selected_method)); |
| 1348 |
$("#delivery_days_loading").html(''); |
| 1349 |
}; |
| 1350 |
$.ajax( s ); |
| 1351 |
return false; |
| 1352 |
}, |
| 1353 |
|
| 1354 |
delete_delivery_days : function() { |
| 1355 |
var delname = $("#delivery_days_name_select option:selected").html(); |
| 1356 |
if(!confirm(<?php _e("'Okay to Delete Delivery Days Setting ' + delname + '?'", 'usces'); ?>)) return false; |
| 1357 |
|
| 1358 |
$("#delivery_days_loading").html('<img src="<?php echo USCES_PLUGIN_URL; ?>/images/loading-publish.gif" />'); |
| 1359 |
var id = $("#delivery_days_name_select option:selected").val(); |
| 1360 |
var s = operation.settings; |
| 1361 |
s.data = "action=shop_options_ajax&mode=delete_delivery_days&id=" + id; |
| 1362 |
s.success = function(data, dataType){ |
| 1363 |
var strs = data.split('#usces#'); |
| 1364 |
var id = strs[0] - 0; |
| 1365 |
for(var i=0; i<delivery_days.length; i++){ |
| 1366 |
if(id === delivery_days[i]['id']){ |
| 1367 |
index = i; |
| 1368 |
} |
| 1369 |
} |
| 1370 |
delivery_days.splice(index, 1); |
| 1371 |
operation.disp_delivery_days(0); |
| 1372 |
operation.make_delivery_method_days(get_delivery_method_days(selected_method)); |
| 1373 |
$("#delivery_days_loading").html(''); |
| 1374 |
}; |
| 1375 |
$.ajax( s ); |
| 1376 |
return false; |
| 1377 |
}, |
| 1378 |
|
| 1379 |
onchange_delivery_days : function(index) { |
| 1380 |
var id = $("#delivery_days_name_select option:eq("+index+")").val()-0; |
| 1381 |
operation.disp_delivery_days(id); |
| 1382 |
}, |
| 1383 |
|
| 1384 |
allDeliveryDays : function () { |
| 1385 |
var days = $("#all_delivery_days").val();//20110106ysk [all]->[days] |
| 1386 |
if( days == '' ) return; |
| 1387 |
if( confirm(<?php _e("'Okay to Change All Delivery Days to ' + days + '?'", 'usces'); ?>) ){ |
| 1388 |
//20110317ysk start |
| 1389 |
var country = $("#delivery_days_country option:selected").val(); |
| 1390 |
//for(var i=0; i<pref.length; i++){ |
| 1391 |
// $("input[name='delivery_days_value\[" + pref[i] + "\]']").val(days); |
| 1392 |
//} |
| 1393 |
//20120710ysk start 0000472 |
| 1394 |
//for(var i=0; i<pref[country].length; i++){ |
| 1395 |
// $("input[name='delivery_days_value\[" + pref[country][i] + "\]']").val(days); |
| 1396 |
//} |
| 1397 |
for( var i = 0; i < pref[country].length; i++ ) { |
| 1398 |
$("input[name=\"delivery_days_value_"+country+"\["+pref[country][i]+"\]\"]").val(days); |
| 1399 |
} |
| 1400 |
//20120710ysk end |
| 1401 |
//20110317ysk end |
| 1402 |
$("#all_delivery_days").val(""); |
| 1403 |
} |
| 1404 |
}, |
| 1405 |
//20101208ysk end |
| 1406 |
|
| 1407 |
settings: { |
| 1408 |
url: uscesL10n.requestFile, |
| 1409 |
type: 'POST', |
| 1410 |
cache: false, |
| 1411 |
success: function(data, dataType){ |
| 1412 |
$("#delivery_method_loading").html(''); |
| 1413 |
}, |
| 1414 |
error: function(msg){ |
| 1415 |
//$("#ajax-response").html(msg); |
| 1416 |
$("#delivery_method_loading").html(''); |
| 1417 |
} |
| 1418 |
} |
| 1419 |
}; |
| 1420 |
|
| 1421 |
//20110317ysk start |
| 1422 |
$("#shipping_charge_country").change(function () { |
| 1423 |
//20120710ysk start 0000472 |
| 1424 |
//var id = $("#shipping_charge_name_select").val()-0; |
| 1425 |
//var selected = 0; |
| 1426 |
//for(var i=0; i<shipping_charge.length; i++){ |
| 1427 |
// if(shipping_charge[i]['id'] === id){ |
| 1428 |
// selected = i; |
| 1429 |
// } |
| 1430 |
//} |
| 1431 |
//var country = $("#shipping_charge_country").val(); |
| 1432 |
//var value = ''; |
| 1433 |
//var valuehtml = ''; |
| 1434 |
//for(var i=0; i<pref[country].length; i++){ |
| 1435 |
// value = (shipping_charge[selected]['value'][pref[country][i]] == undefined) ? '' : shipping_charge[selected]['value'][pref[country][i]]; |
| 1436 |
// valuehtml += "<div class='clearfix'><label class='shipping_charge_label'>" + pref[country][i] + "</label><input type='text' name='shipping_charge_value[" + pref[country][i] + "]' value='" + value + "' class='charge_text' /><?php usces_crcode(); ?></div>\n"; |
| 1437 |
//} |
| 1438 |
//$("#shipping_charge_value").html(valuehtml); |
| 1439 |
//$(".charge_text").bind("change", function(){ usces_check_num($(this)); }); |
| 1440 |
var country = $("#shipping_charge_country option:selected").val(); |
| 1441 |
for( var i = 0; i < target_market.length; i++ ) { |
| 1442 |
if( country == target_market[i] ) { |
| 1443 |
$("#shipping_charge_"+target_market[i]).css("display",""); |
| 1444 |
} else { |
| 1445 |
$("#shipping_charge_"+target_market[i]).css("display","none"); |
| 1446 |
} |
| 1447 |
} |
| 1448 |
//20120710ysk end |
| 1449 |
}); |
| 1450 |
|
| 1451 |
$("#delivery_days_country").change(function () { |
| 1452 |
//20120710ysk start 0000472 |
| 1453 |
//var id = $("#delivery_days_name_select").val()-0; |
| 1454 |
//var selected = 0; |
| 1455 |
//for(var i=0; i<delivery_days.length; i++){ |
| 1456 |
// if(delivery_days[i]['id'] === id){ |
| 1457 |
// selected = i; |
| 1458 |
// } |
| 1459 |
//} |
| 1460 |
//var country = $("#delivery_days_country").val(); |
| 1461 |
//var value = ''; |
| 1462 |
//var valuehtml = ''; |
| 1463 |
//for(var i=0; i<pref[country].length; i++){ |
| 1464 |
// //value = (delivery_days[selected]['value'][pref[country][i]] == undefined) ? '' : delivery_days[selected]['value'][pref[country][i]]; |
| 1465 |
// value = (delivery_days[selected] == undefined || delivery_days[selected]['value'][pref[country][i]] == undefined) ? '' : delivery_days[selected]['value'][pref[country][i]]; |
| 1466 |
// valuehtml += "<div class='clearfix'><label class='delivery_days_label'>" + pref[country][i] + "</label><input type='text' name='delivery_days_value[" + pref[country][i] + "]' value='" + value + "' class='days_text' /><?php _e('day', 'usces'); ?></div>\n"; |
| 1467 |
//} |
| 1468 |
//$("#delivery_days_value").html(valuehtml); |
| 1469 |
//$(".days_text").bind("change", function(){ usces_check_num($(this)); }); |
| 1470 |
var country = $("#delivery_days_country option:selected").val(); |
| 1471 |
for( var i = 0; i < target_market.length; i++ ) { |
| 1472 |
if( country == target_market[i] ) { |
| 1473 |
$("#delivery_days_"+target_market[i]).css("display",""); |
| 1474 |
} else { |
| 1475 |
$("#delivery_days_"+target_market[i]).css("display","none"); |
| 1476 |
} |
| 1477 |
} |
| 1478 |
//20120710ysk end |
| 1479 |
}); |
| 1480 |
//20110317ysk end |
| 1481 |
}); |
| 1482 |
|
| 1483 |
function toggleVisibility(id) { |
| 1484 |
var e = document.getElementById(id); |
| 1485 |
if(e.style.display == 'block') |
| 1486 |
e.style.display = 'none'; |
| 1487 |
else |
| 1488 |
e.style.display = 'block'; |
| 1489 |
} |
| 1490 |
|
| 1491 |
jQuery(document).ready(function($){ |
| 1492 |
operation.disp_delivery_method(-1); |
| 1493 |
operation.disp_shipping_charge(-1); |
| 1494 |
//20101208ysk start |
| 1495 |
operation.disp_delivery_days(-1); |
| 1496 |
|
| 1497 |
var $tabs = $('#uscestabs_delivery').tabs({ |
| 1498 |
cookie: { |
| 1499 |
// store cookie for a day, without, it would be a session cookie |
| 1500 |
expires: 1 |
| 1501 |
} |
| 1502 |
}); |
| 1503 |
//20101208ysk end |
| 1504 |
}); |
| 1505 |
</script> |
| 1506 |
<div class="wrap"> |
| 1507 |
<div class="usces_admin"> |
| 1508 |
<h2>Welcart Shop <?php _e('Shipping Setting','usces'); ?></h2> |
| 1509 |
<div id="aniboxStatus" class="<?php echo $status; ?>"> |
| 1510 |
<div id="anibox" class="clearfix"> |
| 1511 |
<img src="<?php echo USCES_PLUGIN_URL; ?>/images/list_message_<?php echo $status; ?>.gif" /> |
| 1512 |
<div class="mes" id="info_massage"><?php echo $message; ?></div> |
| 1513 |
</div> |
| 1514 |
</div> |
| 1515 |
<p><?php _e('* It is necessary to perform the delivery setting before than the item registration.','usces'); ?><br /> |
| 1516 |
<?php _e('* When you performed the addition and deletion of the delivery method after item registration, please be careful because the update of all items is necessary.','usces'); ?></p> |
| 1517 |
<div id="poststuff" class="metabox-holder"> |
| 1518 |
|
| 1519 |
<!--20101208ysk start--> |
| 1520 |
<div class="postbox"> |
| 1521 |
<h3 class="hndle"><?php _e('Shipping Setting', 'usces'); ?></h3> |
| 1522 |
<div class="inside"> |
| 1523 |
<form action="" method="post" name="option_form" id="option_form"> |
| 1524 |
<table class="form_table"> |
| 1525 |
<tr style="height:40px;"> |
| 1526 |
<th><a style="cursor:pointer;" onclick="toggleVisibility('ex_shipping_setting01');"><?php _e('Deadline for Delivery', 'usces'); ?></a></th> |
| 1527 |
<td> |
| 1528 |
<select name="delivery_time_limit[hour]"> |
| 1529 |
<?php |
| 1530 |
for($i = 0; $i < 24; $i++) { |
| 1531 |
$hour = sprintf('%02d', $i); |
| 1532 |
?> |
| 1533 |
<option value="<?php echo $hour; ?>"<?php if($delivery_time_limit['hour'] == $hour) echo ' selected'; ?>><?php echo $hour; ?></option> |
| 1534 |
<?php |
| 1535 |
} |
| 1536 |
?> |
| 1537 |
</select> |
| 1538 |
</td> |
| 1539 |
<td>: </td> |
| 1540 |
<td> |
| 1541 |
<select name="delivery_time_limit[min]"> |
| 1542 |
<?php |
| 1543 |
$i = 0; |
| 1544 |
while($i < 60) { |
| 1545 |
$min = sprintf('%02d', $i); |
| 1546 |
?> |
| 1547 |
<option value="<?php echo $min; ?>"<?php if($delivery_time_limit['min'] == $min) echo ' selected'; ?>><?php echo $min; ?></option> |
| 1548 |
<?php |
| 1549 |
$i += 10; |
| 1550 |
} |
| 1551 |
?> |
| 1552 |
</select> |
| 1553 |
</td> |
| 1554 |
<td><div id="ex_shipping_setting01" class="explanation"><?php _e('Set deadline for merchandise delivery. This number is used to calculate the earliest delivery date.', 'usces'); ?></div></td> |
| 1555 |
</tr> |
| 1556 |
<tr style="height:40px;"> |
| 1557 |
<th><a style="cursor:pointer;" onclick="toggleVisibility('ex_shipping_setting02');"><?php _e('Morning Delivery Option', 'usces'); ?></a></th> |
| 1558 |
<td colspan="3"> |
| 1559 |
<select name="shortest_delivery_time"> |
| 1560 |
<option value="0"<?php if($shortest_delivery_time == '0') echo ' selected'; ?>><?php _e('Do Not Apply', 'usces'); ?></option> |
| 1561 |
<option value="1"<?php if($shortest_delivery_time == '1') echo ' selected'; ?>><?php _e('Morning Delivery', 'usces'); ?></option> |
| 1562 |
<option value="2"<?php if($shortest_delivery_time == '2') echo ' selected'; ?>><?php _e('No Morning Delivery', 'usces'); ?></option> |
| 1563 |
</select> |
| 1564 |
</td> |
| 1565 |
<td><div id="ex_shipping_setting02" class="explanation"><?php _e('Set if the merchandise can be delivered on the morning of earliest possible delivery date.', 'usces'); ?></div></td> |
| 1566 |
</tr> |
| 1567 |
<tr style="height:40px;"> |
| 1568 |
<th><a style="cursor:pointer;" onclick="toggleVisibility('ex_shipping_setting03');"><?php _e('Set Delivery Dates', 'usces'); ?></a></th> |
| 1569 |
<td colspan="3"> |
| 1570 |
<input name="delivery_after_days" type="text" class="charge_text" value="<?php echo $delivery_after_days; ?>"> |
| 1571 |
</td> |
| 1572 |
<td><div id="ex_shipping_setting03" class="explanation"><?php _e('Set the choices of possible delivery dates for the customer.', 'usces'); ?></div></td> |
| 1573 |
</tr> |
| 1574 |
<tr> |
| 1575 |
<th></th> |
| 1576 |
<td colspan="3"> |
| 1577 |
<input name="usces_option_update" type="submit" class="button" value="<?php _e('change decision','usces'); ?>" /> |
| 1578 |
</td> |
| 1579 |
</tr> |
| 1580 |
</table> |
| 1581 |
</form> |
| 1582 |
</div> |
| 1583 |
</div><!--postbox--> |
| 1584 |
<!--20101208ysk end--> |
| 1585 |
|
| 1586 |
<div class="postbox"> |
| 1587 |
<h3 class="hndle"><span><?php _e('shipping option','usces'); ?></span><a style="cursor:pointer;" onclick="toggleVisibility('ex_delivery_method');"> (<?php _e('explanation', 'usces'); ?>) </a></h3> |
| 1588 |
<div class="inside"> |
| 1589 |
<table class="form_table" style="width:290px; margin-left:10px; float:left;"> |
| 1590 |
<tr style="height:20px;"> |
| 1591 |
<th class="sec"> </th> |
| 1592 |
<td><a href="javascript:void(0);" id="new_delivery_method_action"><?php _e('New addition', 'usces'); ?></a></td> |
| 1593 |
</tr> |
| 1594 |
<tr style="height:40px;"> |
| 1595 |
<th><?php _e('Shipping name', 'usces'); ?></th> |
| 1596 |
<td width="150" height="30" id="delivery_method_name"></td> |
| 1597 |
</tr> |
| 1598 |
<tr style="height:30px;"> |
| 1599 |
<th class="sec"> </th> |
| 1600 |
<td id="delivery_method_name2"></td> |
| 1601 |
</tr> |
| 1602 |
<tr style="height:30px;"> |
| 1603 |
<th class="sec" id="delivery_method_loading"> </th> |
| 1604 |
<td id="delivery_method_button"></td> |
| 1605 |
</tr> |
| 1606 |
<tr style="height:20px;"> |
| 1607 |
<th class="sec"></th> |
| 1608 |
<td><a href="#" id="moveup_action"><?php _e('Raise the priority', 'usces'); ?></a></td> |
| 1609 |
</tr> |
| 1610 |
<tr style="height:20px;"> |
| 1611 |
<th class="sec"></th> |
| 1612 |
<td><a href="#" id="movedown_action"><?php _e('Lower the priority', 'usces'); ?></a></td> |
| 1613 |
</tr> |
| 1614 |
</table> |
| 1615 |
|
| 1616 |
<table class="form_table"> |
| 1617 |
<tr style="height:20px;"> |
| 1618 |
<th class="sec"></th> |
| 1619 |
<td></td> |
| 1620 |
</tr> |
| 1621 |
<tr style="height:40px;"> |
| 1622 |
<th class="sec"><a style="cursor:pointer;" onclick="toggleVisibility('ex_shipping_setting10');"><?php _e('Possible Delivery Area', 'usces'); ?></a></th> |
| 1623 |
<!--20110317ysk start--> |
| 1624 |
<!-- <td><input name="flights" type="radio" value="domestic" id="domestic_flights" /><label for="domestic_flights" style="margin-right:20px;"><?php _e('Domestic Shipment', 'usces'); ?></label><input name="flights" type="radio" value="internationa" id="internationa_flights" /><label for="internationa_flights"><?php _e('International Shipment', 'usces'); ?></label></td>--> |
| 1625 |
<td><div id="delivery_method_intl"></div></td> |
| 1626 |
<td><div id="ex_shipping_setting10" class="explanation"><?php _e('Choose possible delivery area for this shipment method.', 'usces'); ?></div></td> |
| 1627 |
<!--20110317ysk end--> |
| 1628 |
</tr> |
| 1629 |
<!-- <tr> |
| 1630 |
<th class="sec"><a style="cursor:pointer;" onclick="toggleVisibility('ex_shipping_setting11');"><?php _e('Applied Module', 'usces'); ?></a></th> |
| 1631 |
<td><select name="shipping_module"> |
| 1632 |
<option value="none"><?php _e('No possible Module', 'usces'); ?></option> |
| 1633 |
</select></td> |
| 1634 |
<td><div id="ex_shipping_setting11" class="explanation"><?php _e('When delivery module is chosen, the module overrules all rules including shipping fee.', 'usces'); ?></div></td> |
| 1635 |
</tr>--> |
| 1636 |
<tr style="height:40px;"> |
| 1637 |
<th class="sec"><a style="cursor:pointer;" onclick="toggleVisibility('ex_shipping_setting12');"><?php _e('Deliverly time', 'usces'); ?></a></th> |
| 1638 |
<td><textarea name="delivery_method_time" id="delivery_method_time" style="height:100px;"></textarea></td> |
| 1639 |
<td><div id="ex_shipping_setting12" class="explanation"><?php _e("Input possible delivery hours. Leave it blank when the customer cannot choose delivery time. <br />example)<br />morning<br />12:00~14:00<br />14:00~16:00<br />16:00~18:00", 'usces'); ?></div></td> |
| 1640 |
</tr> |
| 1641 |
<tr style="height:40px;"> |
| 1642 |
<th class="sec"><a style="cursor:pointer;" onclick="toggleVisibility('ex_shipping_setting13');"><?php _e('Postage fixation', 'usces'); ?></a></th> |
| 1643 |
<td id="delivery_method_charge_td"></td> |
| 1644 |
<td><div id="ex_shipping_setting13" class="explanation"><?php _e("It is fixed for above rate setting when I choose postage fixation. The postage set by an article is applied in the case of 'non-fixation'", 'usces'); ?></div></td> |
| 1645 |
</tr> |
| 1646 |
<!-- <tr style="height:40px;"> |
| 1647 |
<th class="sec"><a style="cursor:pointer;" onclick="toggleVisibility('ex_shipping_setting14');"><?php _e('Weight Added', 'usces'); ?></th> |
| 1648 |
<td id="delivery_method_weight_td"></td> |
| 1649 |
<td><div id="ex_shipping_setting14" class="explanation"><?php _e("Add shipment fee by the total weight of merchandise.", 'usces'); ?></div></td> |
| 1650 |
</tr>--> |
| 1651 |
<!--20101208ysk start--> |
| 1652 |
<tr style="height:40px;"> |
| 1653 |
<th class="sec"><a style="cursor:pointer;" onclick="toggleVisibility('ex_shipping_setting15');"><?php _e('Delivery Days', 'usces'); ?></a></th> |
| 1654 |
<td id="delivery_method_days_td"></td> |
| 1655 |
<td><div id="ex_shipping_setting15" class="explanation"><?php _e("Choose the Name of 'Delivery Days' registered in Delivery Days setting below. To be used to calculate the fastest delivery date. If you're not letting the customer set the delivery date, set to 'Delivery Date Not Specified'.", 'usces'); ?></div></td> |
| 1656 |
</tr> |
| 1657 |
<!--20101208ysk end--> |
| 1658 |
<!--20101119ysk start--> |
| 1659 |
<tr style="height:40px;"> |
| 1660 |
<th class="sec"><a style="cursor:pointer;" onclick="toggleVisibility('ex_shipping_setting16');"><?php _e('No COD', 'usces'); ?></a></th> |
| 1661 |
<td><div id="delivery_method_nocod"></div></td> |
| 1662 |
<td><div id="ex_shipping_setting16" class="explanation"><?php _e("Check for no COD.", 'usces'); ?></div></td> |
| 1663 |
</tr> |
| 1664 |
<!--20101119ysk end--> |
| 1665 |
</table> |
| 1666 |
|
| 1667 |
<hr size="1" color="#CCCCCC" /> |
| 1668 |
<div id="ex_delivery_method" class="explanation"><?php _e('Please make entry of appointment time to a party by one.', 'usces'); ?></div> |
| 1669 |
</div> |
| 1670 |
</div><!--postbox--> |
| 1671 |
|
| 1672 |
<!--20101208ysk start--> |
| 1673 |
<div class="uscestabs" id="uscestabs_delivery"> |
| 1674 |
<ul> |
| 1675 |
<li><a href="#delivery_page_setting_1"><?php _e('Shipping','usces'); ?></a></li> |
| 1676 |
<!--<li><a href="#delivery_page_setting_3"><?php _e('Weight Added','usces'); ?></a></li>--> |
| 1677 |
<li><a href="#delivery_page_setting_2"><?php _e('Delivery Days','usces'); ?></a></li> |
| 1678 |
</ul> |
| 1679 |
|
| 1680 |
<div id="delivery_page_setting_1"> |
| 1681 |
<!--20101208ysk end--> |
| 1682 |
|
| 1683 |
<div class="postbox"> |
| 1684 |
<h3 class="hndle"><span><?php _e('Shipping', 'usces'); ?></span><a style="cursor:pointer;" onclick="toggleVisibility('ex_shipping_charge');"> (<?php _e('explanation', 'usces'); ?>) </a></h3> |
| 1685 |
<div class="inside"> |
| 1686 |
<table class="form_table" style="width:290px; margin-left:10px; float:left;"> |
| 1687 |
<tr style="height:20px;"> |
| 1688 |
<th class="sec"> </th> |
| 1689 |
<td><a href="javascript:void(0);" id="new_shipping_charge_action"><?php _e('New addition', 'usces'); ?></a></td> |
| 1690 |
</tr> |
| 1691 |
<tr style="height:30px;"> |
| 1692 |
<th class="sec"><?php _e('Shipping charge name', 'usces'); ?></th> |
| 1693 |
<td width="150" height="30" id="shipping_charge_name"></td> |
| 1694 |
</tr> |
| 1695 |
<tr style="height:30px;"> |
| 1696 |
<th class="sec"> </th> |
| 1697 |
<td width="150" height="30" id="shipping_charge_name2"></td> |
| 1698 |
</tr> |
| 1699 |
<tr style="height:30px;"> |
| 1700 |
<th class="sec" id="shipping_charge_loading"> </th> |
| 1701 |
<td id="shipping_charge_button"></td> |
| 1702 |
</tr> |
| 1703 |
</table> |
| 1704 |
<table class="form_table"> |
| 1705 |
<tr style="height:20px;"> |
| 1706 |
<th class="sec"></th> |
| 1707 |
<td></td> |
| 1708 |
</tr> |
| 1709 |
<tr style="height:40px;"> |
| 1710 |
<th class="sec"><a style="cursor:pointer;" onclick="toggleVisibility('ex_shipping_setting20');"><?php _e('Country', 'usces'); ?></a></th> |
| 1711 |
<td><label class="shipping_charge_label"></label><select name="shipping_charge_country" id="shipping_charge_country"> |
| 1712 |
<?php usces_shipping_country_option( '' ); ?> |
| 1713 |
</select></td> |
| 1714 |
<!--20110317ysk start--> |
| 1715 |
<td><div id="ex_shipping_setting20" class="explanation"><?php _e('Choose countries to apply this shipment fee.', 'usces'); ?></div></td> |
| 1716 |
<!--20110317ysk end--> |
| 1717 |
</tr> |
| 1718 |
<tr style="height:40px;"> |
| 1719 |
<th class="sec"><?php _e('Shipping', 'usces'); ?></th> |
| 1720 |
<td><label class="shipping_charge_label"><input name="allbutton" type="button" class="allbutton" onclick="operation.allCharge();" value="<?php _e('same as', 'usces'); ?>" /></label><input name="allcharge" id="allcharge" type="text" class='charge_text' /><?php usces_crcode(); ?></td> |
| 1721 |
</tr> |
| 1722 |
<tr> |
| 1723 |
<th class="sec"></th> |
| 1724 |
<td><div id="shipping_charge_value"></div></td> |
| 1725 |
</tr> |
| 1726 |
</table> |
| 1727 |
<hr size="1" color="#CCCCCC" /> |
| 1728 |
<div id="ex_shipping_charge" class="explanation"><?php _e('You can choose the shipping every item.', 'usces'); ?></div> |
| 1729 |
</div> |
| 1730 |
</div><!--postbox--> |
| 1731 |
|
| 1732 |
<!--20101208ysk start--> |
| 1733 |
</div><!--delivery_page_setting_1--> |
| 1734 |
<div id="delivery_page_setting_2"> |
| 1735 |
<div class="postbox"> |
| 1736 |
<h3 class="hndle"><span><?php _e('Delivery Days', 'usces'); ?></span><a style="cursor:pointer;" onclick="toggleVisibility('ex_delivery_days');"> (<?php _e('explanation', 'usces'); ?>) </a></h3> |
| 1737 |
<div class="inside"> |
| 1738 |
<table class="form_table" style="width:280px; margin-left:10px; float:left;"> |
| 1739 |
<tr style="height:20px;"> |
| 1740 |
<th class="sec"> </th> |
| 1741 |
<td><a href="javascript:void(0);" id="new_delivery_days_action"><?php _e('New addition', 'usces'); ?></a></td> |
| 1742 |
</tr> |
| 1743 |
<tr style="height:30px;"> |
| 1744 |
<th class="sec"><?php _e("Name of 'Delivery Days'", 'usces'); ?></th> |
| 1745 |
<td width="150" height="30" id="delivery_days_name"></td> |
| 1746 |
</tr> |
| 1747 |
<tr style="height:30px;"> |
| 1748 |
<th class="sec"> </th> |
| 1749 |
<td width="150" height="30" id="delivery_days_name2"></td> |
| 1750 |
</tr> |
| 1751 |
<tr style="height:30px;"> |
| 1752 |
<th class="sec" id="delivery_days_loading"> </th> |
| 1753 |
<td id="delivery_days_button"></td> |
| 1754 |
</tr> |
| 1755 |
</table> |
| 1756 |
<table class="form_table"> |
| 1757 |
<tr style="height:20px;"> |
| 1758 |
<th class="sec"></th> |
| 1759 |
<td></td> |
| 1760 |
</tr> |
| 1761 |
<tr style="height:40px;"> |
| 1762 |
<!--20110317ysk start--> |
| 1763 |
<!-- <th class="sec"></th> |
| 1764 |
<td></td>--> |
| 1765 |
<th class="sec"><a style="cursor:pointer;" onclick="toggleVisibility('ex_delivery_days_setting20');"><?php _e('Country', 'usces'); ?></a></th> |
| 1766 |
<td><label class="shipping_charge_label"></label><select name="delivery_days_country" id="delivery_days_country"> |
| 1767 |
<?php usces_shipping_country_option( '' ); ?> |
| 1768 |
</select></td> |
| 1769 |
<td><div id="ex_delivery_days_setting20" class="explanation"><?php _e('Choose countries to apply this Delivery Days.', 'usces'); ?></div></td> |
| 1770 |
<!--20110317ysk end--> |
| 1771 |
</tr> |
| 1772 |
<tr style="height:40px;"> |
| 1773 |
<th class="sec"><?php _e('Delivery Days', 'usces'); ?></th> |
| 1774 |
<td><label class="delivery_days_label"><input name="allbutton_delivery_days" type="button" class="allbutton" onclick="operation.allDeliveryDays();" value="<?php _e('same as', 'usces'); ?>" /></label><input name="all_delivery_days" id="all_delivery_days" type="text" class='days_text' /><?php _e('day', 'usces'); ?></td> |
| 1775 |
</tr> |
| 1776 |
<tr> |
| 1777 |
<th class="sec"></th> |
| 1778 |
<td><div id="delivery_days_value"></div></td> |
| 1779 |
</tr> |
| 1780 |
</table> |
| 1781 |
<hr size="1" color="#CCCCCC" /> |
| 1782 |
<div id="ex_delivery_days" class="explanation"><?php _e('You can choose Delivery Days for each merchandise.', 'usces'); ?></div> |
| 1783 |
</div> |
| 1784 |
</div><!--postbox--> |
| 1785 |
</div><!--delivery_page_setting_2--> |
| 1786 |
<!-- |
| 1787 |
<div id="delivery_page_setting_3"> |
| 1788 |
<div class="postbox"> |
| 1789 |
<h3 class="hndle"><span><?php _e('Weight Added', 'usces'); ?></span><a style="cursor:pointer;" onclick="toggleVisibility('ex_shipping_weight');"> (<?php _e('explanation', 'usces'); ?>) </a></h3> |
| 1790 |
<div class="inside"> |
| 1791 |
<table class="form_table" style="width:280px; margin-left:10px; float:left;"> |
| 1792 |
<tr> |
| 1793 |
<th class="sec"> </th> |
| 1794 |
<td><a href="javascript:void(0);" id="new_delivery_days_action"><?php _e('New addition', 'usces'); ?></a></td> |
| 1795 |
</tr> |
| 1796 |
<tr> |
| 1797 |
<th class="sec"><?php _e('Name of the Additional Fee', 'usces'); ?></th> |
| 1798 |
<td width="150" height="30" id="shipping_weight_name"></td> |
| 1799 |
</tr> |
| 1800 |
<tr> |
| 1801 |
<th class="sec"> </th> |
| 1802 |
<td width="150" height="30" id="shipping_weight_name2"></td> |
| 1803 |
</tr> |
| 1804 |
<tr> |
| 1805 |
<th class="sec" id="shipping_weight_loading"> </th> |
| 1806 |
<td id="shipping_weight_button"></td> |
| 1807 |
</tr> |
| 1808 |
</table> |
| 1809 |
<table class="form_table"> |
| 1810 |
<tr> |
| 1811 |
<th class="sec"></th> |
| 1812 |
<td></td> |
| 1813 |
</tr> |
| 1814 |
<tr> |
| 1815 |
<th class="sec"><?php _e('Amount of the Additional Fee', 'usces'); ?></th> |
| 1816 |
<td><label class="delivery_days_label"><input name="allbutton_shipping_weight" type="button" class="allbutton" onclick="operation.allShippingWeight();" value="<?php _e('same as', 'usces'); ?>" /></label><input name="all_shipping_weight" id="all_shipping_weight" type="text" class='days_text' /><?php usces_crcode(); ?></td> |
| 1817 |
</tr> |
| 1818 |
<tr> |
| 1819 |
<th class="sec"></th> |
| 1820 |
<td></td> |
| 1821 |
</tr> |
| 1822 |
<tr> |
| 1823 |
<th class="sec"></th> |
| 1824 |
<td><div id="shipping_weight_value"></div></td> |
| 1825 |
</tr> |
| 1826 |
</table> |
| 1827 |
<hr size="1" color="#CCCCCC" /> |
| 1828 |
<div id="ex_shipping_weight" class="explanation"><?php _e('Calculate the shipping fee based on the total weight of the merchandises.', 'usces'); ?></div> |
| 1829 |
</div> |
| 1830 |
</div> |
| 1831 |
</div> |
| 1832 |
--> |
| 1833 |
|
| 1834 |
</div><!--tabs--> |
| 1835 |
<!--20101208ysk end--> |
| 1836 |
|
| 1837 |
</div><!--poststuff--> |
| 1838 |
|
| 1839 |
</div><!--usces_admin--> |
| 1840 |
</div><!--wrap--> |