<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Welcart コミュニティー &#187; テンプレートタグ</title>
	<atom:link href="http://www.welcart.com/community/archives/tag/%e3%83%86%e3%83%b3%e3%83%97%e3%83%ac%e3%83%bc%e3%83%88%e3%82%bf%e3%82%b0/feed" rel="self" type="application/rss+xml" />
	<link>http://www.welcart.com/community</link>
	<description>Welcart に関する情報を交換しましょう</description>
	<lastBuildDate>Wed, 28 Jul 2010 03:06:41 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>uCart Defaultテンプレートにて</title>
		<link>http://www.welcart.com/community/archives/869</link>
		<comments>http://www.welcart.com/community/archives/869#comments</comments>
		<pubDate>Fri, 12 Feb 2010 00:48:40 +0000</pubDate>
		<dc:creator>toshi</dc:creator>
				<category><![CDATA[デザインテーマについて]]></category>
		<category><![CDATA[カスタマイズ]]></category>
		<category><![CDATA[テンプレートタグ]]></category>

		<guid isPermaLink="false">http://www.usconsort.com/community/?p=869</guid>
		<description><![CDATA[こんにちは。とても便利に使用させていただいてます。テンプレートにて数点教えていただきたいのですが、トップページ（home.php）のお勧め商品数を変更したいのですが、たとえば
＜?php //$posts_per_pag [...]]]></description>
			<content:encoded><![CDATA[<p>こんにちは。とても便利に使用させていただいてます。テンプレートにて数点教えていただきたいのですが、トップページ（home.php）のお勧め商品数を変更したいのですが、たとえば</p>
<p>＜?php //$posts_per_page = 8; ?＞</p>
<p>の８→４に変更しても変わらないのですが、どのタグを変更すれば、表示数変更できますでしょうか？</p>
<p>また別件になりますが、商品詳細テンプレート（single_item.php）でオプション品紹介する場合は、商品コードを○○○の場合、画像名を○○○-1連番として、対応できますが、任意で選択するといったことはできませんか？具体的には関連商品として、セレクトしたいのですが、登録の仕方等で案ありましたら教えていただけますでしょうか？</p>
<p>最後に要望ですが、管理画面商品マスターで選択した商品を一括でカテゴリ-変更や、公開非公開を変更できるようにはできませんでしょうか？</p>
<p>以上宜しくお願いします。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.welcart.com/community/archives/869/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Welcart テンプレートタグ一覧</title>
		<link>http://www.welcart.com/community/archives/799</link>
		<comments>http://www.welcart.com/community/archives/799#comments</comments>
		<pubDate>Sat, 06 Feb 2010 06:47:30 +0000</pubDate>
		<dc:creator>nanbu</dc:creator>
				<category><![CDATA[デザインテーマについて]]></category>
		<category><![CDATA[テンプレートタグ]]></category>

		<guid isPermaLink="false">http://www.usconsort.com/community/?p=799</guid>
		<description><![CDATA[Welcart 専用のテンプレートタグ一覧です。
　

　


        Welcart テンプレートタグ
    

usces_the_itemCode()
商品コード
&#160;


usces_the_i [...]]]></description>
			<content:encoded><![CDATA[<p>Welcart 専用のテンプレートタグ一覧です。<br />
　<br />
<span id="more-799"></span><br />
　</p>
<table border="1" cellspacing="0">
<caption>
        Welcart テンプレートタグ<br />
    </caption>
<tr>
<td>usces_the_itemCode()</td>
<td>商品コード</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>usces_the_itemName()</td>
<td>商品名</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>usces_the_itemSku()</td>
<td>SKUコード</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>usces_the_itemSkuDisp()</td>
<td>SKU名</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>usces_the_itemCprice()</td>
<td>定価</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>usces_the_itemPrice()</td>
<td>売価</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>usces_the_itemZaiko()</td>
<td>在庫状態</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>usces_the_itemSkuUnit()</td>
<td>単位</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>usces_the_firstSku()</td>
<td>先頭のSKUコード</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>usces_the_firstPrice()</td>
<td>先頭の売価</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>usces_the_firstCprice()</td>
<td>先頭の定価</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>usces_the_firstZaiko()</td>
<td>先頭の在庫状態</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>usces_the_lastSku()</td>
<td>最後尾のSKUコード</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>usces_the_lastPrice()</td>
<td>最後尾の売価</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>usces_the_lastZaiko()</td>
<td>最後尾の在庫状態</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>usces_the_itemQuant()</td>
<td>数量入力フィールド</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>usces_the_itemSkuButton($value)</td>
<td>カート投入ボタン</td>
<td>value はボタンの表示ラベル</td>
</tr>
<tr>
<td>usces_the_itemImage($number, $width, $height)</td>
<td>商品画像出力タグ</td>
<td>number は画像のインデックス、0がメイン画像でそれ以降はサブ画像<br />
        		width は画像の幅、heignht は画像の高さ（縦横比はWordPressに準ずる）</td>
</tr>
<tr>
<td>usces_the_itemImageURL($number)</td>
<td>商品画像URL</td>
<td>number は画像のインデックス</td>
</tr>
<tr>
<td>usces_guid_tax()</td>
<td>消費税ガイド</td>
<td>「（税込）、（税別）」の表示</td>
</tr>
<tr>
<td>usces_is_item()</td>
<td>商品か否か</td>
<td>true 商品、false 商品以外</td>
</tr>
<tr>
<td>usces_the_item()</td>
<td>オブジェクト準備</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>usces_sku_num()</td>
<td>SKUの数</td>
<td>その商品が所有するSKUの数</td>
</tr>
<tr>
<td>usces_is_skus()</td>
<td>SKUがあるか否か</td>
<td>true 存在する、false 存在しない</td>
</tr>
<tr>
<td>usces_have_skus()</td>
<td>ループ用フラグ</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>usces_is_gptekiyo( $post_id, $sku, $quant )</td>
<td>業務パック割引適用フラグ</td>
<td>業務パックが適用されるか否か</td>
</tr>
<tr>
<td>usces_the_itemGpExp( )</td>
<td>業務パック割引ガイド</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>usces_get_itemSubImageNums()</td>
<td>商品サブ画像の数</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>usces_is_options()</td>
<td>商品オプションフラグ</td>
<td>true オプションあり、false 無し</td>
</tr>
<tr>
<td>usces_have_options()</td>
<td>ループ用フラグ</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>usces_the_itemOptName()</td>
<td>商品オプション名</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>usces_the_itemOption($name)</td>
<td>商品オプションフィールド</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>usces_is_cart()</td>
<td>カートフラグ</td>
<td>カーとの中に商品が、　true 存在する、false 存在しない</td>
</tr>
<tr>
<td>usces_the_company_name()</td>
<td>ショップの会社名</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>usces_the_zip_code()</td>
<td>ショップの郵便番号</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>usces_the_address1()</td>
<td>ショップの住所1</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>usces_the_address2()</td>
<td>ショップの住所2</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>usces_the_tel_number()</td>
<td>ショップの電話番号</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>usces_the_fax_number()</td>
<td>ショップのFAX番号</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>usces_the_inquiry_mail()</td>
<td>問合せ用メールアドレス</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>usces_the_postage_privilege()</td>
<td>送料無料条件</td>
<td>送料が無料になる金額</td>
</tr>
<tr>
<td>usces_the_start_point()</td>
<td>初回ポイント</td>
<td>会員入会したときのサービスポイント</td>
</tr>
<tr>
<td>usces_the_calendar()</td>
<td>営業日カレンダー</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>usces_loginout()</td>
<td>ログインリンク</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>usces_is_login()</td>
<td>ログインフラグ</td>
<td>true ログイン中、false ログインしていない</td>
</tr>
<tr>
<td>usces_the_member_name()</td>
<td>ログインしている会員名</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>usces_is_membersystem_state()</td>
<td>会員システムフラグ</td>
<td>true 会員制オン、false オフ</td>
</tr>
<tr>
<td>usces_is_membersystem_point()</td>
<td>ポイントシステムフラグ</td>
<td>true ポイント制オン、false オフ</td>
</tr>
<tr>
<td>usces_copyright()</td>
<td>コピーライト</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>usces_totalprice_in_cart()</td>
<td>カート内の合計金額</td>
<td>商品のみの合計金額</td>
</tr>
<tr>
<td>usces_totalquantity_in_cart()</td>
<td>カート内の合計数量</td>
<td>全数量</td>
</tr>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.welcart.com/community/archives/799/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>既存のテーマを利用したショップの作り方　その2</title>
		<link>http://www.welcart.com/community/archives/759</link>
		<comments>http://www.welcart.com/community/archives/759#comments</comments>
		<pubDate>Sat, 06 Feb 2010 05:14:48 +0000</pubDate>
		<dc:creator>nanbu</dc:creator>
				<category><![CDATA[デザインテーマについて]]></category>
		<category><![CDATA[query_posts]]></category>
		<category><![CDATA[カート投入ボタン]]></category>
		<category><![CDATA[テンプレート]]></category>
		<category><![CDATA[テンプレートタグ]]></category>
		<category><![CDATA[ループ]]></category>
		<category><![CDATA[商品一覧]]></category>

		<guid isPermaLink="false">http://www.usconsort.com/community/?p=759</guid>
		<description><![CDATA[前回の「ループに商品を含ませない」処理により、通常ブログのアーカイブ（ループページ）には商品が表示されなくなりました。今回は商品のみの一覧ページの作成方法です。
　
2. 商品だけのループページを作る
商品だけのループペ [...]]]></description>
			<content:encoded><![CDATA[<p>前回の「<a href="http://www.welcart.com/community/archives/714">ループに商品を含ませない</a>」処理により、通常ブログのアーカイブ（ループページ）には商品が表示されなくなりました。今回は商品のみの一覧ページの作成方法です。<br />
　</p>
<h4>2. 商品だけのループページを作る</h4>
<p>商品だけのループページとは「商品一覧」ページで、作成手法は次の2つが考えられます。<br />
　</p>
<ul>
<li><strong>カテゴリーアーカイブによる商品一覧</strong><br />
カテゴリーテンプレートを利用して通常記事とは違うレイアウトを作ります。</li>
<li><strong>固定ページに商品一覧を作る</strong><br />
絞込みや並べ替えも含めた個別のテンプレートを作り固定ページに割り当てます。</li>
</ul>
<p>　<br />
<span id="more-759"></span><br />
　<br />
<div id="attachment_770" class="wp-caption alignright" style="width: 213px"><a href="http://www.welcart.com/community/wordpress/wp-content/uploads/2010/02/work001-032.jpg"><img class="size-medium wp-image-770" src="http://www.welcart.com/community/wordpress/wp-content/uploads/2010/02/work001-03-203x300.jpg" alt="" width="203" height="300" /></a><p class="wp-caption-text">‘商品’ カテゴリーのアーカイブ</p></div></p>
<h5>◆カテゴリーアーカイブによる商品一覧</h5>
<p>　　<br />
右の図は「商品」カテゴリーのアーカイブです。わかりやすくするために商品に説明文を書き、メディアから商品画像をアップロードしました。<br />
　<br />
表示されている商品画像は記事に挿入したものではありません。Welcart が商品画像を探し出し自動的に説明文と共に表示させています。<br />
これはテンプレートタグ”the_content()”が出力する内容をWelcart が強制的に書き換えていますので、このレイアウトを変更したい場合は”the_content()”を削除し、直接画像や説明文、価格などを表示させることになります。<br />
しかし、ただ削除するだけではブログの記事が表示されなくなってしまいます。<br />
　<br />
そこで登場するのがカテゴリーテンプレート（category.php）です。<br />
　<br />
category.php はURLがカテゴリーを指定しているときに適用されるテンプレートです。このテンプレートに好みのデザインを施せばいいのです。<br />
　<br />
ただし、このテンプレートは未分類も含めて商品以外のカテゴリーにも適用されます。そのため商品カテゴリーに属する場合は商品のデザイン、それ以外の記事の場合は通常のレイアウトで表示するといった分岐を一つ入れてやる必要があります。<br />
　<br />
　<br />
これは<strong>商品とそれ以外の記事を分岐させるためのタグ</strong>です。</p>
<blockquote><p>&lt;?php if ( usces_is_item() ) : ?&gt;<br />
　　|<br />
　　|　ここは商品用エリア<br />
　　|<br />
&lt;?php else : ?&gt;<br />
　　|<br />
　　| ここは通常記事のエリア<br />
　　|<br />
&lt;?php endif ?&gt;</p></blockquote>
<p>　<br />
　<br />
では実際にcategory.php を作ってみます。</p>
<p>まず、index.php を複写してcategory.php として保存します。これだけで通常記事の表示はOKです。</p>
<p>前回index.php の12行目に挿入した&lt;?php query_posts(&#8216;cat=-3&#8242;); ?&gt; はcategory.php には必要ないので削除します。</p>
<p>次に、商品情報を取得できるようにするため13行目にusces_the_item() というタグを一つ付け加えます。</p>
<blockquote><p>&lt;?php while (have_posts()) : the_post(); usces_the_item(); ?&gt;</p></blockquote>
<p>そして分岐タグを挿入します。挿入する位置はどこまでを共有するかによります。今回はthe_content のみを分岐させることにします。<br />
category.php の中のthe_content は&lt;div class=&#8221;entry&#8221;&gt; で囲まれています。この部分に挿入します。</p>
<p>&lt;div class=&#8221;entry&#8221;&gt; を含めて書いたコードは次の通りです。</p>
<blockquote><p>*<br />
*<br />
*<br />
&lt;div class=&#8221;entry&#8221;&gt;</p>
<p>&lt;?php if ( usces_is_item() ) : ?&gt;<br />
&lt;!&#8211; 商品のためのエリア &#8211;&gt;</p>
<p>&lt;?php else : ?&gt;<br />
&lt;!&#8211; 通常の記事 &#8211;&gt;<br />
&lt;?php the_content(__(&#8216;Read the rest of this entry »&#8217;, &#8216;kubrick&#8217;)); ?&gt;</p>
<p>&lt;?php endif ?&gt;</p>
<p>&lt;/div&gt;<br />
*<br />
*<br />
*</p></blockquote>
<p>　<br />
　<br />
　<br />
<div id="attachment_809" class="wp-caption alignright" style="width: 266px"><a href="http://www.welcart.com/community/wordpress/wp-content/uploads/2010/02/work001-042.jpg"><img class="size-medium wp-image-809" src="http://www.welcart.com/community/wordpress/wp-content/uploads/2010/02/work001-04-256x300.jpg" alt="カテゴリーアーカイブ" width="256" height="300" /></a><p class="wp-caption-text">商品情報の表示例</p></div><br />
さて、いよいよ<strong>商品一覧のレイアウト</strong>の話です。<br />
Welcart は商品情報を表示させるために様々なテンプレートタグを用意しています。「<a href="http://www.welcart.com/community/archives/799">Welcart テンプレートタグ一覧</a>」参照<br />
　<br />
右の図は主なテンプレートタグを使って商品情報を表示させたカテゴリーアーカイブです。実際にはこのページはいくつ物商品がループして並ぶので、表示する情報は必要最低限のものでよいと思います。詳細は商品詳細ページで表示するようになっています。<br />
　<br />
商品詳細ページにはとは別に直接カートへ投入するボタンや数量フィールドもここに表示させることができます。こちらは「固定ページに商品一覧を作る」方法で説明したいと思います。<br />
　<br />
　<br />
このページに書いたソースは次の通りです。</p>
<div style="clear:both"></div>
<blockquote><p>
　　　　　*<br />
　　　　　*<br />
　　　　　*<br />
&lt;div class=&#8221;entry&#8221;&gt;<br />
&lt;?php if ( usces_is_item() ) : ?&gt;</p>
<p>　　&lt;dl&gt;<br />
　<br />
　　　　&lt;dt&gt;商品名と商品コード&lt;/dt&gt;<br />
　　　　&lt;dd&gt;&lt;?php usces_the_itemName(); ?&gt;：&lt;?php usces_the_itemCode(); ?&gt;&lt;/dd&gt;<br />
　<br />
　　　　&lt;dt&gt;メイン画像（商品詳細ページへのリンク）&lt;/dt&gt;<br />
　　　　&lt;dd&gt;&lt;a href=&#8221;&lt;?php the_permalink(); ?&gt;&#8221;&gt;&lt;?php usces_the_itemImage(0, 150, 150); ?&gt;&lt;/a&gt;&lt;/dd&gt;<br />
　<br />
　　　　&lt;dt&gt;サブ画像（写真へのリンク）&lt;/dt&gt;<br />
　　　　&lt;dd&gt;&lt;a href=&#8221;&lt;?php usces_the_itemImageURL(1); ?&gt;&#8221;&gt;&lt;?php usces_the_itemImage(1, 100, 100); ?&gt;&lt;/a&gt;&lt;dd&gt;<br />
　<br />
　　　　&lt;dt&gt;記事本文&lt;/dt&gt;<br />
　　　　&lt;!&#8211;直接echoします。次期バージョンでは usces_the_content() を追加予定&#8211;&gt;<br />
　　　　&lt;dd&gt;&lt;?php echo $post-&gt;post_content; ?&gt;&lt;/dd&gt;<br />
　<br />
　　　　&lt;dt&gt;抜粋&lt;/dt&gt;<br />
　　　　&lt;!&#8211;直接echoします。次期バージョンでは usces_the_excerpt() を追加予定&#8211;&gt;<br />
　　　　&lt;dd&gt;&lt;?php echo $post-&gt;post_excerpt; ?&gt;&lt;/dd&gt;<br />
　<br />
　　　　&lt;?php usces_have_skus(); ?&gt;<span style="color: #993300">&lt;!&#8211; SKU情報取得準備タグ &#8211;&gt;</span><br />
　<br />
　　　　&lt;dt&gt;在庫ステイタスと価格など抜粋&lt;/dt&gt;<br />
　　　　&lt;dd&gt;&lt;span class=&#8221;zaikostatus&#8221;&gt;&lt;?php usces_the_itemZaiko(); ?&gt;&lt;/span&gt;　&lt;span class=&#8221;price&#8221;&gt;&lt;?php usces_the_itemPrice(); ?&gt;円&lt;/span&gt;&lt;span class=&#8221;tax&#8221;&gt;&lt;?php usces_guid_tax(); ?&gt;&lt;/span&gt;&lt;/dd&gt;<br />
　<br />
　　&lt;/dl&gt;<br />
　<br />
&lt;?php else : ?&gt;<br />
　　　　　*<br />
　　　　　*<br />
　　　　　*
</p></blockquote>
<p>※テンプレートファイルを編集する際はUTF-8で保存してください。<br />
　<br />
　<br />
　</p>
<h5>◆固定ページに商品一覧を作る</h5>
<p>　<br />
次はオリジナルのテンプレートを作って固定ページに割り当てるという方法を紹介します。今回はお勧め商品だけを表示するページを作ってみます。<br />
　<br />
まずはテンプレートファイルを作ります。<br />
カテゴリーテンプレートを作ったときと同じように、index.php を複写して適当な名前をつけて保存します。このときWordPress が予約しているファイル名にならないように気をつけましょう。今回はMyRecoItem.php と名前を付けてみました。<br />
　<br />
このファイルがテンプレートファイルだとWordPress に認識させるため、コードの冒頭のコメントを次のように書き換えます。<br />
　</p>
<blockquote><p>
/*<br />
Template Name: お勧め商品テンプレート<br />
*/
</p></blockquote>
<p>　<br />
このテンプレートWordPress に認識されているかどうか確認してみましょう。<br />
　<br />
新規ページを作成画面の右サイドバーに”テンプレート”というフィールドが有ります。そのセレクトに”お勧め商品テンプレート”があれば成功です。<br />
”お勧め商品テンプレート”を選択し、タイトルに「お勧め商品」と書いて保存（公開）してください。本文は空白で構いません。</p>
<p>フロントから新しいページ「お勧め商品」を確認するとトップページとまったく同じものが表示されているはずです。<br />
　<br />
では、テンプレートを編集していきましょう。<br />
今回のポイントは・・</p>
<ul>
<li>form タグを使用する（カートへボタンをつけるため）</li>
<li>お勧め商品で絞り込む</li>
<li>商品か否かの分岐は要らない</li>
</ul>
<p>この3点で、後はカテゴリーテンプレートとほぼ同じです。<br />
　<br />
　<br />
form タグの挿入位置を間違えると、他のタグとクロスしてしまいスタイルが崩れるので注意しましょう。今回はわかりやすくcontent を全部括ってしまいます。<br />
　<br />
<strong>form タグを挿入</strong></p>
<blockquote><p>
&lt;?php<br />
/*<br />
Template Name: お勧め商品テンプレート<br />
*/<br />
　<br />
get_header(); ?&gt;<br />
　<br />
<span style="color: #991188">&lt;form action=&quot;&lt;?php echo  USCES_CART_URL ?&gt;&quot; method=&quot;post&quot;&gt;</span><br />
&lt;div id=&quot;content&quot; class=&quot;narrowcolumn&quot; role=&quot;main&quot;&gt;<br />
　　　　　*<br />
　　　　　*<br />
　　　　　*<br />
　　　　　*<br />
&lt;/div&gt;<br />
<span style="color: #991188">&lt;/form&gt;</span><br />
　<br />
&lt;?php get_sidebar(); ?&gt;<br />
&lt;?php get_footer(); ?&gt;
</p></blockquote>
<p>　<br />
　<br />
前回「ループに商品を含ませない」で挿入したquery_posts が今回も活躍します。<br />
　<br />
<strong>お勧め商品に絞り込む</strong></p>
<blockquote><p>
　　　　　*<br />
　　　　　*<br />
&lt;?php if (have_posts()) : ?&gt;<br />
　　<span style="color: #991188">&lt;?php query_posts(&#8216;category_slug=itemreco&#8217;); ?&gt;</span><br />
　　&lt;?php while (have_posts()) : the_post(); <span style="color: #991188">usces_the_item();</span> ?&gt;<br />
　　　　　*<br />
　　　　　*
</p></blockquote>
<p>　<br />
　<br />
今回はquery_posts により商品に絞り込まれますのでenty の中には分岐タグはいりません。<br />
the_content の行を削除して、カートへ投入ボタンをはじめ商品情報関連タグを挿入していきます。<br />
　<br />
<strong>カート投入ボタンの挿入</strong></p>
<blockquote><p>
　　　　　*<br />
　　　　　*<br />
&lt;div class=&quot;entry&quot;&gt;<br />
　<br />
&lt;dl&gt;<br />
　<br />
　　&lt;dt&gt;商品名と商品コード&lt;/dt&gt;<br />
　　&lt;dd&gt;&lt;?php usces_the_itemName(); ?&gt;：&lt;?php usces_the_itemCode(); ?&gt;&lt;/dd&gt;<br />
　<br />
　　&lt;dt&gt;メイン画像（商品詳細ページへのリンク）&lt;/dt&gt;<br />
　　&lt;dd&gt;&lt;a href=&quot;&lt;?php the_permalink(); ?&gt;&quot;&gt;&lt;?php usces_the_itemImage(0, 100, 100); ?&gt;&lt;/a&gt;&lt;/dd&gt;<br />
　<br />
　　&lt;?php usces_have_skus(); ?&gt;<br />
　<br />
　　&lt;dt&gt;在庫ステイタスと価格など抜粋&lt;/dt&gt;<br />
　　&lt;dd&gt;&lt;span class=&quot;zaikostatus&quot;&gt;&lt;?php usces_the_itemZaiko(); ?&gt;&lt;/span&gt;　&lt;span class=&quot;price&quot;&gt;&lt;?php usces_the_itemPrice(); ?&gt;円&lt;/span&gt;&lt;span class=&quot;tax&quot;&gt;&lt;?php usces_guid_tax(); ?&gt;&lt;/span&gt;&lt;/dd&gt;<br />
　<br />
　　&lt;dt&gt;数量とカート投入ボタン&lt;/dt&gt;<br />
　　<span style="color: #991188">&lt;dd&gt;数量&lt;?php usces_the_itemQuant(); ?&gt;　 &lt;?php usces_the_itemSkuButton(&#8216;カートへ入れる&#8217;); ?&gt;&lt;/dd&gt;</span><br />
　<br />
&lt;/dl&gt;<br />
　<br />
&lt;/div&gt;<br />
　　　　　*<br />
　　　　　*
</p></blockquote>
<p>　　<br />
　<br />
<div id="attachment_830" class="wp-caption alignright" style="width: 266px"><a href="http://www.welcart.com/community/wordpress/wp-content/uploads/2010/02/work001-052.jpg"><img src="http://www.welcart.com/community/wordpress/wp-content/uploads/2010/02/work001-05-256x300.jpg" alt="固定ページ" width="256" height="300" class="size-medium wp-image-830" /></a><p class="wp-caption-text">カート投入ボタンが付いた「お勧め商品」一覧</p></div><br />
お勧め商品ページは右のように表示されます。<br />
　<br />
　<br />
この様に、一覧などループ表示ではWelcart テンプレートタグを利用することで自由なレイアウトが可能となります。</p>
<p>個別表示となる商品詳細ページに関しては、今のところこの様な自由なレイアウトはできません。将来なんらかの方法でデザインの自由度を上げたいと考えています。</p>
<div style="clear:both"></div>
<p><strong>SKUが複数有る場合</strong><br />
SKUが複数あり、全ての情報を表示したい場合はSKUをループして情報を取得する方法がありますが、ここでは割愛させていただきます。興味のある方は、usc-e-shop/templates/single_item.php をご覧ください。<br />
　<br />
今回の方法でSKUが複数あった場合は先頭の情報が表示されます。<br />
　<br />
　<br />
　<br />
以上、「既存のテーマを利用したショップの作り方　その2」は商品だけのループページを作る方法でした。<br />
　<br />
次回は、テンプレートを使用するのではなく投稿記事そのものにカート投入ボタンをいれる方法を紹介します。<br />
　<br />
　<br />
今回作成したテンプレートファイルはこちらからダウンロードできます。<br />
<a href='http://www.welcart.com/community/wordpress/wp-content/uploads/2010/02/Welcart_works012.zip'>Welcart_works01</a><br />
　<br />
　<br />
<a href="http://www.welcart.com/community/archives/714">＜その1　「ループに商品を含ませない」</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.welcart.com/community/archives/759/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>価格が表示できる一覧ページ</title>
		<link>http://www.welcart.com/community/archives/687</link>
		<comments>http://www.welcart.com/community/archives/687#comments</comments>
		<pubDate>Sun, 31 Jan 2010 13:19:05 +0000</pubDate>
		<dc:creator>miiya</dc:creator>
				<category><![CDATA[デザインテーマについて]]></category>
		<category><![CDATA[テンプレートタグ]]></category>
		<category><![CDATA[商品一覧ページ]]></category>

		<guid isPermaLink="false">http://www.usconsort.com/community/?p=687</guid>
		<description><![CDATA[こんにちは、今回はじめて利用させていただいております。
初歩的な質問ですいません、デモページのように価格が表示できる商品（記事）の一覧ページを
作成したいと考えているのですが、どのようにすればよいでしょうか？
また、価格 [...]]]></description>
			<content:encoded><![CDATA[<p>こんにちは、今回はじめて利用させていただいております。</p>
<p>初歩的な質問ですいません、デモページのように価格が表示できる商品（記事）の一覧ページを</p>
<p>作成したいと考えているのですが、どのようにすればよいでしょうか？</p>
<p>また、価格を表示させるタグ、関数（<strong>usces_xxx</strong>）はありますか？</p>
<p>よろしくお願いします。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.welcart.com/community/archives/687/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>【要望】カゴの中の商品金額・商品点数を表示するテンプレートタグが欲しい</title>
		<link>http://www.welcart.com/community/archives/303</link>
		<comments>http://www.welcart.com/community/archives/303#comments</comments>
		<pubDate>Mon, 23 Nov 2009 06:13:16 +0000</pubDate>
		<dc:creator>yasu</dc:creator>
				<category><![CDATA[デザインテーマについて]]></category>
		<category><![CDATA[テンプレートタグ]]></category>

		<guid isPermaLink="false">http://www.usconsort.com/community/?p=303</guid>
		<description><![CDATA[nanbuさん、こんにちは。
welcartは日々進化をとげていて素晴らしいですね。
本日は要望があってまいりました。

よくカート付きのサイトへ行くとこの様な表示があるのですがこれをwelcartにてサイドバー等に装着 [...]]]></description>
			<content:encoded><![CDATA[<p>nanbuさん、こんにちは。</p>
<p>welcartは日々進化をとげていて素晴らしいですね。</p>
<p>本日は要望があってまいりました。</p>
<p><img class="alignnone size-full wp-image-302" src="http://www.welcart.com/community/wordpress/wp-content/uploads/2009/11/sample_kago2.gif" alt="サンプル画像" width="166" height="125" /></p>
<p>よくカート付きのサイトへ行くとこの様な表示があるのですがこれをwelcartにてサイドバー等に装着できないかと…</p>
<p>できれば現在の商品点数と合計金額をアウトプットするテンプレートタグなんかがあればうれしいです。</p>
<p>お忙しいとは思いますがよろしくお願いいたします。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.welcart.com/community/archives/303/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
