var targetSec = baseSec + addSec; date.setTime(targetSec); var yy = date.getFullYear() + ""; var mm = toDoubleDigits(date.getMonth() + 1); var dd = toDoubleDigits(date.getDate()); var newdate = new Array(); newdate["year"] = yy; newdate["month"] = mm; newdate["day"] = dd; return(newdate); } <?php //選択可能な配送方法 $default_deli = array_values( apply_filters( 'wc2_filter_get_available_delivery_method', wc2_get_available_delivery_method() ) ); if( !isset($entry_data['order']['delivery_method']) || '' == $entry_data['order']['delivery_method'] ) { $selected_delivery_method = $default_deli[0]; } else { $selected_delivery_method = $entry_data['order']['delivery_method']; } ?> selected_delivery_method = "<?php echo $selected_delivery_method; ?>"; <?php if( isset($entry_data['order']['delivery_date']) ) : ?> selected_delivery_date = "<?php echo $entry_data['order']['delivery_date']; ?>"; <?php endif; ?> <?php //カートに入っている商品の発送日目安 $shipping = 0; $cart = wc2_get_cart(); foreach( $cart as $key => $cart_row ) {
function wc2_the_delivery_method( $value = '' ) { $deli_id = apply_filters( 'wc2_filter_get_available_delivery_method', wc2_get_available_delivery_method() ); if( empty($deli_id) ) { $html = ' <p>' . __('有効な配送方法がありません。', 'wc2') . '</p>'; } else { $delivery = wc2_get_option( 'delivery' ); $cdeliid = count($deli_id); $html = ' <select name="offer[delivery_method]" id="delivery_method_select" class="delivery_method">'; foreach( $deli_id as $id ) { $index = wc2_get_delivery_method_index( $id ); $selected = ( $id == $value || 1 === $cdeliid ) ? ' selected="selected"' : ''; $html .= " <option value=\"{$id}\"{$selected}>" . esc_html($delivery['delivery_method'][$index]['name']) . '</option>'; } $html .= ' </select>'; } return $html; }