「usces_the_item」の検索結果

フォーラム 検索 「usces_the_item」の検索結果

15件の結果を表示中 - 421 - 435件目 (全529件中)
  • 投稿者
    検索結果
  • 9steps
    参加者

    いつもお世話になります。

    テンプレートをカスタマイズしていて気が付いたので、投稿させていただきます。

    usces_error_message関数やusces_singleitem_error_message関数など、テンプレート各所にエラーを表示する関数が記述されておりますが、エラーがない時にも空のDIVタグが出力されてしまうようです。

    <div class="error_message">エラーメッセージ</div>

    これですと、エラー発生時にエラーを目立たせて表示するために、DIVタグをborderで囲ったり、背景色を付けてしまうと、エラー発生時以外にも、枠や背景色が表示されてしまいます。

    例をあげますと、次のようにエラーメッセージがあるときだけ、DIVタグを含めて表示するように分岐処理をテンプレートに入れるように変更すると良いのではないでしょうか?

    wc_item_single.php

    <div class="error_message"><?php usces_singleitem_error_message($post->ID, usces_the_itemSku('return')); ?></div>



    <?php $error_msg = usces_singleitem_error_message($post->ID, usces_the_itemSku('return')); ?>
    <?php if ( !empty($error_msg) ): ?>
    <div class="error_message"><?php echo $error_msg; ?></div>
    <?php endif; ?>

    wc_login_page.php

    <div class="error_message"><?php usces_error_message(); ?></div>



    <?php $error_msg = usces_error_message("return"); ?>
    <?php if ( !empty($error_msg) ): ?>
    <div class="error_message"><?php echo $error_msg; ?></div>
    <?php endif; ?>

    細かい点なのですが、要望として取り上げていただければ幸いです。

    動作に関するご質問の場合は必ずご記入ください。


    Welcart のバージョン:

    症状を確認したブラウザ:

    サーバー(会社名、サービス名):

    SSLの利用: 無し | 専用SSL | 共用SSL

    WordPress のパーマリンク設定:


    toorisugari
    参加者

    WordPress自体とWelcartを最新版にバージョンアップしたところ、商品のメイン画像が表示されなくなりました。

    ページのソースコードをみると

    <div class=”itemimg”>

    </div>

    のように空の状態です。

    ローカルに保存してあったバージョンアップ前の

    usc-e-shop/templates/

    のファイルに戻して戻してみましたが表示されませんでした。

    (バージョンアップ前は同ファイルで表示されていた。)

    該当箇所のコードは引数のみをかえたデフォルトのままで

    $html .= ‘<div class=”itemimg”>’.”n”;

    $html .= ‘<a href=”‘ . usces_the_itemImageURL(0, ‘return’) . ‘”‘;

    $html = apply_filters(‘usces_itemimg_anchor_rel’, $html);

    $html .= ‘>’;

    $itemImage = usces_the_itemImage(0, 200, 250, $post, ‘return’);

    $html .= apply_filters(‘usces_filter_the_itemImage’, $itemImage, $post);

    $html .= ”.”n”;

    の箇所です。

    バージョンアップで何か変更になったのでしょうか。

    どうすればメインイメージを表示(ソースコードの吐き出し)ができますでしょうか。


    Welcart のバージョン:1.0.6

    症状を確認したブラウザ:Firefox 3.6

    サーバー(会社名、サービス名):さくら共用スタンダード

    SSLの利用: 無し

    WordPress のパーマリンク設定:

    WordPressのバージョン 3.2.1


    #62773

    返信が含まれるトピック: [解決済み] Slide Showcaseについて

    ipd
    参加者

    コピペの時に改行なりがおかしくなってたんですね…

    ありがとうございます!無事に出来ました!

    さらに下記の様にコードを追加したら「売切れ」の商品のみ「SOLD OUT」と表示出来る様にもなりました。

    本当に何度丁寧にありがとうございました。

    add_filter('slide_showcase_filter_list', 'my_showcase_filter_list', 10, 2);
    function my_showcase_filter_list($html, $post){
    global $usces;
    $list = '
    <li><a>ID) . '">' . usces_the_itemImage($number = 0, $width = 130, $height = 130, $post, 'return' ) . '<div class="thumtitle">' . esc_html(usces_the_itemName('return')) . '</div></a><div class="price">' . __('$', 'usces') . number_format(usces_the_firstPrice('return')) . $usces->getGuidTax() . '<div class="zaiko">' . esc_html(!usces_have_zaiko_anyone() ? 'SOLD OUT' : ''). '</div></li>
    ';
    return $list;
    }

    #62772

    返信が含まれるトピック: [解決済み] Slide Showcaseについて

    nanbu
    キーマスター

    こちらでは問題なく動作していますので、コピペするときにおかしくなるのかもしれませんね。

    改行は無くても問題ありませんので、改行を取って下記のコードではどうでしょうか。

    add_filter('slide_showcase_filter_list', 'my_showcase_filter_list', 10, 2);
    function my_showcase_filter_list($html, $post){
    global $usces;
    $list = '<li><a href="' . get_permalink($post->ID) . '">' . usces_the_itemImage($number = 0, $width = 130, $height = 130, $post, 'return' ) . '<div class="thumtitle">' . esc_html(usces_the_itemName('return')) . '</div></a><div class="price">' . __('$', 'usces') . number_format(usces_the_firstPrice('return')) . $usces->getGuidTax() . '</div></li>';
    return $list;
    }

    #62770

    返信が含まれるトピック: [解決済み] Slide Showcaseについて

    nanbu
    キーマスター

    ありがとうございます。

    では、この様にしてみていただけますでしょうか。

    add_filter('slide_showcase_filter_list', 'my_showcase_filter_list', 10, 2);
    function my_showcase_filter_list($html, $post){
    global $usces;
    $list = '<li><a href="' . get_permalink($post->ID) . '">' . usces_the_itemImage($number = 0, $width = 130, $height = 130, $post, 'return' ) . '<div class="thumtitle">' . esc_html(usces_the_itemName('return')) . '</div></a><div class="price">' . __('$', 'usces') . number_format(usces_the_firstPrice('return')) . $usces->getGuidTax() . '</div></li>' . "n";
    return $list;
    }

    #62767

    返信が含まれるトピック: [解決済み] Slide Showcaseについて

    ipd
    参加者

    置き換えましたが5行目でエラーがでてます…

    <?php
    add_filter('slide_showcase_filter_list', 'my_showcase_filter_list', 10, 2);
    function my_showcase_filter_list($html, $post){

    $html = '
    <li><a>ID) . '">' . usces_the_itemImage($number = 0, $width = 130, $height = 130, $post, 'return' ) . '<div class="thumtitle">' . esc_html(usces_the_itemName('return')) . '</div></a><div class="price">' . __('$', 'usces') . number_format(usces_the_firstPrice('return')) . $usces->getGuidTax() . '</div></li>
    ' . "n";

    return $list;
    }

    ?>

    usces_have_zaiko_anyone()などが有りませんがこれでも売切れた物のみ売切れを表示できるのですか??

    #62766

    返信が含まれるトピック: [解決済み] Slide Showcaseについて

    nanbu
    キーマスター

    この様にしてください。

    add_filter('slide_showcase_filter_list', 'my_showcase_filter_list', 10, 2);
    function my_showcase_filter_list($html, $post){
    $list = '<li><a href="' . get_permalink($post->ID) . '">' . usces_the_itemImage($number = 0, $width = 130, $height = 130, $post, 'return' ) . '<div class="thumtitle">' . esc_html(usces_the_itemName('return')) . '</div></a><div class="price">' . __('$', 'usces') . number_format(usces_the_firstPrice('return')) . $usces->getGuidTax() . '</div></li>' . "n";
    return $list;
    }

    #62764

    返信が含まれるトピック: [解決済み] Slide Showcaseについて

    ipd
    参加者

    そのまま置き換えて下記コードを設置致しましたが売切れの商品が売切れと表示されません…

    エラーは出ておりませんが。

    <?php

    add_filter('slide_showcase_filter_list', 'my_showcase_filter_list', 10, 2);
    function my_showcase_filter_list($html, $post){
    $args = func_get_args();
    $post = $args[1];
    $opts = $args[2];
    $width = $opts['width'];
    $colum = $opts['colum'];
    $limargin = $opts['limargin'];
    $lipadding = $opts['lipadding'];
    $liborder = $opts['liborder'];
    $liwidth = ($width + $limargin) / $colum - $limargin - ($lipadding * 2) - ($liborder * 2);
    $liheight = $opts['liheight'] - $lipadding * 2;
    $txtheight = $opts['txtheight'];
    $imgwidth = $liwidth;
    $imgheight = $liheight - $txtheight;
    $border = $liborder ? '' : 'border:0px';
    usces_have_skus();

    $list = '
    <li><a>ID) . '">' . usces_the_itemImage($number = 0, $width = 130, $height = 130, $post, 'return' ) . '<div class="thumtitle">' . esc_html(usces_the_itemName('return')) . '</div></a><div class="price">' . __('$', 'usces') . number_format(usces_the_firstPrice('return')) . $usces->getGuidTax() . '<div class="zaiko">' . esc_html(!usces_have_zaiko_anyone() ? 'SOLD OUT' : ''). '</div></li>
    ' . "n";

    return $list;
    }
    ?>

    #62761

    返信が含まれるトピック: [解決済み] Slide Showcaseについて

    nanbu
    キーマスター

    前にもお話いたしましたが、残念ながら、「Slide Showcase」は1行(1ライン)表示しかできません。スタイルシートで2段にしているのが原因かと思います。

    Slide Showcase には、slide_showcase_filter_list というフックが有ります。後はItem List Layout の時と同じ要領です。

    add_filter('slide_showcase_filter_list', 'my_showcase_filter_list', 10, 2);
    function my_showcase_filter_list($html, $post){

    $list = '<li><a href="' . get_permalink($post->ID) . '">' . usces_the_itemImage($number = 0, $width = 130, $height = 130, $post, 'return' ) . '<div class="thumtitle">' . esc_html(usces_the_itemName('return')) . '</div></a><div class="price">' . __('$', 'usces') . number_format(usces_the_firstPrice('return')) . $usces->getGuidTax() . '</div></li>' . "n";

    return $list;
    }

    #62730

    返信が含まれるトピック: 商品一覧の在庫表示に関して。

    nanbu
    キーマスター

    ( ‘SOLD OUT’ == usces_the_itemZaiko(‘return’) ? usces_the_itemZaiko(‘return’) : ” )

    (usces_have_zaiko_anyone() ? ‘売切れ’ : ”)

    に書き換えます。

    global $usces, $post; をお忘れなく。

    #62728

    返信が含まれるトピック: 商品一覧の在庫表示に関して。

    akia
    参加者

    ご親切に教えて下さってますのに頭が悪い為まだわかりません…

    <div class=”zaiko”>’ . esc_html( ‘SOLD OUT’ == usces_the_itemZaiko(‘return’) ? usces_the_itemZaiko(‘return’) : ” ) . ” . “”;

    この部分のどれかを. ‘<div>’ . (usces_have_zaiko_anyone() ? ‘売切れ’ : ”) . ‘</div>’ .に置き換えるのでしょうか?

    それとも単純に追加すれば良いのでしょうか?

    どちらも試してみてるのですがParse error: syntax error, unexpected ‘>’ in /export/sd203〜のエラーが出てきてしまうんです…

    すみません…

    #62737
    nanbu
    キーマスター

    someone さん、画像のURIを指定できるんですね。

    これでどうでしょうか。

    $image = usces_the_itemImageURL(0, 'return', $post);

    #62722
    morixkoro
    参加者

    ありがとうございます。

    今回はとりあえず無理やり画像イメージのパスである、usces_the_itemImageでなくusces_the_itemImageURLのコードを利用することで画像切り替えが可能となり解決いたしました。

    厚く感謝申し上げます。

    morixkoro
    参加者

    welcartを利用させていただいております、厚く感謝申し上げます。

    さて、

    商品詳細ページに表示されているメイン画像を、マウスでクリックしてサブイメージと画像の切り替え変更が可能なように、imgのパラメータにnameタグを新たに追加したいのですが、スキルが無いためタグの追加方法がよくわかりません。

    たぶんimgデータは下の

    pluginsusc-e-shopfunctionstemplate_func.php

    にて、商品のimgデータが書き出されているかと思いますが、imgデータに”name”のタグの追加方法についてお教えいただければありがたく存じます。

    商品詳細ページに書き出されている現在の状態


    <a href=”http://www.hoge.jp/shop/wp-content/uploads/photo.jpg”><img src=”http://www.hoge.jp/shop/wp-content/uploads/photo.jpg&#8221; alt=”hoge” title=”hogehogephoto” /></a>

    修正後に以下のようにnameを追加したのですが(この場合nameに代入する値は適当な固定の名称exampleのままで構わないですが・・)


    <div class=”itemimg”>

    <a href=”http://www.hoge.jp/shop/wp-content/uploads/photo.jpg”><img src=”http://www.hoge.jp/shop/wp-content/uploads/photo.jpg&#8221; alt=”hoge” title=”hogehogephoto” name=”example”/></a> </div>


    修正部分は、たぶん

    pluginsusc-e-shopfunctionstemplate_func.phpに記載されている以下の部分を修正するかと思いますがスキルがなく記述の仕方がよくわかりません、よろしくお願いいたします。

    function usces_the_itemImage($number = 0, $width = 60, $height = 60, $post = ”, $out = ”, $media = ‘item’ ) {

    global $usces;

    if($post == ”) global $post;

    $post_id = $post->ID;

    $code = get_post_custom_values(‘_itemCode’, $post_id);

    if(!$code) return false;

    $name = get_post_custom_values(‘_itemName’, $post_id);

    if( 0 == $number ){

    $pictid = $usces->get_mainpictid($code[0]);

    $html = wp_get_attachment_image( $pictid, array($width, $height), false );//’‘;

    if( ‘item’ == $media ){

    $alt = ‘alt=”‘.esc_attr($code[0]).'”‘;

    $alt = apply_filters(‘usces_filter_img_alt’, $alt, $post_id, $pictid);

    $html = preg_replace(‘/alt=”[^”]*”/’, $alt, $html);

    $title = ‘title=”‘.esc_attr($name[0]).'”‘;

    $title = apply_filters(‘usces_filter_img_title’, $title, $post_id, $pictid);

    $html = preg_replace(‘/title=”[^”]+”/’, $title, $html);

    }

    }else{

    $pictids = $usces->get_pictids($code[0]);

    $html = wp_get_attachment_image( $pictids[$number], array($width, $height), false );//’‘;

    if( ‘item’ == $media ){

    $alt = ‘alt=”‘.esc_attr($code[0]).'”‘;

    $alt = apply_filters(‘usces_filter_img_alt’, $alt, $post_id, $pictids[$number]);

    $html = preg_replace(‘/alt=”[^”]*”/’, $alt, $html);

    $title = ‘title=”‘.esc_attr($name[0]).'”‘;

    $title = apply_filters(‘usces_filter_img_title’, $title, $post_id, $pictids[$number]);

    $html = preg_replace(‘/title=”[^”]+”/’, $title, $html);

    }

    }

    if($out == ‘return’){

    return $html;

    }else{

    echo $html;


    Welcart のバージョン:1.06β

    症状を確認したブラウザ:

    サーバー(会社名、サービス名):xserver

    SSLの利用: 無し | 専用SSL | 共用SSL

    WordPress のパーマリンク設定:


    #62619
    ipd
    参加者

    ありがとうございます。
これで理想の表示にできました!
( ‘売切れ’ == usces_the_itemZaiko(‘return’) : ” )では何度も試したのですが( ‘売切れ’ == usces_the_itemZaiko(‘return’) ? usces_the_itemZaiko(‘return’) : ” )だったんですね。
本当に長いやりとりにお付き合いいただきましてありがとうございます。

15件の結果を表示中 - 421 - 435件目 (全529件中)