Welcart Square 1.0.4 をリリースしました。
今回の更新内容は次の通りです。
- wc_customer_page.php 「#mailaddress1」のid重複を修正
 - Welcart Basic 1.2.5「検索フォームのID重複」修正に伴うテンプレート修正とスタイル調整
 - the_excerpt() の末尾の文字(「…」)を UTF-8 から Shift-JISに変更
 - ポイント使用時、全てポイントで支払った場合にポイントフォームが表示されなくなる不具合を修正
 - Welcart Basic 1.2.5「スマホ閲覧時、キャッチフレーズを設定していない場合の…」修正によるスタイル調整
 - 商品詳細ページ:関連商品のレイアウト調整
 - マイページ:「クレジットカード情報はこちら」のタグ構造修正
 - 商品売り切れ時、商品お問い合わせフォームから送信したメール本文に商品名が記載されない不具合を修正
 - 購入制限数と在庫数が等しい場合の数量フィールド値が制限されていない不具合を修正
 
1. wc_customer_page.php 「#mailaddress1」のid重複を修正
「お客様情報」ページの「メールアドレス」入力欄は、「会員用」フォームと「非会員用」フォームに設置されており、各「メールアドレス」入力欄(input タグ)のID属性値が重複してしまうことが原因で「HTML の文法違反」と見なされてしまうため、「会員用」フォームの ID属性値を変更しております。
Welcart Square では、テーマ内に「wc_customer_page.php」を設置しておりますので、Welcart Basic 1.2.5 にアップグレードした際は、同時に Welcart Square も最新バージョンにアップグレードください。Welcart Square をカスタマイズされている場合は、下記の修正箇所を参考にテーマ修正を行ってください。
ID名変更: welcart_basic-square/wc_templates/wc_customer.php 46行目
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="customer_form">
    <tr>
        <th scope="row"><?php _e('e-mail adress', 'usces'); ?></th>
        <td><input name="loginmail" id="mailaddress1" type="text" value="<?php esc_attr_e($usces_entries['customer']['mailaddress1']); ?>" style="ime-mode: inactive" /></td>
    </tr>
    <tr>
        <th scope="row"><?php _e('password', 'usces'); ?></th>
        <td><input name="loginpass" id="mailaddress1" type="password" value="" /></td>
    </tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="customer_form">
    <tr>
        <th scope="row"><?php _e('e-mail adress', 'usces'); ?></th>
        <td><input name="loginmail" id="loginmail" type="text" value="<?php esc_attr_e($usces_entries['customer']['mailaddress1']); ?>" style="ime-mode: inactive" /></td>
    </tr>
    <tr>
        <th scope="row"><?php _e('password', 'usces'); ?></th>
        <td><input name="loginpass" id="loginpass" type="password" value="" /></td>
    </tr>
</table>
2. 「検索フォームのID重複」修正に伴うテンプレート修正とスタイル調整
「検索」ウィジェットまたは「Welcart キーワード検索」ウィジェットを設置した場合、ヘッダーに設置されいてる検索フォームの「テキストボックス」と「送信ボタン」の ID属性値が重複してしまうことが原因で「HTML の文法違反」と見なされてしまうため、Welcart Basic 1.2.5 から、ヘッダーの検索フォームと「検索」ウィジェットの ID属性値を変更いたしました。
Welcart Basic のみを最新バージョン(v.1.2.5)にアップグレードした場合、Welcart Square のバージョンが古いと上記画像のようなレイアウト崩れを起こします。Welcart Basic 1.2.5 にアップグレードした際は、Welcart Square も最新バージョン(1.1.4)にアップグレードしてください。Welcart Square をカスタマイズしている場合は、下記の修正内容を参考にお使いのテーマを修正ください。
Welcart Basic 1.2.5 で作成した関数「get_head_search_form()」の適用:
welcart_basic-square/header.php 88行目
<?php get_search_form(); ?>
<?php 
if(function_exists('get_head_search_form')) {
    get_head_search_form();
}else {
    get_search_form();
}
?>
スタイル修正:
セレクタ名変更:welcart_basic-square/style.css 462行目・1647行目.search-box #searchsubmit
.search-box .searchsubmit
.widget_search #s
.widget_search .search-text
.widget_search #searchsubmit
.widget_search .searchsubmit
.search-box #searchsubmit
.search-box .searchsubmit
.widget_search #searchsubmit
.widget_search .searchsubmit
WordPress 4.7 以降をご利用のお客様へ
WordPress 4.7 以降「カスタムCSS」という機能が追加されております。こちらの機能を利用し以下のスタイルをコピペするだけでもレイアウト崩れを防ぐことは可能ですが、Welcart Square では「カラーデザイン」の変更機能を搭載しているため、正常に表示させるには、上記「theme-customzier.php」の【セレクタ名の変更】作業を行う必要がございます。
※Welcart Square をカスタマイズされている場合に限ります。
.search-box .searchsubmit {
    font-size: 20px;
    padding: 0 10px;
    line-height: 30px;
}
.widget_search .search-text {
    padding: 0 30px 0 5px;
}
.widget_search .searchsubmit {
    padding: 0 10px;
    height: 35px;
    line-height: 35px;
}
@media screen and (min-width: 62.5em) {
    
    .search-box .searchsubmit {
        position: absolute;
        width: auto;
        height: 44px;
        color: #fff;
        padding: 0 15px;
        line-height: 44px;
        -moz-box-shadow: none;
        -webkit-box-shadow: none;
        box-shadow: none;
    }
    
}
3. the_excerpt() の末尾の文字(「…」)を UTF-8 から Shift-JISに変更
文字列の修正: welcart_basic-sqaure/functions.php 171行目
function wcct_excerpt_more( $more ) {
    return '…';
}
add_filter( 'excerpt_more', 'wcct_excerpt_more' );
function wcct_excerpt_more( $more ) {
    return '...';
}
add_filter( 'excerpt_more', 'wcct_excerpt_more' );
4. ポイント使用時、全てポイントで支払った場合にポイントフォームが表示されなくなる不具合を修正
コード修正: welcart_basic-sqaure/wc_templates/wc_confirm_page.php 132行目
<?php if( usces_is_member_system() && usces_is_member_system_point() && usces_is_login() && welcart_basic_is_available_point() && 0 < $usces_entries['order']['total_full_price'] ) : ?>
<?php if( usces_is_member_system() && usces_is_member_system_point() && usces_is_login() && welcart_basic_is_available_point() ) : ?>
5. Welcart Basic 1.2.5 にアップグレードした際のキャッチフレーズのスタイル調整
スタイル追加: welcart_basic-sqaure/style.css 212行目
.site-description {
    min-height: auto;
}
6. 商品詳細ページ:関連商品のレイアウト調整
スタイル修正: welcart_basic-sqaure/usces_cart.css 1593行目
.assistance_item li:nth-of-type(4n) {
    margin-right: 0;
}
.assistance_item li:nth-of-type(5n) {
    margin-right: 0;
}
7. マイページ:「クレジットカード情報はこちら」のタグ構造修正
リストタグの追加: welcart_basic-sqaure/wc_templates/wc_member_page.php 54行目
<?php do_action( 'usces_action_member_submenu_list' ); ?>
<li><?php do_action( 'usces_action_member_submenu_list' ); ?></li>
8. 商品売り切れ時、商品お問い合わせフォームから送信したメール本文に商品名が記載されない不具合を修正
js ファイルの追加:welcart_basic-square/js/wcct-customized.js
( function( $ ) {
    
    $(function() {
        var pair = location.search.substring(1).split('&');
        var arg = new Object;
        for( var i = 0; pair[i]; i++ ) {
            var kv = pair[i].split('=');
            arg[kv[0]] = kv[1];
        }
        if( undefined != arg.from_item && undefined != arg.from_sku ) {
            $('.wpcf7-submit').on('click', function() {
                var form = $(this).parents('form');
                form.attr('action', $(this).data('action'));
                $('<input>').attr({
                    'type': 'hidden',
                    'name': 'from_item',
                    'value': arg.from_item
                }).appendTo(form);
                $('<input>').attr({
                    'type': 'hidden',
                    'name': 'from_sku',
                    'value': arg.from_sku
                }).appendTo(form);
            });
        }
    })
} )( jQuery );
js ファイルの読み込み:welcart_basic-square/functions.php 152行目
function wcct_enqueue_styles() {
    
    wp_enqueue_script( 'wcct-customized', get_stylesheet_directory_uri() . '/js/wcct-customized.js', array(), '1.0' );
}
add_action( 'wp_enqueue_scripts', 'wcct_enqueue_styles' , 9 );
ファイル修正:welcart_basic-square/inc/front-customized.php 330行目
if( defined('WPCF7_VERSION') ) {
    add_filter('wpcf7_mail_components', 'wcct_mail_components', 10, 3);
    function wcct_mail_components($components, $current_form, $mail_object){
        global $usces;
        
        $post_id = isset($_GET['from_item']) ? $_GET['from_item']: '';
        if( strlen($post_id) > 0 ){
            $itemname = $usces->getItemName($post_id);
            $skucode = isset($_GET['from_sku']) ? $_GET['from_sku']: '';
            $skuname = ( strlen($skucode) > 0 ) ? $usces->getItemSkuDisp($post_id, $skucode): '';
    
            $body = $components['body'];
            
            if( strlen($itemname) > 0 && strlen($skuname) > 0 ){
                $components['body'] = __( 'item name', 'usces' ) . ':'.$itemname. ' '. $skuname. "\n". $body;
            }elseif( strlen($itemname) > 0 ){
                $components['body'] = __( 'item name', 'usces' ) . ':'.$itemname. "\n". $body;
            }
        }
        return $components;
    }
}
if( defined('WPCF7_VERSION') ) {
    add_filter('wpcf7_mail_components', 'wcct_mail_components', 10, 3);
    function wcct_mail_components($components, $current_form, $mail_object){
        global $usces;
        
        $post_id = isset($_POST['from_item']) ? $_POST['from_item']: '';
        if( strlen($post_id) > 0 ){
            $itemname = $usces->getItemName($post_id);
            $skucode = isset($_POST['from_sku']) ? $_POST['from_sku']: '';
            $skuname = ( strlen($skucode) > 0 ) ? $usces->getItemSkuDisp($post_id, $skucode): '';
    
            $body = $components['body'];
            
            if( strlen($itemname) > 0 && strlen($skuname) > 0 ){
                $components['body'] = __( 'item name', 'usces' ) . ':'.$itemname. ' '. $skuname. "\n". $body;
            }elseif( strlen($itemname) > 0 ){
                $components['body'] = __( 'item name', 'usces' ) . ':'.$itemname. "\n". $body;
            }
        }
        return $components;
    }
}
9. 購入制限数と在庫数が等しい場合の数量フィールド値が制限されていない不具合を修正
テンプレート修正:welcart_basic-nova/inc/front-customized.php 402行目
function wcct_the_itemQuant_select( $max = null ) {
    global $post, $usces;
    if( empty( $max ) )
        $max = 50;
    $zaiko = usces_the_itemZaikoNum('return');
    $sku_enc = urlencode( usces_the_itemSku('return') );
    $restriction = $usces->getItemRestriction($post->ID);
    
    if( ('' != $zaiko && 0 < $zaiko && '' != $restriction && $zaiko >= $restriction) || ( '' == $zaiko && '' != $restriction) ) {
        $max = $restriction;
    }elseif( ( '' != $zaiko && 0 < $zaiko && '' != $restriction && $zaiko < $restriction ) || ( '' != $zaiko && '' == $restriction) ) {
        $max = $zaiko;
    }
    
    $select = '<select name ="quant[' . $post->ID . '][' . $sku_enc . ']" id ="quant[' . $post ->ID . '][' . $sku_enc . ']" class="skuquantity" onkeydown="if(event.keyCode == 13) {return false;}">' . "\n";
        for($i =1; $i<=$max; $i++) {
            $select .= '<option value="' . $i . '">' . $i . '</option>' . "\n";
        }
    $select .= '</select>';
    
    echo $select;
}
Welcart Basic 最新リリース情報

				

