※カテゴリー別のRSSです
アクセスカウンタ
読者登録
メールアドレスを入力して登録する事で、このブログの新着エントリーをメールでお届けいたします。解除は→こちら
現在の読者数 1人
プロフィール
スポンジボブ

PR

本広告は、一定期間更新の無いブログにのみ表示されます。
ブログ更新が行われると本広告は非表示となります。

  
Posted by つくばちゃんねるブログ at

2010年10月21日

商品情報が入っている$arrProductの内容表示

テンプレートに
<!--{$arrProduct|@debug_print_var}-->
を書く。
こちらを参照。  

Posted by スポンジボブ at 13:41Comments(0)EC-cube

2010年07月03日

タイトルの変更2

タイトル変更のやり方について、別のやり方。

タイトルをデフォルトから変更する。
site_frame.tplを修正。ここを参照。

<!--{assign var=top value="`$smarty.const.URL_DIR`index.php"}-->
<!--{assign var=list value="`$smarty.const.URL_DIR`products/list.php"}-->
<!--{assign var=detail value="`$smarty.const.URL_DIR`products/detail.php"}-->
<!--{if $smarty.server.PHP_SELF==$top}--> //トップページの場合
<title><!--{$arrSiteInfo.shop_name}--> | <!--{$arrPageLayout.description|escape}--></title>
<!--{elseif $smarty.server.PHP_SELF==$list}-->
<!--{if $tpl_subtitle != "全商品"}--> //リストページで全商品ではない場合
<title><!--{$tpl_subtitle}--> | <!--{$arrSiteInfo.shop_name}--></title>
<!--{else}--> //リストページ全商品の場合
<title><!--{$arrPageLayout.description|escape}--> | <!--{$arrSiteInfo.shop_name}--></title>
<!--{/if}-->
<!--{elseif $smarty.server.PHP_SELF==$detail}--> //詳細ページの場合
<title><!--{$tpl_title|escape}--> | <!--{$tpl_subtitle}--> | <!--{$arrSiteInfo.shop_name}--></title>
<!--{else}--> //それ以外のページの場合
<title><!--{$tpl_title|escape}--> | <!--{$arrSiteInfo.shop_name}--></title>
<!--{/if}-->  

Posted by スポンジボブ at 14:32Comments(0)EC-cube

2010年07月02日

デバッグ

tplファイルをデバッグするとき、
<!--{$arrProducts[cnt]|@var_dump}-->
で中身を見ることができる。

data/class/pages/products/LC_Page_Products_List.php に
SC_Utils::sfPrintR($arrProducts[cnt]);
を書いてもデバッグできる。

こちらを参照。

  

Posted by スポンジボブ at 13:33Comments(0)EC-cube

2010年06月30日

詳細ページに商品の詳細データを規格ごとに表示する

detail.tplに以下を挿入。

<!--{foreach from=$arrProductsClass item=list_item key=list_key}-->
<form name="form<!--{$list_key}-->" id="form<!--{$list_key}-->" method="post" action="<!--{$smarty.server.REQUEST_URI|escape}-->">
<input type="hidden" name="mode" value="cart" />
<input type="hidden" name="product_id" value="<!--{$tpl_product_id}-->" />
<input type="hidden" name="favorite_product_id" value="" />
<input type="hidden" name="classcategory_id1" value="<!--{$list_item.classcategory_id1}-->" />
<input type="hidden" name="classcategory_id2" value="<!--{$list_item.classcategory_id2}-->" />
INDEX: <!--{$list_key}-->
CLASS1 ID: <!--{$list_item.classcategory_id1}-->
CLASS1 NAME: <!--{$list_item.classcategory_id1_name}-->
CLASS2 ID: <!--{$list_item.classcategory_id2}-->
CLASS2 NAME: <!--{$list_item.classcategory_id2_name}-->
STD PRICE: <!--{$list_item.price01}-->円
SELL PRICE: <!--{$list_item.price02}-->円
<input type="text" name="quantity" class="box54" value="<!--{$arrForm.quantity.value|default:1}-->" maxlength="<!--{$smarty.const.INT_LEN}-->" style="<!--{$arrErr.quantity|sfGetErrorColor}-->" />
<a href="javascript:void(document.form<!--{$list_key}-->.submit());" onmouseover="chgImg('<!--{$TPL_DIR}-->img/products/b_cartin_on.gif','cart<!--{$list_key}-->');" onmouseout="chgImg('<!--{$TPL_DIR}-->img/products/b_cartin.gif','cart<!--{$list_key}-->');">
<img src="<!--{$TPL_DIR}-->img/products/b_cartin.gif" width="115" height="25" alt="カゴに入れる" name="cart" id="cart<!--{$list_key}-->" /></a>
</form>
<!--{/foreach}-->  

Posted by スポンジボブ at 20:05Comments(0)EC-cube

2010年06月30日

TOPのタイトル変更

data/class/pages/LC_Page_Index.phpに

function init() {
parent::init();
$this->tpl_mainpage = 'top.tpl';
$this->tpl_column_num = 3;
$this->tpl_title = 'TOPページ';

を追加。

site_frame.tplに

<title><!--{if $tpl_title == "TOPページ"}-->ここにTOPページに表示したいタイトルを記入<!--{else}--><!--{$tpl_title|escape}--><!--{/if}--> - <!--{$arrSiteInfo.shop_name|escape}--></title>

これで、タイトルは
「ここにTOPページに表示したいタイトルを記入 - サイト名」
と表示されます。

詳しくはこちらを参照。


  

Posted by スポンジボブ at 19:10Comments(0)EC-cube

2010年06月30日

3桁ごとにカンマで区切る

価格など3ケタで区切るとき。
number_format
を使う。

少数点もこれで表示できる。

  
タグ :number_format

Posted by スポンジボブ at 18:36Comments(0)EC-cube

2010年06月30日

詳細ページに一覧ページのコメント表示

詳細ページに一覧ページのコメント表示(こちらを参照)

/data/class/pages/products/LC_Page_Products_Detail.php の223行めあたりに

// 一覧コメントの取得
$pid = $this->arrProduct['product_id'];
$listcomment = $objQuery->select("main_list_comment", "dtb_products", "product_id = $pid");
$this->listcomment = $listcomment;

を追加。
detail.tplに

<!--{$listcomment[0].main_list_comment}-->

で表示される。  

Posted by スポンジボブ at 18:21Comments(0)EC-cube