Welcart Square 1.1 をリリースしました。
WCEX Favorites 対応
Welcart Square を独自にカスタマイズしている方で「WCEX Favorites」を導入される場合には、下記の修正が必要となります。
「お気に入りリスト」ページへのリンク設置
ヘッダーのメンバーメニューに「お気に入りリスト」ページへのリンクを設置します。
フック追加: welcart_basic-square/header.php 109行目あたり
<?php if( usces_is_login() ): ?>
<li><?php printf(__('Hello %s', 'usces'), usces_the_member_name('return')); ?></li>
<li><?php usces_loginout(); ?></li>
<li><a href="<?php echo USCES_MEMBER_URL; ?>"><?php _e('My page', 'welcart_basic') ?></a></li>
<?php do_action( 'usces_theme_login_menu' ); ?>
<?php else: ?>
<li><?php _e('guest', 'usces'); ?></li>
<li><?php usces_loginout(); ?></li>
<li><a href="<?php echo USCES_NEWMEMBER_URL; ?>"><?php _e('New Membership Registration','usces') ?></a></li>
<?php endif; ?>
※ do_action( ‘usces_theme_login_menu’ ) を追加
商品一覧にお気に入りアイコン設置
商品カテゴリーページや検索結果ページなどの商品一覧の各商品にお気に入りアイコンを設置します。
フック追加
: welcart_basic-square/front-page.php 68行目あたり
: welcart_basic-square/category.php 61行目あたり
: welcart_basic-square/search.php 33行目あたり
: welcart_basic-square/wc_search_page.php 67行目あたり
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="itemimg">
<a href="<?php the_permalink() ?>">
<?php usces_the_itemImage(0, 300, 300); ?>
<?php do_action( 'usces_theme_favorite_icon' ); ?>
<?php if( wcct_get_options('display_soldout') && !usces_have_zaiko_anyone() ): ?>
<div class="itemsoldout">
※ do_action( ‘usces_theme_favorite_icon’ ) を追加
商品詳細ページにお気に入りアイコン設置
商品詳細ページにお気に入りアイコンを設置します。
お気に入りアイコンの設置に伴いHTMLの構造の変更もおこなっております。
フック追加
: welcart_basic-square/wc_templates/wc_item_single.php 44行目あたり
: welcart_basic-square/wc_templates/wc_item_single_service.php 34行目あたり
: welcart_basic-square/wc_templates/wc_item_single_data.php 33行目あたり
: welcart_basic-square/wc_templates/wc_sku_select.php 44行目あたり
: welcart_basic-square/wc_templates/wc_sku_select_service.php 33行目あたり
<div id="img-box">
<?php $imageid = usces_get_itemSubImageNums(); ?>
<div class="slider slider-for itemimg">
<div><a href="<?php usces_the_itemImageURL(0); ?>" <?php echo apply_filters( 'usces_itemimg_anchor_rel', NULL ); ?>><?php usces_the_itemImage( 0, 335, 335, $post ); ?></a></div>
<?php foreach( $imageid as $id ) : ?>
<div><a href="<?php usces_the_itemImageURL($id); ?>" <?php echo apply_filters( 'usces_itemimg_anchor_rel', NULL ); ?>><?php usces_the_itemImage( $id, 335, 335, $post ); ?></a></div>
<?php endforeach; ?>
<?php if( !empty( $imageid ) ): ?>
<div class="slider slider-nav itemsubimg">
【変更後】
<div id="img-box">
<?php $imageid = usces_get_itemSubImageNums(); ?>
<div class="itemimg">
<div class="slider slider-for">
<div><a href="<?php usces_the_itemImageURL(0); ?>" <?php echo apply_filters( 'usces_itemimg_anchor_rel', NULL ); ?>><?php usces_the_itemImage( 0, 335, 335, $post ); ?></a></div>
<?php foreach( $imageid as $id ) : ?>
<div><a href="<?php usces_the_itemImageURL($id); ?>" <?php echo apply_filters( 'usces_itemimg_anchor_rel', NULL ); ?>><?php usces_the_itemImage( $id, 335, 335, $post ); ?></a></div>
<?php endforeach; ?>
</div>
<?php do_action( 'usces_theme_favorite_icon' ); ?>
</div>
<?php if( !empty( $imageid ) ): ?>
<div class="slider slider-nav itemsubimg">
※ do_action( ‘usces_theme_favorite_icon’ ) を追加
※ HTML構造の変更は、下記を参考にしてください。
HTML構造の変更
| 変更前 | 変更後 |
|---|---|
<div class="slider slider-for itemimg">
・・・
</div>
|
<div class="itemimg">
<div class="slider slider-for">
・・・
</div>
</div>
|
お気に入りリストページのテンプレート設置
Welcart Square 用のお気に入りリストページのテンプレートを設置します。
<設置手順>
- マイページの購入履歴より最新版のZipファイル(welcart_basic-square.1.1.zip)をダウンロードして解凍します。
- 解凍したファイル内の「wc_templates」の「member」フォルダ内に「wc_favorite_page.php」というテンプレートがございますので、お使いのテーマ内に同じ階層になるよう設置してください。
welcart_basic-square/wc_templates/member/wc_favorite_page.php
WCEX Favorties 専用の CSS追加
お気に入りリストページのテンプレートと同様に お気に入り専用のCSSを設置します。
<設置手順>
- マイページの購入履歴より最新版のZipファイル(welcart_basic-square.1.1.zip)をダウンロードして解凍します。
- 解凍したファイル内の「asses」の「css」フォルダ内に「favorite.css」というCSSファイルがございますので、お使いのテーマ内に同じ階層になるよう設置してください。
※「asses」「css」の各フォルダがお使いのテーマに存在しない場合は、フォルダも作成してCSSファイルを設置してください。welcart_basic-square/assets/css/favorite.css
Welcart 商品一覧ウィジェットを「WCEX Favorites」に対応
Welcart 商品一覧ウィジェットを「WCEX Favorites」に対応しました。
フック追加: welcart_basic-square/inc/front-customized.php 581行目あたり
add_filter( 'welcart_basic_filter_item_post', 'wcct_filter_item_post', 10 );
function wcct_filter_item_post( $list ){
$list = '';
$list .= '<article id="post-' . get_the_ID() . '">' . "\n";
$list .= '<a href="' . get_permalink( get_the_ID() ) .'">' . "\n";
$list .= '<div class="itemimg">' . "\n";
$list .= usces_the_itemImage( 0, 300, 300, '', 'return' ) . "\n";
$list .= apply_filters( 'usces_filter_theme_favorite_icon', '', 0 );
if( wcct_get_options( 'display_soldout' ) && !usces_have_zaiko_anyone() ) {
$list .= '<div class="itemsoldout">' . "\n";
※ apply_filters( ‘usces_filter_theme_favorite_icon’, ”, 0 ) を追加
お気に入りボタンの色調整
スタイル追加: welcart_basic-square/inc/theme-customizer.php 1003行目あたり
.item-info .skubutton:hover,
#wdgctToCheckout a:hover {
color: #fff;
background-color: rgba(<?php echo $cart_btn_rgb; ?>, .6 );
}
/* ---- WCEX Favorites ---- */
.favorite-button .add-favorite {
background-color: rgba(<?php echo $cart_btn_rgb; ?>, .1 );
border-color: rgba(<?php echo $cart_btn_rgb; ?>, 1 );
color: rgba(<?php echo $cart_btn_rgb; ?>, 1 );
}
.favorite-button .add-favorite:hover,
.favorite-button .add-favorite.added:hover {
color: #fff;
background-color: rgba(<?php echo $cart_btn_rgb; ?>, 1 );
}
#tofavorite-content .tofavorite-page-link a,
#tofavorite-content .tologin-page-link a,
#tofavorite-content .tologin-newmember-page-link a {
color: #fff;
background-color: rgba(<?php echo $cart_btn_rgb; ?>, 1 );
}
#tofavorite-content .tofavorite-page-link a:hover,
#tofavorite-content .tologin-page-link a:hover,
#tofavorite-content .tologin-newmember-page-link a:hover {
background-color: rgba(<?php echo $cart_btn_rgb; ?>, .6 );
}
/* =header
-------------------------------------------------------------- */
Welcart Basic 1.4 アップデートによるヘッダーのレイアウト崩れ修正
親テーマの Welcart Basic 1.4 では、ヘッダーのレイアウト調整をおこなっております。
それに伴い、Welcart Square が最新バージョンでない場合にはレイアウト崩れが発生します。Welcart Square を独自にカスタマイズしている方は、下記を参考にCSS の修正をおこなってください。
スタイル追加: welcart_basic-square/style.css 1640行目あたり
| 変更前 | 変更後 |
|---|---|
@media screen and (min-width: 62.5em) {
#mobile-menu .in {
width: 100%;
height: auto;
padding: 0;
overflow-y: inherit;
}
header .snav {
position: absolute;
top: 0;
right: auto;
z-index: 3;
}
.snav .search-box,
.snav .membership {
}
|
@media screen and (min-width: 62.5em) {
#mobile-menu .in {
width: 100%;
height: auto;
padding: 0;
overflow-y: inherit;
}
header .snav {
position: absolute;
top: 0;
right: auto;
z-index: 3;
width: auto;
}
.snav .search-box,
.snav .membership {
}
|
スタイル追加: welcart_basic-square/style.css 1730行目あたり
| 変更前 | 変更後 |
|---|---|
@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;
}
.snav .membership {
float: left;
padding: 0;
}
.snav .membership ul {
display: none;
position: absolute;
right: 0;
left: 50%;
top: 100%;
width: 245px;
}
|
@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;
}
.snav .membership {
float: left;
padding: 0;
width: auto;
}
.snav .membership ul {
display: none;
position: absolute;
right: 0;
left: 50%;
top: 100%;
width: 245px;
}
|
ヘッダーメンバーメニューのスタイル・レイアウト調整
会員ログイン時のメンバーメニューの表示順を変更しました。
テンプレート修正: welcart_basic-square/header.php 109行目あたり
【変更前】
<?php if( usces_is_login() ): ?>
<li><?php printf(__('Hello %s', 'usces'), usces_the_member_name('return')); ?></li>
<li><?php usces_loginout(); ?></li>
<li><a href="<?php echo USCES_MEMBER_URL; ?>"><?php _e('My page', 'welcart_basic') ?></a></li>
<?php do_action( 'usces_theme_login_menu' ); ?>
<?php else: ?>
<li><?php _e('guest', 'usces'); ?></li>
<li><?php usces_loginout(); ?></li>
<li><a href="<?php echo USCES_NEWMEMBER_URL; ?>"><?php _e('New Membership Registration','usces') ?></a></li>
<?php endif; ?>
【変更後】
<?php if( usces_is_login() ): ?>
<li><?php printf(__('Hello %s', 'usces'), usces_the_member_name('return')); ?></li>
<li><a href="<?php echo USCES_MEMBER_URL; ?>"><?php _e('My page', 'welcart_basic') ?></a></li>
<?php do_action( 'usces_theme_login_menu' ); ?>
<li><?php usces_loginout(); ?></li>
<?php else: ?>
<li><?php _e('guest', 'usces'); ?></li>
<li><?php usces_loginout(); ?></li>
<li><a href="<?php echo USCES_NEWMEMBER_URL; ?>"><?php _e('New Membership Registration','usces') ?></a></li>
<?php endif; ?>
※ usces_loginout() ログアウトの表示位置を変更



