Welcart Nova 1.1.5 をリリースしました。
今回の更新内容は次の通りです。
- Welcart Basic 1.2.5「検索フォームのID重複」修正に伴うテンプレート修正とスタイル調整
- スマホ閲覧時、グローバルメニューの高さがコンテンツの高さを上回った時メニューが最後まで表示されない不具合を修正
- the_excerpt() の末尾の文字(「…」)を UTF-8 から Shift-JISに変更
- フロントページ設定を「固定ページ」にした場合のレイアウト崩れを修正
- フロントページ設定を「固定ページ」にした場合の「商品一覧」ウィジェットのレイアウト崩れを修正
- 商品売り切れ時、商品お問い合わせフォームから送信したメール本文に商品名が記載されない不具合を修正
- 購入制限数と在庫数が等しい場合の数量フィールド値が制限されていない不具合を修正
1. 「検索フォームのID重複」修正に伴うテンプレート修正とスタイル調整
「検索」ウィジェットまたは「Welcart キーワード検索」ウィジェットを設置した場合、ヘッダーに設置されいてる検索フォームの「テキストボックス」と「送信ボタン」の ID属性値が重複してしまうことが原因で「HTML の文法違反」と見なされてしまうため、Welcart Basic 1.2.5 から、ヘッダーの検索フォームと「検索」ウィジェットの ID属性値を変更しております。
Welcart Basic のみを最新バージョン(v.1.2.5)にアップグレードした場合、Welcart Nova のバージョンが古いと上記画像のようなレイアウト崩れを起こします。Welcart Basic 1.2.5 にアップグレードした際は、Welcart Nova も最新バージョン(1.1.5)にアップグレードしてください。Welcart Nova をカスタマイズしている場合は、下記の修正内容を参考にお使いのテーマを修正ください。
Welcart Basic 1.2.5 で作成した関数「get_head_search_form()」の適用:
welcart_basic-nova/header.php 45行目
<?php get_search_form(); ?>
<?php
if(function_exists('get_head_search_form')) {
get_head_search_form();
}else {
get_search_form();
}
?>
スタイル修正
セレクタ名変更: welcart_basic-nova/style.css 242行目
.search-box #searchsubmit
.search-box .searchsubmit
スタイル追加: welcart_basic-nova/style.css 251行目
.search-box .searchsubmit:hover {
color: #aaa;
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
}
セレクタ名変更: welcart_basic-nova/style.css 976行目
.widget_search #s
.widget_search .search-text
セレクタ名変更: welcart_basic-nova/style.css 982行目
.widget_search #searchsubmit
.widget_search .searchsubmit
スタイル追加: welcart_basic-nova/style.css 996行目
.widget_search .searchsubmit:hover {
color: #666;
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
}
セレクタ名変更: welcart_basic-nova/css/home-parts.css 464行目
.home .search-box #searchsubmit, .blog .search-box #searchsubmit
.home .search-box .searchsubmit, .blog .search-box .searchsubmit
セレクタ名変更: welcart_basic-nova/css/home-parts.css 469行目
.home .search-box input[type="text"], .home .search-box #searchsubmit, .blog .search-box input[type="text"], .blog .search-box #searchsubmit
.home .search-box input[type="text"], .home .search-box .searchsubmit, .blog .search-box input[type="text"], .blog .search-box .searchsubmit
セレクタ名変更: welcart_basic-nova/css/parts.css 138行目
.search-box #searchsubmit
.search-box .searchsubmit
セレクタ名変更: welcart_basic-nova/css/parts.css 445行目
.widget_search #s
.widget_search .search-text
WordPress 4.7 以降をご利用のお客様へ
WordPress 4.7 以降「カスタムCSS」という機能が追加されております。こちらの機能を利用し以下のスタイルをコピペするだけでもレイアウト崩れを防ぐことは可能です。
※Welcart Nova をカスタマイズされている場合に限ります。
.search-box .searchsubmit {
width: auto;
color: #aaa;
padding: 0 15px;
line-height: 44px;
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
}
.search-box .searchsubmit:hover {
color: #aaa;
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
}
.widget_search .search-text {
color: #fff;
padding: 0 10px;
line-height: 30px;
background: none;
}
.widget_search .searchsubmit {
color: #666;
padding: 0 10px;
line-height: 30px;
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
}
.widget_search .searchsubmit:hover {
color: #666;
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
}
@media screen and (min-width: 38.75em) {
.home .search-box .searchsubmit,
.blog .search-box .searchsubmit {
position: absolute;
}
.home .search-box .searchsubmit,
.blog .search-box .searchsubmit {
line-height: 30px;
}
}
@media screen and (min-width: 62.5em) {
.search-box .searchsubmit {
position: absolute;
}
.home .widget_search .search-text,
.blog .widget_search .search-text {
color: #fff;
}
.widget_search .search-text {
color: #3c3c3c;
}
}
2. スマホ閲覧時、グローバルメニューの高さがコンテンツの高さを上回った時メニューが最後まで表示されない不具合を修正
タグ構造の変更: welcart_basic-nova/header.php 79行目
<nav id="site-navigation" class="main-navigation" role="navigation">
・・・
</nav>
<nav id="site-navigation" class="main-navigation" role="navigation">
<div class="navigation-inner">
・・・
</div>
</nav>
スタイル削除: welcart_basic-nova/style.css 464行目
#site-navigation {
padding: 20px;
}
※ 削除する部分は、「padding: 20px;」の部分のみです。
スタイル追加: welcart_basic-nova/style.css 481行目
#site-navigation .navigation-inner {
overflow-y: auto;
padding: 20px;
height: 100%;
}
スタイル削除: welcart_basic-nova/css/parts.css 175行目
#site-navigation {
padding: 0;
}
※ 削除する部分は、「padding: 0;」の部分のみです。
スタイル追加: welcart_basic-nova/css/parts.css 185行目
#site-navigation .navigation-inner {
overflow-y: inherit;
height: auto;
padding: 0;
}
スタイル追加: welcart_basic-nova/css/home-parts.css 536行目
.home #site-navigation .navigation-inner,
.blog #site-navigation .navigation-inner {
padding: 0;
}
3. the_excerpt() の末尾の文字(「…」)を UTF-8 から Shift-JISに変更
文字列の修正: welcart_basic-nova/functions.php 183行目
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-nova/style.css 825行目.home #content .home-widget .widget_basic_item_list article, .blog #content .home-widget .widget_basic_item_list article, #itempage-widget .widget_basic_item_list articlewelcart_basic-nova/style.css 833行目
.home #content .home-widget .widget_basic_item_list article:nth-of-type(even), .blog #content .home-widget .widget_basic_item_list article:nth-of-type(even), #itempage-widget .widget_basic_item_list article:nth-of-type(even)welcart_basic-nova/style.css 1492行目
.home #content .home-widget .widget_basic_item_list article, .home #content .home-widget .widget_basic_item_list article:nth-of-type(even), .blog #content .home-widget .widget_basic_item_list article, .blog #content .home-widget .widget_basic_item_list article:nth-of-type(even), #itempage-widget .widget_basic_item_list article, #itempage-widget .widget_basic_item_list article:nth-of-type(even)welcart_basic-nova/style.css 1504行目
.home #content .home-widget .widget_basic_item_list article:nth-of-type(3n), .blog #content .home-widget .widget_basic_item_list article:nth-of-type(3n), #itempage-widget .widget_basic_item_list article:nth-of-type(3n)welcart_basic-nova/style.css 1702行目
.home #content .home-widget .widget_basic_item_list article, .home #content .home-widget .widget_basic_item_list article:nth-of-type(even), .home #content .home-widget .widget_basic_item_list article:nth-of-type(3n), .blog #content .home-widget .widget_basic_item_list article, .blog #content .home-widget .widget_basic_item_list article:nth-of-type(even), .blog #content .home-widget .widget_basic_item_list article:nth-of-type(3n), #itempage-widget .widget_basic_item_list article, #itempage-widget .widget_basic_item_list article:nth-of-type(even), #itempage-widget .widget_basic_item_list article:nth-of-type(3n)welcart_basic-nova/style.css 1714行目
.home #content .home-widget .widget_basic_item_list article:nth-of-type(4n), .blog #content .home-widget .widget_basic_item_list article:nth-of-type(4n), #itempage-widget .widget_basic_item_list article:nth-of-type(4n)
5. フロントページ設定を「固定ページ」にした場合の「商品一覧」ウィジェットのレイアウト崩れを修正
セレクタ追加:
welcart_basic-nova/css/home-parts.css 22行目.home.blog #content h2, .home #content h2, #content .info-area h2welcart_basic-nova/css/home-parts.css 32行目
.home.blog #content h2:after, .home #content h2:after, #content .info-area h2:after
セレクタ削除:
welcart_basic-nova/css/home-parts.css 242行目
.home #main.one-column #content,
.blog #main.one-column #content {
padding: 0 15px;
}
.blog #main.one-column #content {
padding: 0 15px;
}
.home #content h2,
.blog #content h2 {
text-align: left;
}
.blog #content h2 {
text-align: left;
}
.home #content h2:after,
.blog #content h2:after {
display: block;
content: " ";
width: 70px;
height: 2px;
background-color: #aaa;
margin: 15px 0 0;
}
.blog #content h2:after {
display: block;
content: " ";
width: 70px;
height: 2px;
background-color: #aaa;
margin: 15px 0 0;
}
.blog #main.one-column #content,
.home #main.one-column #content {
padding: 0 40px;
}
.blog #main.one-column #content {
padding: 0 40px;
}
.home #content .entry-title,
.blog #content .entry-title {
width: auto;
font-size: 26px;
margin: 30px 0;
}
.blog #content .entry-title {
width: auto;
font-size: 26px;
margin: 30px 0;
}
.blog #main.one-column #content,
.home #main.one-column #content {
padding: 0 60px;
}
.blog #main.one-column #content {
padding: 0 60px;
}
スタイル追加:
welcart_basic-nova/css/home-parts.css 259行目
.home #content .sof {
margin-bottom: 30px;
padding: 0 15px;
}
welcart_basic-nova/css/home-parts.css 818行目
.home #content .sof {
margin-bottom: 0;
padding: 0 40px;
}
welcart_basic-nova/css/home-parts.css 820行目
.home #main.one-column #content {
padding: 0;
}
welcart_basic-nova/css/home-parts.css 981行目
.home #content .sof {
padding: 0 60px;
}
6. 商品売り切れ時、商品お問い合わせフォームから送信したメール本文に商品名が記載されない不具合を修正
js ファイルの追加:welcart_basic-nova/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-nova/functions.php 165行目
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-nova/inc/front-customized.php 331行目
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;
}
}
7. 購入制限数と在庫数が等しい場合の数量フィールド値が制限されていない不具合を修正
テンプレート修正:welcart_basic-nova/inc/front-customized.php 403行目
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 最新リリース情報



