ohnishi様 yasumax様
ご返信ありがとうございます。
頂いた点の修正を試してみます。
>yasumax様
usces_have_zaiko()の分岐は不要と言うのは、コードの下記(最後に添付)から、
<?php if( usces_have_zaiko() ): ?>、
<?php else: ?>、
<?php endif; ?>
の3つを削除するということでしょうか。それとも他に修正必要でしょうか。
現状、↑とloading画像の指定以外を反映しているところですが、
①プルダウンは表示されるようになった②プルダウンもラジオボタンも
カートに入れる際は1つ目のskuの分が入るという状況です。
以上、何卒よろしくお願いいたします。
<?php if( usces_have_zaiko() ): ?>
<?php if (usces_is_options()): while (usces_have_options()) : ?>
<table class="item-option">
<tbody>
<tr><td><?php usces_the_itemOptName(); ?></td><td><?php usces_the_itemOption(usces_getItemOptName(),''); ?></td></tr>
</tbody>
</table>
<?php endwhile; endif; ?>
<span class="item-quant"><?php usces_the_itemQuant(); ?></span><?php usces_the_itemSkuUnit(); ?>
<?php usces_the_itemSkuButton(' ' .__( 'Add to Cart', 'blanc' ), 0); ?>
<?php else: ?>
<span class="ss_stockstatus"><?php $stock = usces_get_itemZaiko( 'name' ); ?></span>
<?php echo sprintf(__('<p class="item-stock">This item is currently %s.</p>', 'blanc'), $stock ); ?>
<span class="ss_stockstatus"><?php echo apply_filters('usces_filters_single_sku_zaiko_message', esc_html(usces_get_itemZaiko( 'name' ))); ?></span>
<?php endif; ?>
>ohnishi様
コメントありがとうございました。
コードは下記になります。無茶苦茶な修正をしているかもしれませんが、
何卒よろしくお願いいたします。
<?php get_header();?>
<?php get_template_part('breadcrumbs-item'); ?>
<article <?php post_class(); ?>>
<?php if( have_posts() ): the_post(); ?>
<?php usces_remove_filter(); ?>
<?php usces_the_item(); ?>
<?php usces_have_skus(); ?>
<div class="row">
<div class="columns medium-7">
<div class="flexslider slider-item">
<ul class="slides">
<li><a>" <?php echo apply_filters('usces_itemimg_anchor_rel', NULL); ?>><?php usces_the_itemImage(0, 640, 640, $post); ?></a></li>
<?php $imageid = usces_get_itemSubImageNums(); if($imageid): foreach ( $imageid as $id ) : ?>
<li><a>" <?php echo apply_filters('usces_itemimg_anchor_rel', NULL); ?>><?php usces_the_itemImage($id, 640, 640, $post); ?></a></li>
<?php endforeach; endif; ?>
</ul>
</div>
<?php if( $imageid ): ?>
<div class="flexslider">
<ul class="slides">
<li><?php usces_the_itemImage(0, 200, 200, $post); ?></li>
<?php foreach ( $imageid as $id ) : ?>
<li><?php usces_the_itemImage($id, 200, 200, $post); ?></li>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>
</div><!-- columns -->
<div class="columns medium-5">
<h1 class="entry-title item-title" itemprop="name"><?php usces_the_itemName(); ?></h1>
<time datetime="<?php echo get_the_date('c'); ?>" class="updated hide"><?php echo get_the_date(); ?></time>
<form action="<?php echo USCES_CART_URL; ?>" method="post" class="skuform">
<?php wcex_sku_select_form(); ?>
<div>
<meta itemprop="availability" href="http://schema.org/InStock" content="<?php usces_the_itemZaiko(); ?>">
<div class="item-price text-gray">
<?php if( usces_the_itemCprice('return') > 0 ) : ?>
<div class="field_cprice"><span class="ss_cprice"><?php usces_the_itemCpriceCr(); ?><?php usces_guid_tax(); ?></span></div>
<?php endif; ?>
<span itemprop="price">
<b class="font-bigger"><div class="field_price"><span class="ss_price"><?php usces_the_itemPriceCr(); ?></span></div></b><?php usces_guid_tax(); ?>
</span>
</div>
<?php usces_the_itemGpExp(); ?>
<?php if( usces_have_zaiko() ): ?>
<?php if (usces_is_options()): while (usces_have_options()) : ?>
<table class="item-option">
<tbody>
<tr><td><?php usces_the_itemOptName(); ?></td><td><?php usces_the_itemOption(usces_getItemOptName(),''); ?></td></tr>
</tbody>
</table>
<?php endwhile; endif; ?>
<span class="item-quant"><?php usces_the_itemQuant(); ?></span><?php usces_the_itemSkuUnit(); ?>
<?php usces_the_itemSkuButton(' ' .__( 'Add to Cart', 'blanc' ), 0); ?>
<?php else: ?>
<span class="ss_stockstatus"><?php $stock = usces_get_itemZaiko( 'name' ); ?></span>
<?php echo sprintf(__('<p class="item-stock">This item is currently %s.</p>', 'blanc'), $stock ); ?>
<span class="ss_stockstatus"><?php echo apply_filters('usces_filters_single_sku_zaiko_message', esc_html(usces_get_itemZaiko( 'name' ))); ?></span>
<?php endif; ?>
<?php echo apply_filters('single_item_single_sku_after_field', NULL); ?>
</div>
<?php do_action('usces_action_single_item_inform'); ?>
</form>
<?php do_action('usces_action_single_item_outform'); ?>
<?php usces_singleitem_error_message($post->ID, usces_the_itemSku('return')); ?>
<?php if( $item_custom = usces_get_item_custom( $post->ID, 'table', 'return' ) ){ echo $item_custom; } ?>
<div>
<?php the_content(); ?>
<?php the_tags('<p class="text-gray"><i class="fa fa-tag"></i> ', ',', '</p>'); ?>
</div>
</div><!-- columns -->
</div><!-- row -->
<div class="row">
<div class="columns">
</div>
</div>
<?php endif; ?>
</article>
<?php get_footer(); ?>
商品詳細ページにあるように
通常価 売価(税別)
例: ¥580 ¥500(税別)
上記を
Welcart Basicのトップページのお勧め商品一覧の画像の下に表示するために
front-page.phpの該当部分(38行以下)を下記のように修正しました。
<?php if( usces_the_itemCprice(‘return’) > 0 ) : ?>
<span class=”field_cprice ss_cprice_regular”><?php usces_the_itemCpriceCr(); ?></span>
<?php endif; ?>
<span class=”sell_price ss_price_regular”><?php wcad_the_itemPriceCr(); ?></span><?php usces_guid_tax(); ?>
でも、この書き方はレイアウトが崩れていまいます。
どなたかご指南をお願いします。
こんにちは
できません。usces_the_itemImage()では、第2第3引数にサイズを指定することになります。
——————————————-
WordPress のバージョン:4.6.1
Welcart のバージョン:1.9.0
ご利用のテーマ:Welcart Basic
——————————————–
usces_the_itemImage で WordPressのメディアサイズ(thumbnail, medium, large, full と自身でfunctions.phpで add_image_size で追加、命名したサイズ)の出力はできませんか?
romen 様
usces_the_itemSkuButton の引数は以下のようになります。
template_func.php 内
usces_the_itemSkuButton( $value, $type=0, $out=” )
$value : ボタンに表示する文字
$type : 0=’submit’, 1=’button’
$out : ”=echo, ‘return’=return
尚、カスタマイズの際にはフィルターフック usces_filter_item_sku_button をご利用ください。
——————————————-
WordPress のバージョン:4.6.1
Welcart のバージョン:1.9.0
ご利用のテーマ:welcart_basic
症状を確認したブラウザ:
サーバー(会社名、サービス名):xserver
SSLの利用: なし
WordPress のパーマリンク設定:/%postname
——————————————–
連続の質問で申し訳ありません。商品詳細ページのカートボタンについてお聞きしたいことがあります。複数のSKUを設定している場合、カートボタンもループによって表示されると思います。
<?php usces_the_itemSkuButton( ‘ ‘ . __(‘Add to Shopping Cart’, ‘usces’ ), 0 ); ?>
このカートボタンの関数のパラメータはどのように指定しているのでしょうか?ループを使わずにSKU価格を表示したいと考えています。
ご教授お願いします。
度々すみません、自己解決いたしました。
料金を出す記述の前にも
<?php usces_the_item(); ?>
<?php usces_have_skus(); ?>
を入れる必要がありました。
お騒がせいたしました。
——————————————-
WordPress のバージョン: 3.7.15
Welcart のバージョン:1.4.5
ご利用のテーマ:Frontier
症状を確認したブラウザ:windows Chrome
サーバー(会社名、サービス名):ロリポップ
SSLの利用:あり
WordPress のパーマリンク設定:/%post_id%.html
——————————————–
お世話になります。
商品一覧ページに販売価格を表示させたくて以下のような記述をしたところ、
最初の商品のみ販売価格が表示されず、2番目以降は正常に表示されます。
どこかに1つ目は表示させない指定などあるのでしょうか。
phpに詳しくなく、検索にもかからず詰まってしまいました。
ヒントだけでもあると助かります。
よろしくお願いいたします。
<?php do_action('frontier_before_blog_post'); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class('blog-view'); ?>>
<div class="entry-byline">
<?php $blog_elements = frontier_option('blog_elements'); ?>
<!--<?php if ( ( !isset($blog_elements['categories']) || $blog_elements['categories'] != 0 ) && ( get_post_type() == 'post' ) ) : ?><div class="entry-categories"><i class="genericon genericon-category"></i><?php the_category(', '); ?></div><?php endif; ?>-->
<?php edit_post_link( __('Edit', 'frontier'), '<i class="genericon genericon-edit"></i>' ); ?>
</div>
<div class="entry-content">
<?php do_action('frontier_before_blog_post_content'); ?>
<div class="price_ichiran">
<?php if (usces_is_skus()) : ?>
<div class="price"><?php usces_crform( usces_the_firstPrice('return'), true, false ); ?><?php usces_guid_tax(); ?></div>
<?php endif; ?>
</div>
<?php usces_the_item(); ?>
<?php usces_have_skus(); ?>
<?php
$status = usces_get_itemZaiko( 'id' );
switch( $status ){
case 2:
echo '<span class="soldout">売り切れ</span>';
break;
case 3:
echo '<span class="waiting">入荷待ち</span>';
break;
}
?>
<?php if ( frontier_option('blog_display', 'excerpt') == 'excerpt' ) : ?>
<?php if ( has_post_thumbnail() && $blog_elements['thumbnail'] == 1 ) : ?>
<div class="entry-thumbnail">
<a>"><?php frontier_option('excerpt_thumbnail', '150') == '150' ? the_post_thumbnail('thumbnail') : the_post_thumbnail('thumb-200x120'); ?></a>
</div>
<?php endif ; ?>
<div class="entry-excerpt"><?php the_excerpt(); ?></div>
<?php else : ?>
<?php the_content(); ?>
<?php endif ; ?>
<?php wp_link_pages( array(
'before' => '<div class="page-nav">' . __('<span>Pages</span>', 'frontier'),
'after' => '</div>',
'link_before' => '<span>',
'link_after' => '</span>',
'next_or_number' => 'number',
'nextpagelink' => __('Next page', 'frontier'),
'previouspagelink' => __('Previous page', 'frontier'),
'pagelink' => '%',
'echo' => 1 )
);
?>
<?php do_action('frontier_after_blog_post_content'); ?>
</div>
——————————————-
WordPress のバージョン:4.6
Welcart のバージョン:1.8.8
ご利用のテーマ:welcart basic
WCEX SKU Selectのバージョン:1.0.2
——————————————–
商品詳細ページに残り在庫数を表示したいとおもています。
通常のページでは大丈夫なんですが、WCEX SKU Selectを使っている商品だと在庫表示がうまくいきません。
以下の2パターンを試してみました。
<div class="itemsoldout"><?php echo apply_filters( 'usces_filters_single_sku_zaiko_message', __('売り切れ','welcart_basic') ); ?></div> <div class="c-box"> <p>残り <?php usces_the_itemZaikoNum(); ?>個</p> </div>
こちらは在庫がない場合は「売り切れ」の表示をしてくれますが、その他の場合はSKU表示名の1番先頭に登録しているものの在庫数が表示されます。
<?php if(usces_the_itemZaikoNum('return')) : ?> <!-- 在庫数が有る場合の処理 --> <p>在庫 <?php usces_the_itemZaikoNum(); ?>個</p> <?php else: ?> <!-- 在庫数が無い場合の処理 --> <?php endif; ?>
この場合はSKU表示名の全てのものに対して1番上のものの在庫数が表示されてしまいます。
セレクトボックスで商品を選ぶたびに表示在庫数が変わる方法があれば教えていただければと思います。
よろしくお願いします。
こんにちは
<?php usces_the_itemImageCaption(); ?>
というテンプレートタグがございますので、
商品メイン・サブ画像のアンカータグのタイトル属性に上記タグを追記することで
画像拡大時にキャプションが表示されるようになります。
どうぞよろしくお願いいたします。
商品詳細のページでは、商品の番号が商品コードになっています。
wc_templates/wc_item_single.php内
(<?php usces_the_itemCode(); ?>)
これをskuに入れた番号にしたいのですが、どのように書き換えればよいか
ご教授いただけると幸いです。
——————————————-
WordPress のバージョン:最新
Welcart のバージョン:最新
ご利用のテーマ:WELCART NOVA
症状を確認したブラウザ:
サーバー(会社名、サービス名):さくらレンタルサーバー
SSLの利用:
WordPress のパーマリンク設定:
——————————————–
いつもお世話になります。
商品一覧ページに売切れか入荷待ちかの状況を商品一覧で表示させたいのですがうまく設定ができません。
(1)以下を追記すると在庫の有無にかかわらず全て『在庫有り』の表示となってしまいます。
※商品個別ページでは商品マスター通りの表示
↓
<?php usces_the_itemZaikoStatus(); ?>
(2)売切れ、入荷待ちの切り替えをさせるため、下記コードを記入すると何も表示されません。
↓
<?php
$status = usces_get_itemZaiko( ‘id’ );
switch( $status ){
case 2:
echo ‘<span class=”soldout”>売り切れ</span>’;
break;
case 3:
echo ‘<span class=”waiting”>入荷待ち</span>’;
break;
}
?>
ご教示のほど宜しくお願い致します。
価格の表示で、<?php usces_the_itemPrice(); ?>や<?php usces_the_itemCprice(); ?>とすれば、¥マーク無しで数字を返してくれるのが、標準使用ですが、WCEX SKU Selectでは、¥マークが付いて表示されるバグがありました。
-
このトピックは
nanbuが9年、 3ヶ月前に変更しました。