オプションを表示するテンプレートタグ

フォーラム テンプレート(テーマ) オプションを表示するテンプレートタグ

  • このトピックには4件の返信、2人の参加者があり、最後にnanbuにより13年、 9ヶ月前に更新されました。
5件の投稿を表示中 - 1 - 5件目 (全5件中)
  • 投稿者
    投稿
  • #49804
    nafkln
    参加者

    数点の商品に、共通オプション(シングルセレクト)を必須で設定しております。

    商品の一覧で、共通オプションを設定してある商品にはオプションを表示させるにはどの様にタグを書けばよろしいでしょうか?

    アドバイスよろしくお願いします。

    あと、現在

    https://www.welcart.com/documents/manual/ucart%E3%83%86%E3%83%B3%E3%83%97%E3%83%AC%E3%83%BC%E3%83%88%E3%82%BF%E3%82%B0%E9%96%A2%E6%95%B0%E4%B8%80%E8%A6%A7

    のページに何も表示されません。

    #59753
    nanbu
    キーマスター

    ループ中で以下のように記述してオプションを表示できます。

    single_item.php より抜粋しています。

    <?php
    $html = '';
    if (usces_is_options()) {
    $html .= "<table class='item_option'><caption>".__('Please appoint an option.', 'usces')."</caption>n";
    while (usces_have_options()) {
    $html .= "<tr><th>" . $this->itemopt['key'] . '</th><td>' . usces_the_itemOption(usces_getItemOptName(),'','return') . "</td></tr>n";
    }
    $html .= "</table>n";
    }
    echo $html;
    ?>

    #59754
    nanbu
    キーマスター

    テンプレートタグ一覧ページ、ご指摘ありがとうございます。

    近々、新しいものも含めて更新しようと思います。

    よろしくお願いします。

    #59755
    nafkln
    参加者

    nanbuさん、ありがとうございます。

    そのまま、記述したところ

    Fatal error: Using $this when not in object context in /home/rockhands/www/wp-content/themes/example/ec_list.php on line 40

    と出てしまいます。

    商品の一覧を表示しているページで

    <table>

    <tr>

    <td rowspan=”4″ class=”photo”>“><?php usces_the_itemImage(0, 240, 160); ?></td>

    <th>品名:</th>

    <td class=”title”>“><?php usces_the_itemName(); ?></td>

    </tr>

    <th>価格:</th>

    <td><?php usces_have_skus(); ?><!? SKU情報取得準備タグ ?><span class=”price”><?php usces_the_itemPrice(); ?>円</span></td>

    </tr>

    <tr>

    <th>数量:</th>

    <td><?php usces_the_itemQuant(); ?> <?php usces_the_itemSkuButton(‘カートへ入れる’); ?></td>

    </tr>

    </table>

    「品名」「価格」「数量」「カートに入れる」というようにtableで組んであるのですが、この「数量」の前に<tr>を作ってオプションを入れて、選択させたいのですが、どうすればよろしいでしょうか?

    シングルページで、個々にやるべきでしょうか?

    #59756
    nanbu
    キーマスター

    では、

    $usces をglobal で指定して、$this を全て $usces に変更して見てください。

    tr の部分だけ必要ならばtable タグを取ってしまえば使えます。

5件の投稿を表示中 - 1 - 5件目 (全5件中)
  • このトピックに返信するにはログインが必要です。