16
May
[PR]
×
[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。
[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。
//特定のSKUがカートに入っている場合、送料無料
add_filter(
'usces_filter_set_cart_fees_shipping_charge'
,
'mysku_set_cart_fees_shipping_charge'
, 10, 3);
function
mysku_set_cart_fees_shipping_charge(
$shipping_charge
,
$carts
,
$entries
){
$mysku
=
array
(
'SKU1'
,
'SKU2'
);
//送料無料のSKUを記入
foreach
(
$carts
as
$cart
){
$sku
=
$cart
[
'sku'
];
if
(in_array(
$sku
,
$mysku
)){
$shipping_charge
= 0;
}
}
return
$shipping_charge
;
}
add_filter( 'usces_filter_item_list_loopimg', 'my_filter_searchpage', 10, 2);
function my_filter_searchpage($html, $content){
global $post , $usces;
$html = '<div class="mysearch_box"><a href="' . get_permalink($post->ID) . '">' . usces_the_itemImage(0, 150, 150, $post, 'return');
$html .= '<div class="mysearch_title">' . usces_the_itemName( 'return' ) . '</div></a>';
if (usces_the_itemZaiko('return') == '売切れ'){
$html .= '<div class="price">';
$html .= usces_the_itemZaiko('return') . '</div>';
}else{
if (usces_the_firstCprice('return') > 0) {
$html .= '<div class="reg_price">';
if( function_exists('usces_crform') ){
$html .= usces_crform( usces_the_firstCprice('return'), true, false, 'return' );
}else{
$html .= __('$', 'usces') . number_format(usces_the_firstCprice('return'));
}
$html .= $usces->getGuidTax() . '</div>';
}
$html .= '<div class="price">' . usces_crform( usces_the_firstPrice('return'), true, false , 'return' );
$html .= $usces->getGuidTax() . '</div>' . '</div>';
}
return $html;
}
これを丸ごとコピペして改変していってなんとかできた。
しかしここに抜粋のせたいとか色々やろうとしたけど、全然うまくいかないのであきらめた。
function usces_loginout( $out = '') { global $usces; if ( !$usces->is_member_logged_in() ) $res = '<a href="' . apply_filters('usces_filter_login_uri', USCES_LOGIN_URL) . '" class="usces_login_a">' . apply_filters('usces_filter_loginlink_label', __('Log-in','usces')) . '</a>'; else $res = '<a href="' . apply_filters('usces_filter_logout_uri', USCES_LOGOUT_URL) . '" class="usces_logout_a">' . apply_filters('usces_filter_logoutlink_label', __('Log out','usces')) . '</a>'; if( $out == 'return' ){ return $res; }else{ echo $res; } }
<?php //現在のカテゴリが子カテゴリを持つかどうか判定する $children = get_category_children($cat); //子カテゴリを持つなら、子孫カテゴリのリンクリストを表示 if ($children) : ?> <ul> <?php wp_list_categories('title_li=&child_of='.$cat); ?> </ul> <?php //子カテゴリを持たないなら、タイトルリンクを表示 else: ?> <ul> <?php while(have_posts()) : the_post(); ?> <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li> <?php endwhile; ?> </ul> <?php endif; ?>