Skip to content

Instantly share code, notes, and snippets.

@nanasess
Created November 3, 2012 19:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nanasess/4008435 to your computer and use it in GitHub Desktop.
Save nanasess/4008435 to your computer and use it in GitHub Desktop.
名入れカスタマイズ
<!--{*
data/Smarty/templates/admin/products/confirm.tpl
/*
* This file is part of EC-CUBE
*
* Copyright(c) 2000-2012 LOCKON CO.,LTD. All Rights Reserved.
*
* http://www.lockon.co.jp/
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
*}-->
<form name="form1" id="form1" method="post" action="?" enctype="multipart/form-data">
<input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" />
<input type="hidden" name="mode" value="complete" />
<!--{foreach key=key item=item from=$arrSearchHidden}-->
<!--{if is_array($item)}-->
<!--{foreach item=c_item from=$item}-->
<input type="hidden" name="<!--{$key|h}-->[]" value="<!--{$c_item|h}-->" />
<!--{/foreach}-->
<!--{else}-->
<input type="hidden" name="<!--{$key|h}-->" value="<!--{$item|h}-->" />
<!--{/if}-->
<!--{/foreach}-->
<!--{foreach key=key item=item from=$arrForm}-->
<!--{if $key == 'product_status'}-->
<!--{foreach item=statusVal from=$item}-->
<input type="hidden" name="<!--{$key}-->[]" value="<!--{$statusVal|h}-->" />
<!--{/foreach}-->
<!--{elseif $key == 'arrCategoryId'}-->
<!--{* nop *}-->
<!--{elseif $key == 'arrFile'}-->
<!--{* nop *}-->
<!--{else}-->
<input type="hidden" name="<!--{$key}-->" value="<!--{$item|h}-->" />
<!--{/if}-->
<!--{/foreach}-->
<div id="products" class="contents-main">
<table>
<tr>
<th>商品名</th>
<td>
<!--{$arrForm.name|h}-->
</td>
</tr>
<tr>
<th>商品カテゴリ</th>
<td>
<!--{section name=cnt loop=$arrForm.arrCategoryId}-->
<!--{assign var=key value=$arrForm.arrCategoryId[cnt]}-->
<!--{$arrCatList[$key]|sfTrim}--><br />
<!--{/section}-->
</td>
</tr>
<tr>
<th>公開・非公開</th>
<td>
<!--{$arrDISP[$arrForm.status]}-->
</td>
</tr>
<tr>
<th>商品ステータス</th>
<td>
<!--{foreach from=$arrForm.product_status item=status}-->
<!--{if $status != ""}-->
<img src="<!--{$TPL_URLPATH_PC}--><!--{$arrSTATUS_IMAGE[$status]}-->">
<!--{/if}-->
<!--{/foreach}-->
</td>
</tr>
<tr>
<th>名入れオプション</th>
<td>
<!--{$arrPuttingNameFlg[$arrForm.putting_name_flg]}-->
</td>
</tr>
<tr>
<th>名入れ価格</th>
<td>
<!--{$arrForm.putting_name_price|h}-->円
</td>
</tr>
<!--{if $arrForm.has_product_class != true}-->
<tr>
<th>商品種別</th>
<td>
<!--{$arrProductType[$arrForm.product_type_id]}-->
</td>
</tr>
<tr>
<th>ダウンロード商品ファイル名</th>
<td>
<!--{$arrForm.down_filename|h}-->
</td>
</tr>
<tr>
<th>ダウンロード商品用<BR />ファイル</th>
<td>
<!--{if $arrForm.down_realfilename != ""}-->
<!--{$arrForm.down_realfilename|h}-->
<!--{/if}-->
</td>
</tr>
<tr>
<th>商品コード</th>
<td>
<!--{$arrForm.product_code|h}-->
</td>
</tr>
<tr>
<th><!--{$smarty.const.NORMAL_PRICE_TITLE}--></th>
<td>
<!--{if strlen($arrForm.price01) >= 1}--><!--{$arrForm.price01|h}--> 円<!--{/if}-->
</td>
</tr>
<tr>
<th><!--{$smarty.const.SALE_PRICE_TITLE}--></th>
<td>
<!--{if strlen($arrForm.price02) >= 1}--><!--{$arrForm.price02|h}--> 円<!--{/if}-->
</td>
</tr>
<tr>
<th>在庫数</th>
<td>
<!--{if $arrForm.stock_unlimited == 1}-->
無制限
<!--{else}-->
<!--{$arrForm.stock|h}-->
<!--{/if}-->
</td>
</tr>
<!--{/if}-->
<tr>
<th>商品送料</th>
<td>
<!--{if strlen($arrForm.deliv_fee) >= 1}--><!--{$arrForm.deliv_fee|h}--> 円<!--{/if}-->
</td>
</tr>
<tr>
<th>ポイント付与率</th>
<td>
<!--{if strlen($arrForm.point_rate) >= 1}--><!--{$arrForm.point_rate|h}--> %<!--{/if}-->
</td>
</tr>
<tr>
<th>発送日目安</th>
<td>
<!--{$arrDELIVERYDATE[$arrForm.deliv_date_id]|h}-->
</td>
</tr>
<tr>
<th>販売制限数</th>
<td>
<!--{$arrForm.sale_limit|default:'無制限'|h}-->
</td>
</tr>
<tr>
<th>メーカー</th>
<td>
<!--{$arrMaker[$arrForm.maker_id]|h}-->
</td>
</tr>
<tr>
<th>メーカーURL</th>
<td style="word-break: break-all;">
<!--{$arrForm.comment1|h}-->
</td>
</tr>
<tr>
<th>検索ワード</th>
<td>
<!--{$arrForm.comment3|h}-->
</td>
</tr>
<tr>
<th>備考欄(SHOP専用)</th>
<td>
<!--{$arrForm.note|h|nl2br}-->
</td>
</tr>
<tr>
<th>一覧-メインコメント</th>
<td>
<!--{$arrForm.main_list_comment|h|nl2br}-->
</td>
</tr>
<tr>
<th>詳細-メインコメント</th>
<td>
<!--{$arrForm.main_comment|nl2br_html}-->
</td>
</tr>
<tr>
<th>一覧-メイン画像</th>
<td>
<!--{assign var=key value="main_list_image"}-->
<!--{if $arrForm.arrFile[$key].filepath != ""}-->
<img src="<!--{$arrForm.arrFile[$key].filepath}-->" alt="<!--{$arrForm.name|h}-->" /><br />
<!--{/if}-->
</td>
</tr>
<tr>
<th>詳細-メイン画像</th>
<td>
<!--{assign var=key value="main_image"}-->
<!--{if $arrForm.arrFile[$key].filepath != ""}-->
<img src="<!--{$arrForm.arrFile[$key].filepath}-->" alt="<!--{$arrForm.name|h}-->" /><br />
<!--{/if}-->
</td>
</tr>
<tr>
<th>詳細-メイン拡大画像</th>
<td>
<!--{assign var=key value="main_large_image"}-->
<!--{if $arrForm.arrFile[$key].filepath != ""}-->
<img src="<!--{$arrForm.arrFile[$key].filepath}-->" alt="<!--{$arrForm.name|h}-->" /><br />
<!--{/if}-->
</td>
</tr>
<!--{* オペビルダー用 *}-->
<!--{if "sfViewAdminOpe"|function_exists === TRUE}-->
<!--{include file=`$smarty.const.MODULE_REALDIR`mdl_opebuilder/admin_ope_view.tpl}-->
<!--{/if}-->
<!--{section name=cnt loop=$smarty.const.PRODUCTSUB_MAX}-->
<!--▼商品<!--{$smarty.section.cnt.iteration}-->-->
<tr>
<th>詳細-サブタイトル(<!--{$smarty.section.cnt.iteration}-->)</th>
<td>
<!--{assign var=key value="sub_title`$smarty.section.cnt.iteration`"}-->
<!--{$arrForm[$key]|h}-->
</td>
</tr>
<tr>
<th>詳細-サブコメント(<!--{$smarty.section.cnt.iteration}-->)</th>
<td>
<!--{assign var=key value="sub_comment`$smarty.section.cnt.iteration`"}-->
<!--{$arrForm[$key]|nl2br_html}-->
</td>
</tr>
<tr>
<th>詳細-サブ画像(<!--{$smarty.section.cnt.iteration}-->)</th>
<td>
<!--{assign var=key value="sub_image`$smarty.section.cnt.iteration`"}-->
<!--{if $arrForm.arrFile[$key].filepath != ""}-->
<img src="<!--{$arrForm.arrFile[$key].filepath}-->" alt="<!--{$arrForm.name|h}-->" /><br />
<!--{/if}-->
</td>
</tr>
<tr>
<th>詳細-サブ拡大画像(<!--{$smarty.section.cnt.iteration}-->)</th>
<td>
<!--{assign var=key value="sub_large_image`$smarty.section.cnt.iteration`"}-->
<!--{if $arrForm.arrFile[$key].filepath != ""}-->
<img src="<!--{$arrForm.arrFile[$key].filepath}-->" alt="<!--{$arrForm.name|h}-->" /><br />
<!--{/if}-->
</td>
</tr>
<!--▲商品<!--{$smarty.section.cnt.iteration}-->-->
<!--{/section}-->
<!--{if $smarty.const.OPTION_RECOMMEND == 1}-->
<!--▼関連商品-->
<!--{section name=cnt loop=$smarty.const.RECOMMEND_PRODUCT_MAX}-->
<!--{assign var=recommend_no value="`$smarty.section.cnt.iteration`"}-->
<tr>
<th>関連商品(<!--{$smarty.section.cnt.iteration}-->)<br />
<!--{if $arrRecommend[$recommend_no].product_id|strlen >= 1}-->
<img src="<!--{$smarty.const.ROOT_URLPATH}-->resize_image.php?image=<!--{$arrRecommend[$recommend_no].main_list_image|sfNoImageMainList|h}-->&amp;width=65&amp;height=65" alt="<!--{$arrRecommend[$recommend_no].name|h}-->">
<!--{/if}-->
</th>
<td>
<!--{if $arrRecommend[$recommend_no].product_id|strlen >= 1}-->
商品コード:<!--{$arrRecommend[$recommend_no].product_code_min}--><br />
商品名:<!--{$arrRecommend[$recommend_no].name|h}--><br />
コメント:<br />
<!--{$arrRecommend[$recommend_no].comment|h|nl2br}-->
<!--{/if}-->
</td>
</tr>
<!--{/section}-->
<!--▲関連商品-->
<!--{/if}-->
</table>
<div class="btn-area">
<ul>
<li><a class="btn-action" href="javascript:;" onclick="fnModeSubmit('confirm_return','',''); return false;"><span class="btn-prev">前のページに戻る</span></a></li>
<li><a class="btn-action" href="javascript:;" onclick="document.form1.submit(); return false;"><span class="btn-next">この内容で登録する</span></a></li>
</ul>
</div>
</div>
</form>
<!--{*
data/Smarty/templates/admin/products/product.tpl
/*
* This file is part of EC-CUBE
*
* Copyright(c) 2000-2012 LOCKON CO.,LTD. All Rights Reserved.
*
* http://www.lockon.co.jp/
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
*}-->
<script type="text/javascript">
// 表示非表示切り替え
function lfDispSwitch(id){
var obj = document.getElementById(id);
if (obj.style.display == 'none') {
obj.style.display = '';
} else {
obj.style.display = 'none';
}
}
// セレクトボックスのリストを移動
// (移動元セレクトボックスID, 移動先セレクトボックスID)
function fnMoveSelect(select, target) {
$('#' + select).children().each(function() {
if (this.selected) {
$('#' + target).append(this);
$(this).attr({selected: false});
}
});
// IE7再描画不具合対策
if ($.browser.msie && $.browser.version >= 7) {
$('#' + select).hide();
$('#' + select).show();
$('#' + target).hide();
$('#' + target).show();
}
}
// target の子要素を選択状態にする
function selectAll(target) {
$('#' + target).children().attr({selected: true});
}
</script>
<form name="form1" id="form1" method="post" action="?" enctype="multipart/form-data">
<input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" />
<!--{foreach key=key item=item from=$arrSearchHidden}-->
<!--{if is_array($item)}-->
<!--{foreach item=c_item from=$item}-->
<input type="hidden" name="<!--{$key|h}-->[]" value="<!--{$c_item|h}-->" />
<!--{/foreach}-->
<!--{else}-->
<input type="hidden" name="<!--{$key|h}-->" value="<!--{$item|h}-->" />
<!--{/if}-->
<!--{/foreach}-->
<input type="hidden" name="mode" value="edit" />
<input type="hidden" name="image_key" value="" />
<input type="hidden" name="down_key" value="">
<input type="hidden" name="product_id" value="<!--{$arrForm.product_id|h}-->" />
<input type="hidden" name="product_class_id" value="<!--{$arrForm.product_class_id|h}-->" />
<input type="hidden" name="copy_product_id" value="<!--{$arrForm.copy_product_id|h}-->" />
<input type="hidden" name="anchor_key" value="" />
<input type="hidden" name="select_recommend_no" value="" />
<input type="hidden" name="has_product_class" value="<!--{$arrForm.has_product_class|h}-->" />
<!--{foreach key=key item=item from=$arrForm.arrHidden}-->
<input type="hidden" name="<!--{$key}-->" value="<!--{$item|h}-->" />
<!--{/foreach}-->
<div id="products" class="contents-main">
<h2>基本情報</h2>
<table class="form">
<tr>
<th>商品ID</th>
<td><!--{$arrForm.product_id|h}--></td>
</tr>
<tr>
<th>商品名<span class="attention"> *</span></th>
<td>
<span class="attention"><!--{$arrErr.name}--></span>
<input type="text" name="name" value="<!--{$arrForm.name|h}-->" maxlength="<!--{$smarty.const.STEXT_LEN}-->" style="<!--{if $arrErr.name != ""}-->background-color: <!--{$smarty.const.ERR_COLOR}-->;<!--{/if}-->" size="60" class="box60" />
<span class="attention"> (上限<!--{$smarty.const.STEXT_LEN}-->文字)</span>
</td>
</tr>
<tr>
<th>商品カテゴリ<span class="attention"> *</span></th>
<td>
<span class="attention"><!--{$arrErr.category_id}--></span>
<table class="layout">
<tr>
<td>
<select name="category_id[]" id="category_id" style="<!--{if $arrErr.category_id != ""}-->background-color: <!--{$smarty.const.ERR_COLOR}-->;<!--{/if}--> height: 120px; min-width: 200px;" onchange="" size="10" multiple>
</select>
</td>
<td style="padding: 15px;">
<a class="btn-normal" href="javascript:;" name="on_select" onclick="fnMoveSelect('category_id_unselect','category_id'); return false;">&nbsp;&nbsp;&lt;-&nbsp;登録&nbsp;&nbsp;</a><br /><br />
<a class="btn-normal" href="javascript:;" name="un_select" onclick="fnMoveSelect('category_id','category_id_unselect'); return false;">&nbsp;&nbsp;削除&nbsp;-&gt;&nbsp;&nbsp;</a>
</td>
<td>
<select name="category_id_unselect[]" id="category_id_unselect" onchange="" size="10" style="height: 120px; min-width: 200px;" multiple>
<!--{html_options values=$arrCatVal output=$arrCatOut selected=$arrForm.category_id}-->
</select>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<th>公開・非公開<span class="attention"> *</span></th>
<td>
<!--{html_radios name="status" options=$arrDISP selected=$arrForm.status separator='&nbsp;&nbsp;'}-->
</td>
</tr>
<tr>
<th>商品ステータス</th>
<td>
<!--{html_checkboxes name="product_status" options=$arrSTATUS selected=$arrForm.product_status separator='&nbsp;&nbsp;'}-->
</td>
</tr>
<tr>
<th>名入れオプション<span class="attention"> *</span></th>
<td>
<!--{html_radios name="putting_name_flg" options=$arrPuttingNameFlg selected=$arrForm.putting_name_flg separator='&nbsp;&nbsp;'}-->
</td>
</tr>
<tr>
<th>名入れ価格</th>
<td>
<span class="attention"><!--{$arrErr.price01}--></span>
<input type="text" name="putting_name_price" value="<!--{$arrForm.putting_name_price|h}-->" size="6" class="box6" maxlength="<!--{$smarty.const.PRICE_LEN}-->" style="<!--{if $arrErr.putting_name_price != ""}-->background-color: <!--{$smarty.const.ERR_COLOR}-->;<!--{/if}-->"/>円
<span class="attention"> (半角数字で入力)</span>
</td>
</tr>
<!--{if $arrForm.has_product_class == false}-->
<tr>
<th>商品種別<span class="attention"> *</span></th>
<td>
<!--{html_radios name="product_type_id" options=$arrProductType selected=$arrForm.product_type_id separator='&nbsp;&nbsp;'}-->
</td>
</tr>
<tr>
<th>ダウンロード商品ファイル名<span class="attention"> *</span></th>
<td>
<span class="attention"><!--{$arrErr.down_filename}--></span>
<input type="text" name="down_filename" value="<!--{$arrForm.down_filename|h}-->" maxlength="<!--{$smarty.const.STEXT_LEN}-->" style="<!--{if $arrErr.down_filename != ""}-->background-color: <!--{$smarty.const.ERR_COLOR}--><!--{/if}-->" size="60" class="box60" />
<span class="red"> (上限<!--{$smarty.const.STEXT_LEN}-->文字)</span>
</td>
</tr>
<tr>
<!--{assign var=key value="down_file"}-->
<th>ダウンロード商品用<br />ファイルアップロード<span class="attention"> *</span></th>
<td>
<a name="<!--{$key}-->"></a>
<span class="attention"><!--{$arrErr[$key]}--><!--{$arrErr.down_realfilename}--></span>
<!--{if $arrForm.down_realfilename != ""}-->
<!--{$arrForm.down_realfilename|h}--><input type="hidden" name="down_realfilename" value="<!--{$arrForm.down_realfilename|h}-->">
<a href="" onclick="selectAll('category_id'); fnModeSubmit('delete_down', 'down_key', '<!--{$key}-->'); return false;">[ファイルの取り消し]</a><br>
<!--{/if}-->
<input type="file" name="down_file" size="40" style="<!--{$arrErr[$key]|sfGetErrorColor}-->" />
<a class="btn-normal" href="javascript:;" name="btn" onclick="selectAll('category_id'); fnModeSubmit('upload_down', 'down_key', '<!--{$key}-->'); return false;">アップロード</a><br />登録可能拡張子:<!--{$smarty.const.DOWNLOAD_EXTENSION}--> (パラメーター DOWNLOAD_EXTENSION)
</td>
</tr>
<tr>
<th>商品コード<span class="attention"> *</span></th>
<td>
<span class="attention"><!--{$arrErr.product_code}--></span>
<input type="text" name="product_code" value="<!--{$arrForm.product_code|h}-->" maxlength="<!--{$smarty.const.STEXT_LEN}-->" style="<!--{if $arrErr.product_code != ""}-->background-color: <!--{$smarty.const.ERR_COLOR}-->;<!--{/if}-->" size="60" class="box60" />
<span class="attention"> (上限<!--{$smarty.const.STEXT_LEN}-->文字)</span>
</td>
</tr>
<tr>
<th><!--{$smarty.const.NORMAL_PRICE_TITLE}--></th>
<td>
<span class="attention"><!--{$arrErr.price01}--></span>
<input type="text" name="price01" value="<!--{$arrForm.price01|h}-->" size="6" class="box6" maxlength="<!--{$smarty.const.PRICE_LEN}-->" style="<!--{if $arrErr.price01 != ""}-->background-color: <!--{$smarty.const.ERR_COLOR}-->;<!--{/if}-->"/>円
<span class="attention"> (半角数字で入力)</span>
</td>
</tr>
<tr>
<th><!--{$smarty.const.SALE_PRICE_TITLE}--><span class="attention"> *</span></th>
<td>
<span class="attention"><!--{$arrErr.price02}--></span>
<input type="text" name="price02" value="<!--{$arrForm.price02|h}-->" size="6" class="box6" maxlength="<!--{$smarty.const.PRICE_LEN}-->" style="<!--{if $arrErr.price02 != ""}-->background-color: <!--{$smarty.const.ERR_COLOR}-->;<!--{/if}-->"/>円
<span class="attention"> (半角数字で入力)</span>
</td>
</tr>
<tr>
<th>在庫数<span class="attention"> *</span></th>
<td>
<span class="attention"><!--{$arrErr.stock}--></span>
<input type="text" name="stock" value="<!--{$arrForm.stock|h}-->" size="6" class="box6" maxlength="<!--{$smarty.const.AMOUNT_LEN}-->" style="<!--{if $arrErr.stock != ""}-->background-color: <!--{$smarty.const.ERR_COLOR}-->;<!--{/if}-->"/>
<input type="checkbox" name="stock_unlimited" value="1" <!--{if $arrForm.stock_unlimited == "1"}-->checked<!--{/if}--> onclick="fnCheckStockLimit('<!--{$smarty.const.DISABLED_RGB}-->');"/>無制限
</td>
</tr>
<!--{/if}-->
<tr>
<th>商品送料</th>
<td>
<span class="attention"><!--{$arrErr.deliv_fee}--></span>
<input type="text" name="deliv_fee" value="<!--{$arrForm.deliv_fee|h}-->" size="6" class="box6" maxlength="<!--{$smarty.const.PRICE_LEN}-->" style="<!--{if $arrErr.deliv_fee != ""}-->background-color: <!--{$smarty.const.ERR_COLOR}-->;<!--{/if}-->"/>円
<span class="attention"> (半角数字で入力)</span>
<!--{if $smarty.const.OPTION_PRODUCT_DELIV_FEE != 1}--><br /><span class="attention">※現在無効です</span> (パラメーター OPTION_PRODUCT_DELIV_FEE)<!--{/if}-->
</td>
</tr>
<tr>
<th>ポイント付与率<span class="attention"> *</span></th>
<td>
<span class="attention"><!--{$arrErr.point_rate}--></span>
<input type="text" name="point_rate" value="<!--{$arrForm.point_rate|default:$arrForm.arrInfo.point_rate|h}-->" size="6" class="box6" maxlength="<!--{$smarty.const.PERCENTAGE_LEN}-->" style="<!--{if $arrErr.point_rate != ""}-->background-color: <!--{$smarty.const.ERR_COLOR}-->;<!--{/if}-->"/>%
<span class="attention"> (半角数字で入力)</span>
</td>
</tr>
<tr>
<th>発送日目安</th>
<td>
<span class="attention"><!--{$arrErr.deliv_date_id}--></span>
<select name="deliv_date_id" style="<!--{$arrErr.deliv_date_id|sfGetErrorColor}-->">
<option value="">選択してください</option>
<!--{html_options options=$arrDELIVERYDATE selected=$arrForm.deliv_date_id}-->
</select>
</td>
</tr>
<tr>
<th>販売制限数</th>
<td>
<span class="attention"><!--{$arrErr.sale_limit}--></span>
<input type="text" name="sale_limit" value="<!--{$arrForm.sale_limit|h}-->" size="6" class="box6" maxlength="<!--{$smarty.const.AMOUNT_LEN}-->" style="<!--{if $arrErr.sale_limit != ""}-->background-color: <!--{$smarty.const.ERR_COLOR}-->;<!--{/if}-->"/>
<span class="attention"> (半角数字で入力)</span>
</td>
</tr>
<tr>
<th>メーカー</th>
<td>
<span class="attention"><!--{$arrErr.maker_id}--></span>
<select name="maker_id" style="<!--{$arrErr.maker_id|sfGetErrorColor}-->">
<option value="">選択してください</option>
<!--{html_options options=$arrMaker selected=$arrForm.maker_id}-->
</select>
</td>
</tr>
<tr>
<th>メーカーURL</th>
<td>
<span class="attention"><!--{$arrErr.comment1}--></span>
<input type="text" name="comment1" value="<!--{$arrForm.comment1|h}-->" maxlength="<!--{$smarty.const.URL_LEN}-->" size="60" class="box60" style="<!--{$arrErr.comment1|sfGetErrorColor}-->" />
<span class="attention"> (上限<!--{$smarty.const.URL_LEN}-->文字)</span>
</td>
</tr>
<tr>
<th>検索ワード<br />※複数の場合は、カンマ( , )区切りで入力して下さい</th>
<td>
<span class="attention"><!--{$arrErr.comment3}--></span>
<textarea name="comment3" cols="60" rows="8" class="area60" maxlength="<!--{$smarty.const.LLTEXT_LEN}-->" style="<!--{$arrErr.comment3|sfGetErrorColor}-->"><!--{$arrForm.comment3|h}--></textarea><br />
<span class="attention"> (上限<!--{$smarty.const.LLTEXT_LEN}-->文字)</span>
</td>
</tr>
<tr>
<th>備考欄(SHOP専用)</th>
<td>
<span class="attention"><!--{$arrErr.note}--></span>
<textarea name="note" cols="60" rows="8" class="area60" maxlength="<!--{$smarty.const.LLTEXT_LEN}-->" style="<!--{$arrErr.note|sfGetErrorColor}-->"><!--{$arrForm.note|h}--></textarea><br />
<span class="attention"> (上限<!--{$smarty.const.LLTEXT_LEN}-->文字)</span>
</td>
</tr>
<tr>
<th>一覧-メインコメント<span class="attention"> *</span></th>
<td>
<span class="attention"><!--{$arrErr.main_list_comment}--></span>
<textarea name="main_list_comment" maxlength="<!--{$smarty.const.MTEXT_LEN}-->" style="<!--{if $arrErr.main_list_comment != ""}-->background-color: <!--{$smarty.const.ERR_COLOR}-->;<!--{/if}-->" cols="60" rows="8" class="area60"><!--{$arrForm.main_list_comment|h}--></textarea><br />
<span class="attention"> (上限<!--{$smarty.const.MTEXT_LEN}-->文字)</span>
</td>
</tr>
<tr>
<th>詳細-メインコメント<span class="attention">(タグ許可)*</span></th>
<td>
<span class="attention"><!--{$arrErr.main_comment}--></span>
<textarea name="main_comment" maxlength="<!--{$smarty.const.LLTEXT_LEN}-->" style="<!--{if $arrErr.main_comment != ""}-->background-color: <!--{$smarty.const.ERR_COLOR}-->;<!--{/if}-->" cols="60" rows="8" class="area60"><!--{$arrForm.main_comment|h}--></textarea><br />
<span class="attention"> (上限<!--{$smarty.const.LLTEXT_LEN}-->文字)</span>
</td>
</tr>
<tr>
<!--{assign var=key value="main_list_image"}-->
<th>一覧-メイン画像<br />[<!--{$smarty.const.SMALL_IMAGE_WIDTH}-->×<!--{$smarty.const.SMALL_IMAGE_HEIGHT}-->]</th>
<td>
<a name="<!--{$key}-->"></a>
<a name="main_image"></a>
<a name="main_large_image"></a>
<span class="attention"><!--{$arrErr[$key]}--></span>
<!--{if $arrForm.arrFile[$key].filepath != ""}-->
<img src="<!--{$arrForm.arrFile[$key].filepath}-->" alt="<!--{$arrForm.name|h}-->" /> <a href="" onclick="selectAll('category_id'); fnModeSubmit('delete_image', 'image_key', '<!--{$key}-->'); return false;">[画像の取り消し]</a><br />
<!--{/if}-->
<input type="file" name="main_list_image" size="40" style="<!--{$arrErr[$key]|sfGetErrorColor}-->" />
<a class="btn-normal" href="javascript:;" name="btn" onclick="selectAll('category_id'); fnModeSubmit('upload_image', 'image_key', '<!--{$key}-->'); return false;">アップロード</a>
</td>
</tr>
<tr>
<!--{assign var=key value="main_image"}-->
<th>詳細-メイン画像<br />[<!--{$smarty.const.NORMAL_IMAGE_WIDTH}-->×<!--{$smarty.const.NORMAL_IMAGE_HEIGHT}-->]</th>
<td>
<span class="attention"><!--{$arrErr[$key]}--></span>
<!--{if $arrForm.arrFile[$key].filepath != ""}-->
<img src="<!--{$arrForm.arrFile[$key].filepath}-->" alt="<!--{$arrForm.name|h}-->" /> <a href="" onclick="selectAll('category_id'); fnModeSubmit('delete_image', 'image_key', '<!--{$key}-->'); return false;">[画像の取り消し]</a><br />
<!--{/if}-->
<input type="file" name="main_image" size="40" style="<!--{$arrErr[$key]|sfGetErrorColor}-->" />
<a class="btn-normal" href="javascript:;" name="btn" onclick="selectAll('category_id'); fnModeSubmit('upload_image', 'image_key', '<!--{$key}-->'); return false;">アップロード</a>
</td>
</tr>
<tr>
<!--{assign var=key value="main_large_image"}-->
<th>詳細-メイン拡大画像<br />[<!--{$smarty.const.LARGE_IMAGE_WIDTH}-->×<!--{$smarty.const.LARGE_IMAGE_HEIGHT}-->]</th>
<td>
<span class="attention"><!--{$arrErr[$key]}--></span>
<!--{if $arrForm.arrFile[$key].filepath != ""}-->
<img src="<!--{$arrForm.arrFile[$key].filepath}-->" alt="<!--{$arrForm.name|h}-->" /> <a href="" onclick="selectAll('category_id'); fnModeSubmit('delete_image', 'image_key', '<!--{$key}-->'); return false;">[画像の取り消し]</a><br />
<!--{/if}-->
<input type="file" name="<!--{$key}-->" size="40" style="<!--{$arrErr[$key]|sfGetErrorColor}-->" />
<a class="btn-normal" href="javascript:;" name="btn" onclick="selectAll('category_id'); fnModeSubmit('upload_image', 'image_key', '<!--{$key}-->'); return false;">アップロード</a>
</td>
</tr>
</table>
<!--{* オペビルダー用 *}-->
<!--{if "sfViewAdminOpe"|function_exists === TRUE}-->
<!--{include file=`$smarty.const.MODULE_REALDIR`mdl_opebuilder/admin_ope_view.tpl}-->
<!--{/if}-->
<div class="btn">
<a class="btn-normal" href="javascript:;" onclick="selectAll('category_id'); lfDispSwitch('sub_detail'); return false;"><span>サブ情報表示/非表示</span></a>
</div>
<!--{if $arrForm.sub_find == true}-->
<div id="sub_detail" style="">
<!--{else}-->
<div id="sub_detail" style="display:none">
<!--{/if}-->
<h2>サブ情報</h2>
<table class="form">
<!--{section name=cnt loop=$smarty.const.PRODUCTSUB_MAX}-->
<!--▼商品<!--{$smarty.section.cnt.iteration}-->-->
<tr>
<th>詳細-サブタイトル(<!--{$smarty.section.cnt.iteration}-->)</th>
<!--{assign var=key value="sub_title`$smarty.section.cnt.iteration`"}-->
<td>
<span class="attention"><!--{$arrErr[$key]}--></span>
<input type="text" name="sub_title<!--{$smarty.section.cnt.iteration}-->" value="<!--{$arrForm[$key]|h}-->" size="60" class="box60" maxlength="<!--{$smarty.const.STEXT_LEN}-->" style="<!--{$arrErr[$key]|sfGetErrorColor}-->"/>
<span class="attention"> (上限<!--{$smarty.const.STEXT_LEN}-->文字)</span>
</td>
</tr>
<tr>
<th>詳細-サブコメント(<!--{$smarty.section.cnt.iteration}-->)<span class="attention">(タグ許可)</span></th>
<!--{assign var=key value="sub_comment`$smarty.section.cnt.iteration`"}-->
<td>
<span class="attention"><!--{$arrErr[$key]}--></span>
<textarea name="sub_comment<!--{$smarty.section.cnt.iteration}-->" cols="60" rows="8" class="area60" maxlength="<!--{$smarty.const.LLTEXT_LEN}-->" style="<!--{$arrErr[$key]|sfGetErrorColor}-->"><!--{$arrForm[$key]|h}--></textarea><br />
<span class="attention"> (上限<!--{$smarty.const.LLTEXT_LEN}-->文字)</span>
</td>
</tr>
<tr>
<!--{assign var=key value="sub_image`$smarty.section.cnt.iteration`"}-->
<th>詳細-サブ画像(<!--{$smarty.section.cnt.iteration}-->)<br />[<!--{$smarty.const.NORMAL_SUBIMAGE_WIDTH}-->×<!--{$smarty.const.NORMAL_SUBIMAGE_HEIGHT}-->]</th>
<td>
<a name="<!--{$key}-->"></a>
<!--{assign var=largekey value="sub_large_image`$smarty.section.cnt.iteration`"}-->
<a name="<!--{$largekey}-->"></a>
<span class="attention"><!--{$arrErr[$key]}--></span>
<!--{if $arrForm.arrFile[$key].filepath != ""}-->
<img src="<!--{$arrForm.arrFile[$key].filepath}-->" alt="<!--{$arrForm.name|h}-->" /> <a href="" onclick="selectAll('category_id'); fnModeSubmit('delete_image', 'image_key', '<!--{$key}-->'); return false;">[画像の取り消し]</a><br />
<!--{/if}-->
<input type="file" name="<!--{$key}-->" size="40" style="<!--{$arrErr[$key]|sfGetErrorColor}-->"/>
<a class="btn-normal" href="javascript:;" name="btn" onclick="selectAll('category_id'); fnModeSubmit('upload_image', 'image_key', '<!--{$key}-->'); return false;">アップロード</a>
</td>
</tr>
<tr>
<!--{assign var=key value="sub_large_image`$smarty.section.cnt.iteration`"}-->
<th>詳細-サブ拡大画像(<!--{$smarty.section.cnt.iteration}-->)<br />[<!--{$smarty.const.LARGE_SUBIMAGE_WIDTH}-->×<!--{$smarty.const.LARGE_SUBIMAGE_HEIGHT}-->]</th>
<td>
<span class="attention"><!--{$arrErr[$key]}--></span>
<!--{if $arrForm.arrFile[$key].filepath != ""}-->
<img src="<!--{$arrForm.arrFile[$key].filepath}-->" alt="<!--{$arrForm.name|h}-->" /> <a href="" onclick="selectAll('category_id'); fnModeSubmit('delete_image', 'image_key', '<!--{$key}-->'); return false;">[画像の取り消し]</a><br />
<!--{/if}-->
<input type="file" name="<!--{$key}-->" size="40" style="<!--{$arrErr[$key]|sfGetErrorColor}-->"/>
<a class="btn-normal" href="javascript:;" name="btn" onclick="selectAll('category_id'); fnModeSubmit('upload_image', 'image_key', '<!--{$key}-->'); return false;">アップロード</a>
</td>
</tr>
<!--▲商品<!--{$smarty.section.cnt.iteration}-->-->
<!--{/section}-->
</table>
</div>
<div class="btn">
<a class="btn-normal" href="javascript:;" onclick="selectAll('category_id'); lfDispSwitch('recommend_select'); return false;"><span>関連商品表示/非表示</span></a>
</div>
<!--{if $smarty.const.OPTION_RECOMMEND == 1}-->
<!--{if count($arrRecommend) > 0}-->
<div id="recommend_select" style="">
<!--{else}-->
<div id="recommend_select" style="display:none">
<!--{/if}-->
<h2>関連商品</h2>
<table class="form">
<!--▼関連商品-->
<!--{section name=cnt loop=$smarty.const.RECOMMEND_PRODUCT_MAX}-->
<!--{assign var=recommend_no value="`$smarty.section.cnt.iteration`"}-->
<tr>
<!--{assign var=key value="recommend_id`$smarty.section.cnt.iteration`"}-->
<!--{assign var=anckey value="recommend_no`$smarty.section.cnt.iteration`"}-->
<th>関連商品(<!--{$smarty.section.cnt.iteration}-->)<br />
<!--{if $arrRecommend[$recommend_no].product_id}-->
<img src="<!--{$smarty.const.ROOT_URLPATH}-->resize_image.php?image=<!--{$arrRecommend[$recommend_no].main_list_image|sfNoImageMainList|h}-->&width=65&height=65" alt="<!--{$arrRecommend[$recommend_no].name|h}-->" />
<!--{/if}-->
</th>
<td>
<a name="<!--{$anckey}-->"></a>
<input type="hidden" name="<!--{$key}-->" value="<!--{$arrRecommend[$recommend_no].product_id|h}-->" />
<a class="btn-normal" href="javascript:;" name="change" onclick="selectAll('category_id'); win03('./product_select.php?no=<!--{$smarty.section.cnt.iteration}-->', 'search', '615', '500'); return false;">変更</a>
<!--{assign var=key value="recommend_delete`$smarty.section.cnt.iteration`"}-->
<input type="checkbox" name="<!--{$key}-->" value="1" />削除<br />
<!--{assign var=key value="recommend_comment`$smarty.section.cnt.iteration`"}-->
<span class="attention"><!--{$arrErr[$key]}--></span>
商品コード:<!--{$arrRecommend[$recommend_no].product_code_min}--><br />
商品名:<!--{$arrRecommend[$recommend_no].name|h}--><br />
<textarea name="<!--{$key}-->" cols="60" rows="8" class="area60" style="<!--{$arrErr[$key]|sfGetErrorColor}-->" ><!--{$arrRecommend[$recommend_no].comment|h}--></textarea><br />
<span class="attention"> (上限<!--{$smarty.const.LTEXT_LEN}-->文字)</span>
</td>
</tr>
<!--{/section}-->
<!--▲関連商品-->
</table>
</div>
<!--{/if}-->
<div class="btn-area">
<!--{if count($arrSearchHidden) > 0}-->
<!--▼検索結果へ戻る-->
<ul>
<li><a class="btn-action" href="javascript:;" onclick="fnChangeAction('<!--{$smarty.const.ADMIN_PRODUCTS_URLPATH}-->'); fnModeSubmit('search','',''); return false;"><span class="btn-prev">検索画面に戻る</span></a></li>
<!--▲検索結果へ戻る-->
<!--{/if}-->
<li><a class="btn-action" href="javascript:;" onclick="selectAll('category_id'); document.form1.submit(); return false;"><span class="btn-next">確認ページへ</span></a></li>
</ul>
</div>
</div>
</form>
<?php
/* data/class/pages/admin/products/LC_Page_Admin_Products_Product.php
* This file is part of EC-CUBE
*
* Copyright(c) 2000-2012 LOCKON CO.,LTD. All Rights Reserved.
*
* http://www.lockon.co.jp/
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// {{{ requires
require_once CLASS_EX_REALDIR . 'page_extends/admin/products/LC_Page_Admin_Products_Ex.php';
/**
* 商品登録 のページクラス
*
* @package Page
* @author LOCKON CO.,LTD.
* @version $Id$
*/
class LC_Page_Admin_Products_Product extends LC_Page_Admin_Products_Ex {
// }}}
// {{{ functions
/**
* Page を初期化する.
*
* @return void
*/
function init() {
parent::init();
$this->tpl_mainpage = 'products/product.tpl';
$this->tpl_mainno = 'products';
$this->tpl_subno = 'product';
$this->tpl_maintitle = '商品管理';
$this->tpl_subtitle = '商品登録';
$masterData = new SC_DB_MasterData_Ex();
$this->arrProductType = $masterData->getMasterData('mtb_product_type');
$this->arrDISP = $masterData->getMasterData('mtb_disp');
$this->arrSTATUS = $masterData->getMasterData('mtb_status');
$this->arrSTATUS_IMAGE = $masterData->getMasterData('mtb_status_image');
$this->arrDELIVERYDATE = $masterData->getMasterData('mtb_delivery_date');
$this->arrMaker = SC_Helper_DB_Ex::sfGetIDValueList('dtb_maker', 'maker_id', 'name');
$this->arrAllowedTag = $masterData->getMasterData('mtb_allowed_tag');
$this->arrPuttingNameFlg = array('1' => '対応', '0' => '非対応');
}
/**
* Page のプロセス.
*
* @return void
*/
function process() {
$this->action();
$this->sendResponse();
}
/**
* Page のアクション.
*
* @return void
*/
function action() {
$objFormParam = new SC_FormParam_Ex();
// アップロードファイル情報の初期化
$objUpFile = new SC_UploadFile_Ex(IMAGE_TEMP_REALDIR, IMAGE_SAVE_REALDIR);
$this->lfInitFile($objUpFile);
$objUpFile->setHiddenFileList($_POST);
// ダウンロード販売ファイル情報の初期化
$objDownFile = new SC_UploadFile_Ex(DOWN_TEMP_REALDIR, DOWN_SAVE_REALDIR);
$this->lfInitDownFile($objDownFile);
$objDownFile->setHiddenFileList($_POST);
// 検索パラメーター引き継ぎ
$this->arrSearchHidden = $this->lfGetSearchParam($_POST);
$mode = $this->getMode();
switch ($mode) {
case 'pre_edit':
case 'copy' :
// パラメーター初期化(商品ID)
$this->lfInitFormParam_PreEdit($objFormParam, $_POST);
// エラーチェック
$this->arrErr = $objFormParam->checkError();
if (count($this->arrErr) > 0) {
trigger_error('', E_USER_ERROR);
}
// 商品ID取得
$product_id = $objFormParam->getValue('product_id');
// 商品データ取得
$arrForm = $this->lfGetFormParam_PreEdit($objUpFile, $objDownFile, $product_id);
// 複製の場合は、ダウンロード商品情報部分はコピーしない
if ($mode == 'copy') {
// ダウンロード商品ファイル名をunset
$arrForm['down_filename'] = '';
// $objDownFile->setDBDownFile()でsetされたダウンロードファイル名をunset
unset($objDownFile->save_file[0]);
}
// ページ表示用パラメーター設定
$this->arrForm = $this->lfSetViewParam_InputPage($objUpFile, $objDownFile, $arrForm);
// 商品複製の場合、画像ファイルコピー
if ($mode == 'copy') {
$this->arrForm['copy_product_id'] = $this->arrForm['product_id'];
$this->arrForm['product_id'] = '';
// 画像ファイルのコピー
$this->lfCopyProductImageFiles($objUpFile);
}
// ページonload時のJavaScript設定
$this->tpl_onload = $this->lfSetOnloadJavaScript_InputPage();
break;
case 'edit':
// パラメーター初期化, 取得
$this->lfInitFormParam($objFormParam, $_POST);
$arrForm = $objFormParam->getHashArray();
// エラーチェック
$this->arrErr = $this->lfCheckError_Edit($objFormParam, $objUpFile, $objDownFile, $arrForm);
if (count($this->arrErr) == 0) {
// 確認画面表示設定
$this->tpl_mainpage = 'products/confirm.tpl';
$this->arrCatList = $this->lfGetCategoryList_Edit();
$this->arrForm = $this->lfSetViewParam_ConfirmPage($objUpFile, $objDownFile, $arrForm);
} else {
// 入力画面表示設定
$this->arrForm = $this->lfSetViewParam_InputPage($objUpFile, $objDownFile, $arrForm);
// ページonload時のJavaScript設定
$this->tpl_onload = $this->lfSetOnloadJavaScript_InputPage();
}
break;
case 'complete':
// パラメーター初期化, 取得
$this->lfInitFormParam($objFormParam, $_POST);
$arrForm = $this->lfGetFormParam_Complete($objFormParam);
// エラーチェック
$this->arrErr = $this->lfCheckError_Edit($objFormParam, $objUpFile, $objDownFile, $arrForm);
if (count($this->arrErr) == 0) {
// DBへデータ登録
$product_id = $this->lfRegistProduct($objUpFile, $objDownFile, $arrForm);
// 件数カウントバッチ実行
$objQuery =& SC_Query_Ex::getSingletonInstance();
$objDb = new SC_Helper_DB_Ex();
$objDb->sfCountCategory($objQuery);
$objDb->sfCountMaker($objQuery);
// ダウンロード商品の複製時に、ダウンロード商品用ファイルを
// 変更すると、複製元のファイルが削除されるのを回避。
if (!empty($arrForm['copy_product_id'])) {
$objDownFile->save_file = array();
}
// 一時ファイルを本番ディレクトリに移動する
$this->lfSaveUploadFiles($objUpFile, $objDownFile, $product_id);
$this->tpl_mainpage = 'products/complete.tpl';
$this->arrForm['product_id'] = $product_id;
} else {
// 入力画面表示設定
$this->arrForm = $this->lfSetViewParam_InputPage($objUpFile, $objDownFile, $arrForm);
// ページonload時のJavaScript設定
$this->tpl_onload = $this->lfSetOnloadJavaScript_InputPage();
}
break;
// 画像のアップロード
case 'upload_image':
case 'delete_image':
// パラメーター初期化
$this->lfInitFormParam_UploadImage($objFormParam);
$this->lfInitFormParam($objFormParam, $_POST);
$arrForm = $objFormParam->getHashArray();
switch ($mode) {
case 'upload_image':
// ファイルを一時ディレクトリにアップロード
$this->arrErr[$arrForm['image_key']] = $objUpFile->makeTempFile($arrForm['image_key'], IMAGE_RENAME);
if ($this->arrErr[$arrForm['image_key']] == '') {
// 縮小画像作成
$this->lfSetScaleImage($objUpFile, $arrForm['image_key']);
}
break;
case 'delete_image':
// ファイル削除
$this->lfDeleteTempFile($objUpFile, $arrForm['image_key']);
break;
default:
break;
}
// 入力画面表示設定
$this->arrForm = $this->lfSetViewParam_InputPage($objUpFile, $objDownFile, $arrForm);
// ページonload時のJavaScript設定
$anchor_hash = $this->getAnchorHash($arrForm['image_key']);
$this->tpl_onload = $this->lfSetOnloadJavaScript_InputPage($anchor_hash);
break;
// ダウンロード商品ファイルアップロード
case 'upload_down':
case 'delete_down':
// パラメーター初期化
$this->lfInitFormParam_UploadDown($objFormParam);
$this->lfInitFormParam($objFormParam, $_POST);
$arrForm = $objFormParam->getHashArray();
switch ($mode) {
case 'upload_down':
// ファイルを一時ディレクトリにアップロード
$this->arrErr[$arrForm['down_key']] = $objDownFile->makeTempDownFile();
break;
case 'delete_down':
// ファイル削除
$objDownFile->deleteFile($arrForm['down_key']);
break;
default:
break;
}
// 入力画面表示設定
$this->arrForm = $this->lfSetViewParam_InputPage($objUpFile, $objDownFile, $arrForm);
// ページonload時のJavaScript設定
$anchor_hash = $this->getAnchorHash($arrForm['down_key']);
$this->tpl_onload = $this->lfSetOnloadJavaScript_InputPage($anchor_hash);
break;
// 関連商品選択
case 'recommend_select' :
// パラメーター初期化
$this->lfInitFormParam_RecommendSelect($objFormParam);
$this->lfInitFormParam($objFormParam, $_POST);
$arrForm = $objFormParam->getHashArray();
// 入力画面表示設定
$this->arrForm = $this->lfSetViewParam_InputPage($objUpFile, $objDownFile, $arrForm);
// 選択された関連商品IDがすでに登録している関連商品と重複していないかチェック
$this->lfCheckError_RecommendSelect($this->arrForm, $this->arrErr);
// ページonload時のJavaScript設定
$anchor_hash = $this->getAnchorHash($this->arrForm['anchor_key']);
$this->tpl_onload = $this->lfSetOnloadJavaScript_InputPage($anchor_hash);
break;
// 確認ページからの戻り
case 'confirm_return':
// パラメーター初期化
$this->lfInitFormParam($objFormParam, $_POST);
$arrForm = $objFormParam->getHashArray();
// 入力画面表示設定
$this->arrForm = $this->lfSetViewParam_InputPage($objUpFile, $objDownFile, $arrForm);
// ページonload時のJavaScript設定
$this->tpl_onload = $this->lfSetOnloadJavaScript_InputPage();
break;
default:
// 入力画面表示設定
$arrForm = array();
$this->arrForm = $this->lfSetViewParam_InputPage($objUpFile, $objDownFile, $arrForm);
// ページonload時のJavaScript設定
$this->tpl_onload = $this->lfSetOnloadJavaScript_InputPage();
break;
}
// 関連商品の読み込み
$this->arrRecommend = $this->lfGetRecommendProducts($this->arrForm);
}
/**
* デストラクタ.
*
* @return void
*/
function destroy() {
parent::destroy();
}
/**
* パラメーター情報の初期化
* - 編集/複製モード
*
* @param object $objFormParam SC_FormParamインスタンス
* @param array $arrPost $_POSTデータ
* @return void
*/
function lfInitFormParam_PreEdit(&$objFormParam, $arrPost) {
$objFormParam->addParam('商品ID', 'product_id', INT_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK'));
$objFormParam->setParam($arrPost);
$objFormParam->convParam();
}
/**
* パラメーター情報の初期化
*
* @param object $objFormParam SC_FormParamインスタンス
* @param array $arrPost $_POSTデータ
* @return void
*/
function lfInitFormParam(&$objFormParam, $arrPost) {
$objFormParam->addParam('商品ID', 'product_id', INT_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK'));
$objFormParam->addParam('商品名', 'name', STEXT_LEN, 'KVa', array('EXIST_CHECK', 'SPTAB_CHECK', 'MAX_LENGTH_CHECK'));
$objFormParam->addParam('商品カテゴリ', 'category_id', INT_LEN, 'n', array('EXIST_CHECK', 'NUM_CHECK', 'MAX_LENGTH_CHECK'));
$objFormParam->addParam('公開・非公開', 'status', INT_LEN, 'n', array('EXIST_CHECK', 'NUM_CHECK', 'MAX_LENGTH_CHECK'));
$objFormParam->addParam('商品ステータス', 'product_status', INT_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK'));
$objFormParam->addParam('名入れオプション', 'putting_name_flg', INT_LEN, 'n', array('EXIST_CHECK', 'NUM_CHECK', 'MAX_LENGTH_CHECK'));
$objFormParam->addParam('名入れ価格', 'putting_name_price', PRICE_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK'));
if ($this->lfGetProductClassFlag($arrPost['has_product_class']) == false) {
// 新規登録, 規格なし商品の編集の場合
$objFormParam->addParam('商品種別', 'product_type_id', INT_LEN, 'n', array('EXIST_CHECK', 'NUM_CHECK', 'MAX_LENGTH_CHECK'));
$objFormParam->addParam('ダウンロード商品ファイル名', 'down_filename', STEXT_LEN, 'KVa', array('SPTAB_CHECK', 'MAX_LENGTH_CHECK'));
$objFormParam->addParam('ダウンロード商品実ファイル名', 'down_realfilename', MTEXT_LEN, 'KVa', array('SPTAB_CHECK', 'MAX_LENGTH_CHECK'));
$objFormParam->addParam('temp_down_file', 'temp_down_file', '', '', array());
$objFormParam->addParam('save_down_file', 'save_down_file', '', '', array());
$objFormParam->addParam('商品コード', 'product_code', STEXT_LEN, 'KVna', array('EXIST_CHECK', 'SPTAB_CHECK','MAX_LENGTH_CHECK'));
$objFormParam->addParam(NORMAL_PRICE_TITLE, 'price01', PRICE_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK'));
$objFormParam->addParam(SALE_PRICE_TITLE, 'price02', PRICE_LEN, 'n', array('EXIST_CHECK', 'NUM_CHECK', 'MAX_LENGTH_CHECK'));
$objFormParam->addParam('在庫数', 'stock', AMOUNT_LEN, 'n', array('SPTAB_CHECK', 'NUM_CHECK', 'MAX_LENGTH_CHECK'));
$objFormParam->addParam('在庫無制限', 'stock_unlimited', INT_LEN, 'n', array('SPTAB_CHECK', 'NUM_CHECK', 'MAX_LENGTH_CHECK'));
}
$objFormParam->addParam('商品送料', 'deliv_fee', PRICE_LEN, 'n', array('NUM_CHECK', 'SPTAB_CHECK', 'MAX_LENGTH_CHECK'));
$objFormParam->addParam('ポイント付与率', 'point_rate', PERCENTAGE_LEN, 'n', array('EXIST_CHECK', 'NUM_CHECK', 'SPTAB_CHECK', 'MAX_LENGTH_CHECK'));
$objFormParam->addParam('発送日目安', 'deliv_date_id', INT_LEN, 'n', array('NUM_CHECK'));
$objFormParam->addParam('販売制限数', 'sale_limit', AMOUNT_LEN, 'n', array('SPTAB_CHECK', 'ZERO_CHECK', 'NUM_CHECK', 'MAX_LENGTH_CHECK'));
$objFormParam->addParam('メーカー', 'maker_id', INT_LEN, 'n', array('NUM_CHECK'));
$objFormParam->addParam('メーカーURL', 'comment1', URL_LEN, 'a', array('SPTAB_CHECK', 'URL_CHECK', 'MAX_LENGTH_CHECK'));
$objFormParam->addParam('検索ワード', 'comment3', LLTEXT_LEN, 'KVa', array('SPTAB_CHECK', 'MAX_LENGTH_CHECK'));
$objFormParam->addParam('備考欄(SHOP専用)', 'note', LLTEXT_LEN, 'KVa', array('SPTAB_CHECK', 'MAX_LENGTH_CHECK'));
$objFormParam->addParam('一覧-メインコメント', 'main_list_comment', MTEXT_LEN, 'KVa', array('EXIST_CHECK', 'SPTAB_CHECK', 'MAX_LENGTH_CHECK'));
$objFormParam->addParam('詳細-メインコメント', 'main_comment', LLTEXT_LEN, 'KVa', array('EXIST_CHECK', 'SPTAB_CHECK', 'MAX_LENGTH_CHECK'));
$objFormParam->addParam('save_main_list_image', 'save_main_list_image', '', '', array());
$objFormParam->addParam('save_main_image', 'save_main_image', '', '', array());
$objFormParam->addParam('save_main_large_image', 'save_main_large_image', '', '', array());
$objFormParam->addParam('temp_main_list_image', 'temp_main_list_image', '', '', array());
$objFormParam->addParam('temp_main_image', 'temp_main_image', '', '', array());
$objFormParam->addParam('temp_main_large_image', 'temp_main_large_image', '', '', array());
for ($cnt = 1; $cnt <= PRODUCTSUB_MAX; $cnt++) {
$objFormParam->addParam('詳細-サブタイトル' . $cnt, 'sub_title' . $cnt, STEXT_LEN, 'KVa', array('SPTAB_CHECK', 'MAX_LENGTH_CHECK'));
$objFormParam->addParam('詳細-サブコメント' . $cnt, 'sub_comment' . $cnt, LLTEXT_LEN, 'KVa', array('SPTAB_CHECK', 'MAX_LENGTH_CHECK'));
$objFormParam->addParam('save_sub_image' . $cnt, 'save_sub_image' . $cnt, '', '', array());
$objFormParam->addParam('save_sub_large_image' . $cnt, 'save_sub_large_image' . $cnt, '', '', array());
$objFormParam->addParam('temp_sub_image' . $cnt, 'temp_sub_image' . $cnt, '', '', array());
$objFormParam->addParam('temp_sub_large_image' . $cnt, 'temp_sub_large_image' . $cnt, '', '', array());
}
for ($cnt = 1; $cnt <= RECOMMEND_PRODUCT_MAX; $cnt++) {
$objFormParam->addParam('関連商品コメント' . $cnt, 'recommend_comment' . $cnt, LTEXT_LEN, 'KVa', array('SPTAB_CHECK', 'MAX_LENGTH_CHECK'));
$objFormParam->addParam('関連商品ID' . $cnt, 'recommend_id' . $cnt, INT_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK'));
$objFormParam->addParam('recommend_delete' . $cnt, 'recommend_delete' . $cnt, '', 'n', array());
}
$objFormParam->addParam('商品ID', 'copy_product_id', INT_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK'));
$objFormParam->addParam('has_product_class', 'has_product_class', INT_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK'));
$objFormParam->addParam('product_class_id', 'product_class_id', INT_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK'));
$objFormParam->setParam($arrPost);
$objFormParam->convParam();
}
/**
* パラメーター情報の初期化
* - 画像ファイルアップロードモード
*
* @param object $objFormParam SC_FormParamインスタンス
* @return void
*/
function lfInitFormParam_UploadImage(&$objFormParam) {
$objFormParam->addParam('image_key', 'image_key', '', '', array());
}
/**
* パラメーター情報の初期化
* - ダウンロード商品ファイルアップロードモード
*
* @param object $objFormParam SC_FormParamインスタンス
* @return void
*/
function lfInitFormParam_UploadDown(&$objFormParam) {
$objFormParam->addParam('down_key', 'down_key', '', '', array());
}
/**
* パラメーター情報の初期化
* - 関連商品追加モード
*
* @param object $objFormParam SC_FormParamインスタンス
* @return void
*/
function lfInitFormParam_RecommendSelect(&$objFormParam) {
$objFormParam->addParam('anchor_key', 'anchor_key', '', '', array());
$objFormParam->addParam('select_recommend_no', 'select_recommend_no', INT_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK'));
}
/**
* アップロードファイルパラメーター情報の初期化
* - 画像ファイル用
*
* @param object $objUpFile SC_UploadFileインスタンス
* @return void
*/
function lfInitFile(&$objUpFile) {
$objUpFile->addFile('一覧-メイン画像', 'main_list_image', array('jpg', 'gif', 'png'),IMAGE_SIZE, false, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
$objUpFile->addFile('詳細-メイン画像', 'main_image', array('jpg', 'gif', 'png'), IMAGE_SIZE, false, NORMAL_IMAGE_WIDTH, NORMAL_IMAGE_HEIGHT);
$objUpFile->addFile('詳細-メイン拡大画像', 'main_large_image', array('jpg', 'gif', 'png'), IMAGE_SIZE, false, LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT);
for ($cnt = 1; $cnt <= PRODUCTSUB_MAX; $cnt++) {
$objUpFile->addFile("詳細-サブ画像$cnt", "sub_image$cnt", array('jpg', 'gif', 'png'), IMAGE_SIZE, false, NORMAL_SUBIMAGE_WIDTH, NORMAL_SUBIMAGE_HEIGHT);
$objUpFile->addFile("詳細-サブ拡大画像$cnt", "sub_large_image$cnt", array('jpg', 'gif', 'png'), IMAGE_SIZE, false, LARGE_SUBIMAGE_WIDTH, LARGE_SUBIMAGE_HEIGHT);
}
}
/**
* アップロードファイルパラメーター情報の初期化
* - ダウンロード商品ファイル用
*
* @param object $objDownFile SC_UploadFileインスタンス
* @return void
*/
function lfInitDownFile(&$objDownFile) {
$objDownFile->addFile('ダウンロード販売用ファイル', 'down_file', explode(',', DOWNLOAD_EXTENSION),DOWN_SIZE, true, 0, 0);
}
/**
* フォーム入力パラメーターのエラーチェック
*
* @param object $objFormParam SC_FormParamインスタンス
* @param object $objUpFile SC_UploadFileインスタンス
* @param object $objDownFile SC_UploadFileインスタンス
* @param array $arrForm フォーム入力パラメーター配列
* @return array エラー情報を格納した連想配列
*/
function lfCheckError_Edit(&$objFormParam, &$objUpFile, &$objDownFile, $arrForm) {
$objErr = new SC_CheckError_Ex($arrForm);
$arrErr = array();
// 入力パラメーターチェック
$arrErr = $objFormParam->checkError();
// アップロードファイル必須チェック
$arrErr = array_merge((array)$arrErr, (array)$objUpFile->checkExists());
// HTMLタグ許可チェック
$objErr->doFunc(array('詳細-メインコメント', 'main_comment', $this->arrAllowedTag), array('HTML_TAG_CHECK'));
for ($cnt = 1; $cnt <= PRODUCTSUB_MAX; $cnt++) {
$objErr->doFunc(array('詳細-サブコメント' . $cnt, 'sub_comment' . $cnt, $this->arrAllowedTag), array('HTML_TAG_CHECK'));
}
// 規格情報がない商品の場合のチェック
if ($arrForm['has_product_class'] != true) {
// 在庫必須チェック(在庫無制限ではない場合)
if ($arrForm['stock_unlimited'] != UNLIMITED_FLG_UNLIMITED) {
$objErr->doFunc(array('在庫数', 'stock'), array('EXIST_CHECK'));
}
// ダウンロード商品ファイル必須チェック(ダウンロード商品の場合)
if ($arrForm['product_type_id'] == PRODUCT_TYPE_DOWNLOAD) {
$arrErr = array_merge((array)$arrErr, (array)$objDownFile->checkExists());
$objErr->doFunc(array('ダウンロード商品ファイル名', 'down_filename'), array('EXIST_CHECK'));
}
}
$arrErr = array_merge((array)$arrErr, (array)$objErr->arrErr);
return $arrErr;
}
/**
* 関連商品の重複登録チェック、エラーチェック
*
* 関連商品の重複があった場合はエラーメッセージを格納し、該当の商品IDをリセットする
*
* @param array $arrForm 入力値の配列
* @param array $arrErr エラーメッセージの配列
* @return void
*/
function lfCheckError_RecommendSelect(&$arrForm, &$arrErr) {
$select_recommend_no = $arrForm['select_recommend_no'];
$select_recommend_id = $arrForm['recommend_id' . $select_recommend_no];
foreach ($arrForm as $key => $value) {
if (preg_match('/^recommend_id/', $key)) {
if ($select_recommend_no == preg_replace('/^recommend_id/', '', $key)) {
continue;
}
if ($select_recommend_id == $arrForm[$key]) {
// 重複した場合、選択されたデータをリセットする
$arrForm['recommend_id' . $select_recommend_no] = '';
$arrErr['recommend_comment' . $select_recommend_no] = '※ すでに登録されている関連商品です。<br />';
break;
}
}
}
}
/**
* 検索パラメーター引き継ぎ用配列取得
*
* @param array $arrPost $_POSTデータ
* @return array 検索パラメーター配列
*/
function lfGetSearchParam($arrPost) {
$arrSearchParam = array();
$objFormParam = new SC_FormParam_Ex();
parent::lfInitParam($objFormParam);
$objFormParam->setParam($arrPost);
$arrSearchParam = $objFormParam->getSearchArray();
return $arrSearchParam;
}
/**
* フォームパラメーター取得
* - 編集/複製モード
*
* @param object $objUpFile SC_UploadFileインスタンス
* @param object $objDownFile SC_UploadFileインスタンス
* @param integer $product_id 商品ID
* @return array フォームパラメーター配列
*/
function lfGetFormParam_PreEdit(&$objUpFile, &$objDownFile, $product_id) {
$arrForm = array();
// DBから商品データ取得
$arrForm = $this->lfGetProductData_FromDB($product_id);
// DBデータから画像ファイル名の読込
$objUpFile->setDBFileList($arrForm);
// DBデータからダウンロードファイル名の読込
$objDownFile->setDBDownFile($arrForm);
return $arrForm;
}
/**
* フォームパラメーター取得
* - 登録モード
*
* @param object $objFormParam SC_FormParamインスタンス
* @return array フォームパラメーター配列
*/
function lfGetFormParam_Complete(&$objFormParam) {
$arrForm = $objFormParam->getHashArray();
$arrForm['category_id'] = unserialize($arrForm['category_id']);
$objFormParam->setValue('category_id', $arrForm['category_id']);
return $arrForm;
}
/**
* 表示用フォームパラメーター取得
* - 入力画面
*
* @param object $objUpFile SC_UploadFileインスタンス
* @param object $objDownFile SC_UploadFileインスタンス
* @param array $arrForm フォーム入力パラメーター配列
* @return array 表示用フォームパラメーター配列
*/
function lfSetViewParam_InputPage(&$objUpFile, &$objDownFile, &$arrForm) {
// カテゴリマスターデータ取得
$objDb = new SC_Helper_DB_Ex();
list($this->arrCatVal, $this->arrCatOut) = $objDb->sfGetLevelCatList(false);
if (isset($arrForm['category_id']) && !is_array($arrForm['category_id'])) {
$arrForm['category_id'] = unserialize($arrForm['category_id']);
}
if ($arrForm['status'] == '') {
$arrForm['status'] = DEFAULT_PRODUCT_DISP;
}
if ($arrForm['product_type_id'] == '') {
$arrForm['product_type_id'] = DEFAULT_PRODUCT_DOWN;
}
// アップロードファイル情報取得(Hidden用)
$arrHidden = $objUpFile->getHiddenFileList();
$arrForm['arrHidden'] = array_merge((array)$arrHidden, (array)$objDownFile->getHiddenFileList());
// 画像ファイル表示用データ取得
$arrForm['arrFile'] = $objUpFile->getFormFileList(IMAGE_TEMP_URLPATH, IMAGE_SAVE_URLPATH);
// ダウンロード商品実ファイル名取得
$arrForm['down_realfilename'] = $objDownFile->getFormDownFile();
// 基本情報(デフォルトポイントレート用)
$arrForm['arrInfo'] = SC_Helper_DB_Ex::sfGetBasisData();
// サブ情報ありなしフラグ
$arrForm['sub_find'] = $this->hasSubProductData($arrForm);
// 名入れ対応フラグ
if (SC_Utils_Ex::isBlank($arrForm['putting_name_flg'])) {
$arrForm['putting_name_flg'] = '0'; // 本当は定数を使う
}
return $arrForm;
}
/**
* 表示用フォームパラメーター取得
* - 確認画面
*
* @param object $objUpFile SC_UploadFileインスタンス
* @param object $objDownFile SC_UploadFileインスタンス
* @param array $arrForm フォーム入力パラメーター配列
* @return array 表示用フォームパラメーター配列
*/
function lfSetViewParam_ConfirmPage(&$objUpFile, &$objDownFile, &$arrForm) {
// カテゴリ表示用
$arrForm['arrCategoryId'] = $arrForm['category_id'];
// hidden に渡す値は serialize する
$arrForm['category_id'] = serialize($arrForm['category_id']);
// 画像ファイル用データ取得
$arrForm['arrFile'] = $objUpFile->getFormFileList(IMAGE_TEMP_URLPATH, IMAGE_SAVE_URLPATH);
// ダウンロード商品実ファイル名取得
$arrForm['down_realfilename'] = $objDownFile->getFormDownFile();
return $arrForm;
}
/**
* 縮小した画像をセットする
*
* @param object $objUpFile SC_UploadFileインスタンス
* @param string $image_key 画像ファイルキー
* @return void
*/
function lfSetScaleImage(&$objUpFile, $image_key) {
$subno = str_replace('sub_large_image', '', $image_key);
switch ($image_key) {
case 'main_large_image':
// 詳細メイン画像
$this->lfMakeScaleImage($objUpFile, $image_key, 'main_image');
case 'main_image':
// 一覧メイン画像
$this->lfMakeScaleImage($objUpFile, $image_key, 'main_list_image');
break;
case 'sub_large_image' . $subno:
// サブメイン画像
$this->lfMakeScaleImage($objUpFile, $_POST['image_key'], 'sub_image' . $subno);
break;
default:
break;
}
}
/**
* 画像ファイルのコピー
*
* @param object $objUpFile SC_UploadFileインスタンス
* @return void
*/
function lfCopyProductImageFiles(&$objUpFile) {
$arrKey = $objUpFile->keyname;
$arrSaveFile = $objUpFile->save_file;
foreach ($arrSaveFile as $key => $val) {
$this->lfMakeScaleImage($objUpFile, $arrKey[$key], $arrKey[$key], true);
}
}
/**
* 縮小画像生成
*
* @param object $objUpFile SC_UploadFileインスタンス
* @param string $from_key 元画像ファイルキー
* @param string $to_key 縮小画像ファイルキー
* @param boolean $forced
* @return void
*/
function lfMakeScaleImage(&$objUpFile, $from_key, $to_key, $forced = false) {
$arrImageKey = array_flip($objUpFile->keyname);
$from_path = '';
if ($objUpFile->temp_file[$arrImageKey[$from_key]]) {
$from_path = $objUpFile->temp_dir . $objUpFile->temp_file[$arrImageKey[$from_key]];
} elseif ($objUpFile->save_file[$arrImageKey[$from_key]]) {
$from_path = $objUpFile->save_dir . $objUpFile->save_file[$arrImageKey[$from_key]];
}
if (file_exists($from_path)) {
// 生成先の画像サイズを取得
$to_w = $objUpFile->width[$arrImageKey[$to_key]];
$to_h = $objUpFile->height[$arrImageKey[$to_key]];
if ($forced) {
$objUpFile->save_file[$arrImageKey[$to_key]] = '';
}
if (empty($objUpFile->temp_file[$arrImageKey[$to_key]])
&& empty($objUpFile->save_file[$arrImageKey[$to_key]])
) {
// リネームする際は、自動生成される画像名に一意となるように、Suffixを付ける
$dst_file = $objUpFile->lfGetTmpImageName(IMAGE_RENAME, '', $objUpFile->temp_file[$arrImageKey[$from_key]]) . $this->lfGetAddSuffix($to_key);
$path = $objUpFile->makeThumb($from_path, $to_w, $to_h, $dst_file);
$objUpFile->temp_file[$arrImageKey[$to_key]] = basename($path);
}
}
}
/**
* アップロードファイルパラメーター情報から削除
* 一時ディレクトリに保存されている実ファイルも削除する
*
* @param object $objUpFile SC_UploadFileインスタンス
* @param string $image_key 画像ファイルキー
* @return void
*/
function lfDeleteTempFile(&$objUpFile, $image_key) {
// TODO: SC_UploadFile::deleteFileの画像削除条件見直し要
$arrTempFile = $objUpFile->temp_file;
$arrKeyName = $objUpFile->keyname;
foreach ($arrKeyName as $key => $keyname) {
if ($keyname != $image_key) continue;
if (!empty($arrTempFile[$key])) {
$temp_file = $arrTempFile[$key];
$arrTempFile[$key] = '';
if (!in_array($temp_file, $arrTempFile)) {
$objUpFile->deleteFile($image_key);
} else {
$objUpFile->temp_file[$key] = '';
$objUpFile->save_file[$key] = '';
}
} else {
$objUpFile->temp_file[$key] = '';
$objUpFile->save_file[$key] = '';
}
}
}
/**
* アップロードファイルを保存する
*
* @param object $objUpFile SC_UploadFileインスタンス
* @param object $objDownFile SC_UploadFileインスタンス
* @param integer $product_id 商品ID
* @return void
*/
function lfSaveUploadFiles(&$objUpFile, &$objDownFile, $product_id) {
// TODO: SC_UploadFile::moveTempFileの画像削除条件見直し要
$objImage = new SC_Image_Ex($objUpFile->temp_dir);
$arrKeyName = $objUpFile->keyname;
$arrTempFile = $objUpFile->temp_file;
$arrSaveFile = $objUpFile->save_file;
$arrImageKey = array();
foreach ($arrTempFile as $key => $temp_file) {
if ($temp_file) {
$objImage->moveTempImage($temp_file, $objUpFile->save_dir);
$arrImageKey[] = $arrKeyName[$key];
if (!empty($arrSaveFile[$key])
&& !$this->lfHasSameProductImage($product_id, $arrImageKey, $arrSaveFile[$key])
&& !in_array($temp_file, $arrSaveFile)
) {
$objImage->deleteImage($arrSaveFile[$key], $objUpFile->save_dir);
}
}
}
$objDownFile->moveTempDownFile();
}
/**
* 同名画像ファイル登録の有無を確認する.
*
* 画像ファイルの削除可否判定用。
* 同名ファイルの登録がある場合には画像ファイルの削除を行わない。
* 戻り値: 同名ファイル有り(true) 同名ファイル無し(false)
*
* @param string $product_id 商品ID
* @param string $arrImageKey 対象としない画像カラム名
* @param string $image_file_name 画像ファイル名
* @return boolean
*/
function lfHasSameProductImage($product_id, $arrImageKey, $image_file_name) {
if (!SC_Utils_Ex::sfIsInt($product_id)) return false;
if (!$arrImageKey) return false;
if (!$image_file_name) return false;
$arrWhere = array();
$sqlval = array('0', $product_id);
foreach ($arrImageKey as $image_key) {
$arrWhere[] = "{$image_key} = ?";
$sqlval[] = $image_file_name;
}
$where = implode(' OR ', $arrWhere);
$where = "del_flg = ? AND ((product_id <> ? AND ({$where}))";
$arrKeyName = $this->objUpFile->keyname;
foreach ($arrKeyName as $key => $keyname) {
if (in_array($keyname, $arrImageKey)) continue;
$where .= " OR {$keyname} = ?";
$sqlval[] = $image_file_name;
}
$where .= ')';
$objQuery =& SC_Query_Ex::getSingletonInstance();
$exists = $objQuery->exists('dtb_products', $where, $sqlval);
return $exists;
}
/**
* DBから商品データを取得する
*
* @param integer $product_id 商品ID
* @return array 商品データ配列
*/
function lfGetProductData_FromDB($product_id) {
$objQuery =& SC_Query_Ex::getSingletonInstance();
$arrProduct = array();
// 商品データ取得
$col = '*';
$table = <<< __EOF__
dtb_products AS T1
LEFT JOIN (
SELECT product_id AS product_id_sub,
product_code,
price01,
price02,
deliv_fee,
stock,
stock_unlimited,
sale_limit,
point_rate,
product_type_id,
down_filename,
down_realfilename
FROM dtb_products_class
) AS T2
ON T1.product_id = T2.product_id_sub
__EOF__;
$where = 'product_id = ?';
$objQuery->setLimit('1');
$arrProduct = $objQuery->select($col, $table, $where, array($product_id));
// カテゴリID取得
$col = 'category_id';
$table = 'dtb_product_categories';
$where = 'product_id = ?';
$objQuery->setOption('');
$arrProduct[0]['category_id'] = $objQuery->getCol($col, $table, $where, array($product_id));
// 規格情報ありなしフラグ取得
$objDb = new SC_Helper_DB_Ex();
$arrProduct[0]['has_product_class'] = $objDb->sfHasProductClass($product_id);
// 規格が登録されていなければ規格ID取得
if ($arrProduct[0]['has_product_class'] == false) {
$arrProduct[0]['product_class_id'] = SC_Utils_Ex::sfGetProductClassId($product_id,'0','0');
}
// 商品ステータス取得
$objProduct = new SC_Product_Ex();
$productStatus = $objProduct->getProductStatus(array($product_id));
$arrProduct[0]['product_status'] = $productStatus[$product_id];
// 関連商品データ取得
$arrRecommend = $this->lfGetRecommendProductsData_FromDB($product_id);
$arrProduct[0] = array_merge($arrProduct[0], $arrRecommend);
return $arrProduct[0];
}
/**
* DBから関連商品データを取得する
*
* @param integer $product_id 商品ID
* @return array 関連商品データ配列
*/
function lfGetRecommendProductsData_FromDB($product_id) {
$objQuery =& SC_Query_Ex::getSingletonInstance();
$arrRecommendProducts = array();
$col = 'recommend_product_id,';
$col.= 'comment';
$table = 'dtb_recommend_products';
$where = 'product_id = ?';
$objQuery->setOrder('rank DESC');
$arrRet = $objQuery->select($col, $table, $where, array($product_id));
$no = 1;
foreach ($arrRet as $arrVal) {
$arrRecommendProducts['recommend_id' . $no] = $arrVal['recommend_product_id'];
$arrRecommendProducts['recommend_comment' . $no] = $arrVal['comment'];
$no++;
}
return $arrRecommendProducts;
}
/**
* 関連商品データ表示用配列を取得する
*
* @param string $arrForm フォーム入力パラメーター配列
* @return array 関連商品データ配列
*/
function lfGetRecommendProducts(&$arrForm) {
$arrRecommend = array();
for ($i = 1; $i <= RECOMMEND_PRODUCT_MAX; $i++) {
$keyname = 'recommend_id' . $i;
$delkey = 'recommend_delete' . $i;
$commentkey = 'recommend_comment' . $i;
if (!isset($arrForm[$delkey])) $arrForm[$delkey] = null;
if ((isset($arrForm[$keyname]) && !empty($arrForm[$keyname])) && $arrForm[$delkey] != 1) {
$objProduct = new SC_Product_Ex();
$arrRecommend[$i] = $objProduct->getDetail($arrForm[$keyname]);
$arrRecommend[$i]['product_id'] = $arrForm[$keyname];
$arrRecommend[$i]['comment'] = $arrForm[$commentkey];
}
}
return $arrRecommend;
}
/**
* 表示用カテゴリマスターデータ配列を取得する
* - 編集モード
*
* @param void
* @return array カテゴリマスターデータ配列
*/
function lfGetCategoryList_Edit() {
$objDb = new SC_Helper_DB_Ex();
$arrCategoryList = array();
list($arrCatVal, $arrCatOut) = $objDb->sfGetLevelCatList(false);
for ($i = 0; $i < count($arrCatVal); $i++) {
$arrCategoryList[$arrCatVal[$i]] = $arrCatOut[$i];
}
return $arrCategoryList;
}
/**
* 入力フォームパラメーターの規格ありなしフラグを判定
*
* @param string $has_product_class 入力フォームパラメーターの規格ありなしフラグ
* @return boolean true: 規格あり, false: 規格なし
*/
function lfGetProductClassFlag($has_product_class) {
if ($has_product_class == '1') {
return true;
} else {
return false;
}
}
/**
* ページonload用JavaScriptを取得する
* - 入力画面
*
* @param string $anchor_hash アンカー用ハッシュ文字列(省略可)
* @return string ページonload用JavaScript
*/
function lfSetOnloadJavaScript_InputPage($anchor_hash = '') {
return "fnCheckStockLimit('" . DISABLED_RGB . "'); fnMoveSelect('category_id_unselect', 'category_id');" . $anchor_hash;
}
/**
* DBに商品データを登録する
*
* @param object $objUpFile SC_UploadFileインスタンス
* @param object $objDownFile SC_UploadFileインスタンス
* @param array $arrList フォーム入力パラメーター配列
* @return integer 登録商品ID
*/
function lfRegistProduct(&$objUpFile, &$objDownFile, $arrList) {
$objQuery =& SC_Query_Ex::getSingletonInstance();
$objDb = new SC_Helper_DB_Ex();
// 配列の添字を定義
$checkArray = array('name', 'status',
'main_list_comment', 'main_comment',
'deliv_fee', 'comment1', 'comment2', 'comment3',
'comment4', 'comment5', 'comment6',
'sale_limit', 'deliv_date_id', 'maker_id', 'note',
'putting_name_flg', 'puttin_name_price');
$arrList = SC_Utils_Ex::arrayDefineIndexes($arrList, $checkArray);
// INSERTする値を作成する。
$sqlval['name'] = $arrList['name'];
$sqlval['status'] = $arrList['status'];
$sqlval['main_list_comment'] = $arrList['main_list_comment'];
$sqlval['main_comment'] = $arrList['main_comment'];
$sqlval['comment1'] = $arrList['comment1'];
$sqlval['comment2'] = $arrList['comment2'];
$sqlval['comment3'] = $arrList['comment3'];
$sqlval['comment4'] = $arrList['comment4'];
$sqlval['comment5'] = $arrList['comment5'];
$sqlval['comment6'] = $arrList['comment6'];
$sqlval['putting_name_flg'] = $arrList['putting_name_flg'];
$sqlval['putting_name_price'] = $arrList['putting_name_price'];
$sqlval['deliv_date_id'] = $arrList['deliv_date_id'];
$sqlval['maker_id'] = $arrList['maker_id'];
$sqlval['note'] = $arrList['note'];
$sqlval['update_date'] = 'CURRENT_TIMESTAMP';
$sqlval['creator_id'] = $_SESSION['member_id'];
$arrRet = $objUpFile->getDBFileList();
$sqlval = array_merge($sqlval, $arrRet);
for ($cnt = 1; $cnt <= PRODUCTSUB_MAX; $cnt++) {
$sqlval['sub_title'.$cnt] = $arrList['sub_title'.$cnt];
$sqlval['sub_comment'.$cnt] = $arrList['sub_comment'.$cnt];
}
$objQuery->begin();
// 新規登録(複製時を含む)
if ($arrList['product_id'] == '') {
$product_id = $objQuery->nextVal('dtb_products_product_id');
$sqlval['product_id'] = $product_id;
// INSERTの実行
$sqlval['create_date'] = 'CURRENT_TIMESTAMP';
$objQuery->insert('dtb_products', $sqlval);
$arrList['product_id'] = $product_id;
// カテゴリを更新
$objDb->updateProductCategories($arrList['category_id'], $product_id);
// 複製商品の場合には規格も複製する
if ($arrList['copy_product_id'] != '' && SC_Utils_Ex::sfIsInt($arrList['copy_product_id'])) {
if ($this->lfGetProductClassFlag($arrList['has_product_class']) == false) {
//規格なしの場合、複製は価格等の入力が発生しているため、その内容で追加登録を行う
$this->lfCopyProductClass($arrList, $objQuery);
} else {
//規格がある場合の複製は複製元の内容で追加登録を行う
// dtb_products_class のカラムを取得
$dbFactory = SC_DB_DBFactory_Ex::getInstance();
$arrColList = $objQuery->listTableFields('dtb_products_class');
$arrColList_tmp = array_flip($arrColList);
// 複製しない列
unset($arrColList[$arrColList_tmp['product_class_id']]); //規格ID
unset($arrColList[$arrColList_tmp['product_id']]); //商品ID
unset($arrColList[$arrColList_tmp['create_date']]);
// 複製元商品の規格データ取得
$col = SC_Utils_Ex::sfGetCommaList($arrColList);
$table = 'dtb_products_class';
$where = 'product_id = ?';
$objQuery->setOrder('product_class_id');
$arrProductsClass = $objQuery->select($col, $table, $where, array($arrList['copy_product_id']));
// 規格データ登録
$objQuery =& SC_Query_Ex::getSingletonInstance();
foreach ($arrProductsClass as $arrData) {
$sqlval = $arrData;
$sqlval['product_class_id'] = $objQuery->nextVal('dtb_products_class_product_class_id');
$sqlval['deliv_fee'] = $arrList['deliv_fee'];
$sqlval['point_rate'] = $arrList['point_rate'];
$sqlval['sale_limit'] = $arrList['sale_limit'];
$sqlval['product_id'] = $product_id;
$sqlval['create_date'] = 'CURRENT_TIMESTAMP';
$sqlval['update_date'] = 'CURRENT_TIMESTAMP';
$objQuery->insert($table, $sqlval);
}
}
}
// 更新
} else {
$product_id = $arrList['product_id'];
// 削除要求のあった既存ファイルの削除
$arrRet = $this->lfGetProductData_FromDB($arrList['product_id']);
// TODO: SC_UploadFile::deleteDBFileの画像削除条件見直し要
$objImage = new SC_Image_Ex($objUpFile->temp_dir);
$arrKeyName = $objUpFile->keyname;
$arrSaveFile = $objUpFile->save_file;
$arrImageKey = array();
foreach ($arrKeyName as $key => $keyname) {
if ($arrRet[$keyname] && !$arrSaveFile[$key]) {
$arrImageKey[] = $keyname;
$has_same_image = $this->lfHasSameProductImage($arrList['product_id'], $arrImageKey, $arrRet[$keyname]);
if (!$has_same_image) {
$objImage->deleteImage($arrRet[$keyname], $objUpFile->save_dir);
}
}
}
$objDownFile->deleteDBDownFile($arrRet);
// UPDATEの実行
$where = 'product_id = ?';
$objQuery->update('dtb_products', $sqlval, $where, array($product_id));
// カテゴリを更新
$objDb->updateProductCategories($arrList['category_id'], $product_id);
}
// 商品登録の時は規格を生成する。複製の場合は規格も複製されるのでこの処理は不要。
if ($arrList['copy_product_id'] == '') {
// 規格登録
if ($objDb->sfHasProductClass($product_id)) {
// 規格あり商品(商品規格テーブルのうち、商品登録フォームで設定するパラメーターのみ更新)
$this->lfUpdateProductClass($arrList);
} else {
// 規格なし商品(商品規格テーブルの更新)
$this->lfInsertDummyProductClass($arrList);
}
}
// 商品ステータス設定
$objProduct = new SC_Product_Ex();
$objProduct->setProductStatus($product_id, $arrList['product_status']);
// 関連商品登録
$this->lfInsertRecommendProducts($objQuery, $arrList, $product_id);
$objQuery->commit();
return $product_id;
}
/**
* 規格を設定していない商品を商品規格テーブルに登録
*
* @param array $arrList
* @return void
*/
function lfInsertDummyProductClass($arrList) {
$objQuery =& SC_Query_Ex::getSingletonInstance();
$objDb = new SC_Helper_DB_Ex();
// 配列の添字を定義
$checkArray = array('product_class_id', 'product_id', 'product_code', 'stock', 'stock_unlimited', 'price01', 'price02', 'sale_limit', 'deliv_fee', 'point_rate' ,'product_type_id', 'down_filename', 'down_realfilename');
$sqlval = SC_Utils_Ex::sfArrayIntersectKeys($arrList, $checkArray);
$sqlval = SC_Utils_Ex::arrayDefineIndexes($sqlval, $checkArray);
$sqlval['stock_unlimited'] = $sqlval['stock_unlimited'] ? UNLIMITED_FLG_UNLIMITED : UNLIMITED_FLG_LIMITED;
$sqlval['creator_id'] = strlen($_SESSION['member_id']) >= 1 ? $_SESSION['member_id'] : '0';
if (strlen($sqlval['product_class_id']) == 0) {
$sqlval['product_class_id'] = $objQuery->nextVal('dtb_products_class_product_class_id');
$sqlval['create_date'] = 'CURRENT_TIMESTAMP';
$sqlval['update_date'] = 'CURRENT_TIMESTAMP';
// INSERTの実行
$objQuery->insert('dtb_products_class', $sqlval);
} else {
$sqlval['update_date'] = 'CURRENT_TIMESTAMP';
// UPDATEの実行
$objQuery->update('dtb_products_class', $sqlval, 'product_class_id = ?', array($sqlval['product_class_id']));
}
}
/**
* 規格を設定している商品の商品規格テーブルを更新
* (deliv_fee, point_rate, sale_limit)
*
* @param array $arrList
* @return void
*/
function lfUpdateProductClass($arrList) {
$objQuery =& SC_Query_Ex::getSingletonInstance();
$sqlval = array();
$sqlval['deliv_fee'] = $arrList['deliv_fee'];
$sqlval['point_rate'] = $arrList['point_rate'];
$sqlval['sale_limit'] = $arrList['sale_limit'];
$where = 'product_id = ?';
$objQuery->update('dtb_products_class', $sqlval, $where, array($arrList['product_id']));
}
/**
* DBに関連商品データを登録する
*
* @param object $objQuery SC_Queryインスタンス
* @param string $arrList フォーム入力パラメーター配列
* @param integer $product_id 登録する商品ID
* @return void
*/
function lfInsertRecommendProducts(&$objQuery, $arrList, $product_id) {
// 一旦関連商品をすべて削除する
$objQuery->delete('dtb_recommend_products', 'product_id = ?', array($product_id));
$sqlval['product_id'] = $product_id;
$rank = RECOMMEND_PRODUCT_MAX;
for ($i = 1; $i <= RECOMMEND_PRODUCT_MAX; $i++) {
$keyname = 'recommend_id' . $i;
$commentkey = 'recommend_comment' . $i;
$deletekey = 'recommend_delete' . $i;
if (!isset($arrList[$deletekey])) $arrList[$deletekey] = null;
if ($arrList[$keyname] != '' && $arrList[$deletekey] != '1') {
$sqlval['recommend_product_id'] = $arrList[$keyname];
$sqlval['comment'] = $arrList[$commentkey];
$sqlval['rank'] = $rank;
$sqlval['creator_id'] = $_SESSION['member_id'];
$sqlval['create_date'] = 'CURRENT_TIMESTAMP';
$sqlval['update_date'] = 'CURRENT_TIMESTAMP';
$objQuery->insert('dtb_recommend_products', $sqlval);
$rank--;
}
}
}
/**
* 規格データをコピーする
*
* @param array $arrList フォーム入力パラメーター配列
* @param object $objQuery SC_Queryインスタンス
* @return boolean エラーフラグ
*/
function lfCopyProductClass($arrList, &$objQuery) {
// 複製元のdtb_products_classを取得(規格なしのため、1件のみの取得)
$col = '*';
$table = 'dtb_products_class';
$where = 'product_id = ?';
$arrProductClass = $objQuery->select($col, $table, $where, array($arrList['copy_product_id']));
//トランザクション開始
$objQuery->begin();
$err_flag = false;
//非編集項目は複製、編集項目は上書きして登録
foreach ($arrProductClass as $records) {
foreach ($records as $key => $value) {
if (isset($arrList[$key])) {
switch ($key) {
case 'stock_unlimited':
$records[$key] = (int)$arrList[$key];
break;
default:
$records[$key] = $arrList[$key];
break;
}
}
}
$records['product_class_id'] = $objQuery->nextVal('dtb_products_class_product_class_id');
$records['update_date'] = 'CURRENT_TIMESTAMP';
$records['create_date'] = 'CURRENT_TIMESTAMP';
$objQuery->insert($table, $records);
//エラー発生時は中断
if ($objQuery->isError()) {
$err_flag = true;
continue;
}
}
//トランザクション終了
if ($err_flag) {
$objQuery->rollback();
} else {
$objQuery->commit();
}
return !$err_flag;
}
/**
* リネームする際は、自動生成される画像名に一意となるように、Suffixを付ける
*
* @param string $to_key
* @return string
*/
function lfGetAddSuffix($to_key) {
if ( IMAGE_RENAME === true) return;
// 自動生成される画像名
$dist_name = '';
switch ($to_key) {
case 'main_list_image':
$dist_name = '_s';
break;
case 'main_image':
$dist_name = '_m';
break;
default:
$arrRet = explode('sub_image', $to_key);
$dist_name = '_sub' .$arrRet[1];
break;
}
return $dist_name;
}
/**
* サブ情報の登録があるかを取得する
* タイトル, コメント, 画像のいずれかに登録があれば「あり」と判定する
*
* @param array $arrSubProductData サブ情報配列
* @return boolean true: サブ情報あり, false: サブ情報なし
*/
function hasSubProductData($arrSubProductData) {
$has_subproduct_data = false;
for ($i = 1; $i <= PRODUCTSUB_MAX; $i++) {
if (SC_Utils_Ex::isBlank($arrSubProductData['sub_title'.$i]) == false
|| SC_Utils_Ex::isBlank($arrSubProductData['sub_comment'.$i]) == false
|| SC_Utils_Ex::isBlank($arrSubProductData['sub_image'.$i]) == false
|| SC_Utils_Ex::isBlank($arrSubProductData['sub_large_image'.$i]) == false
|| SC_Utils_Ex::isBlank($arrSubProductData['temp_sub_image'.$i]) == false
|| SC_Utils_Ex::isBlank($arrSubProductData['temp_sub_large_image'.$i]) == false
) {
$has_subproduct_data = true;
break;
}
}
return $has_subproduct_data;
}
/**
* アンカーハッシュ文字列を取得する
* アンカーキーをサニタイジングする
*
* @param string $anchor_key フォーム入力パラメーターで受け取ったアンカーキー
* @return <type>
*/
function getAnchorHash($anchor_key) {
if ($anchor_key != '') {
return "location.hash='#" . htmlspecialchars($anchor_key) . "'";
} else {
return '';
}
}
}
<?php
/* data/class/SC_CartSession.php
* This file is part of EC-CUBE
*
* Copyright(c) 2000-2012 LOCKON CO.,LTD. All Rights Reserved.
*
* http://www.lockon.co.jp/
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/**
* カートセッション管理クラス
*
* @author LOCKON CO.,LTD.
* @version $Id$
*/
class SC_CartSession {
/** ユニークIDを指定する. */
var $key_tmp;
/** カートのセッション変数. */
var $cartSession;
/* コンストラクタ */
function __construct($cartKey = 'cart') {
if (!isset($_SESSION[$cartKey])) {
$_SESSION[$cartKey] = array();
}
$this->cartSession =& $_SESSION[$cartKey];
}
// 商品購入処理中のロック
function saveCurrentCart($key_tmp, $productTypeId) {
$this->key_tmp = 'savecart_' . $key_tmp;
// すでに情報がなければ現状のカート情報を記録しておく
if (count($_SESSION[$this->key_tmp]) == 0) {
$_SESSION[$this->key_tmp] = $this->cartSession[$productTypeId];
}
// 1世代古いコピー情報は、削除しておく
foreach ($_SESSION as $key => $value) {
if ($key != $this->key_tmp && preg_match('/^savecart_/', $key)) {
unset($_SESSION[$key]);
}
}
}
// 商品購入中の変更があったかをチェックする。
function getCancelPurchase($productTypeId) {
$ret = isset($this->cartSession[$productTypeId]['cancel_purchase'])
? $this->cartSession[$productTypeId]['cancel_purchase'] : '';
$this->cartSession[$productTypeId]['cancel_purchase'] = false;
return $ret;
}
// 購入処理中に商品に変更がなかったかを判定
function checkChangeCart($productTypeId) {
$change = false;
$max = $this->getMax($productTypeId);
for ($i = 1; $i <= $max; $i++) {
if ($this->cartSession[$productTypeId][$i]['quantity']
!= $_SESSION[$this->key_tmp][$i]['quantity']) {
$change = true;
break;
}
if ($this->cartSession[$productTypeId][$i]['id']
!= $_SESSION[$this->key_tmp][$i]['id']) {
$change = true;
break;
}
}
if ($change) {
// 一時カートのクリア
unset($_SESSION[$this->key_tmp]);
$this->cartSession[$productTypeId]['cancel_purchase'] = true;
} else {
$this->cartSession[$productTypeId]['cancel_purchase'] = false;
}
return $this->cartSession[$productTypeId]['cancel_purchase'];
}
// 次に割り当てるカートのIDを取得する
function getNextCartID($productTypeId) {
$count = array();
foreach ($this->cartSession[$productTypeId] as $key => $value) {
$count[] = $this->cartSession[$productTypeId][$key]['cart_no'];
}
return max($count) + 1;
}
/**
* 商品ごとの合計価格
* XXX 実際には、「商品」ではなく、「カートの明細行(≒商品規格)」のような気がします。
*
* @param integer $id
* @return string 商品ごとの合計価格(税込み)
* @deprecated SC_CartSession::getCartList() を使用してください
*/
function getProductTotal($id, $productTypeId) {
$max = $this->getMax($productTypeId);
for ($i = 0; $i <= $max; $i++) {
if (isset($this->cartSession[$productTypeId][$i]['id'])
&& $this->cartSession[$productTypeId][$i]['id'] == $id
) {
// 税込み合計
$price = $this->cartSession[$productTypeId][$i]['price'];
$quantity = $this->cartSession[$productTypeId][$i]['quantity'];
$incTax = SC_Helper_DB_Ex::sfCalcIncTax($price);
$total = $incTax * $quantity;
return $total;
}
}
return 0;
}
// 値のセット
function setProductValue($id, $key, $val, $productTypeId) {
$max = $this->getMax($productTypeId);
for ($i = 0; $i <= $max; $i++) {
if (isset($this->cartSession[$productTypeId][$i]['id'])
&& $this->cartSession[$productTypeId][$i]['id'] == $id
) {
$this->cartSession[$productTypeId][$i][$key] = $val;
}
}
}
// カート内商品の最大要素番号を取得する。
function getMax($productTypeId) {
$max = 0;
if (count($this->cartSession[$productTypeId]) > 0) {
foreach ($this->cartSession[$productTypeId] as $key => $value) {
if (is_numeric($key)) {
if ($max < $key) {
$max = $key;
}
}
}
}
return $max;
}
// カート内商品数量の合計
function getTotalQuantity($productTypeId) {
$total = 0;
$max = $this->getMax($productTypeId);
for ($i = 0; $i <= $max; $i++) {
$total+= $this->cartSession[$productTypeId][$i]['quantity'];
}
return $total;
}
// 全商品の合計価格
function getAllProductsTotal($productTypeId) {
// 税込み合計
$total = 0;
$max = $this->getMax($productTypeId);
for ($i = 0; $i <= $max; $i++) {
if (!isset($this->cartSession[$productTypeId][$i]['price'])) {
$this->cartSession[$productTypeId][$i]['price'] = '';
}
$price = $this->cartSession[$productTypeId][$i]['price'];
if (!isset($this->cartSession[$productTypeId][$i]['quantity'])) {
$this->cartSession[$productTypeId][$i]['quantity'] = '';
}
$quantity = $this->cartSession[$productTypeId][$i]['quantity'];
$incTax = SC_Helper_DB_Ex::sfCalcIncTax($price);
$total+= ($incTax * $quantity);
}
return $total;
}
// 全商品の合計税金
function getAllProductsTax($productTypeId) {
// 税合計
$total = 0;
$max = $this->getMax($productTypeId);
for ($i = 0; $i <= $max; $i++) {
$price = $this->cartSession[$productTypeId][$i]['price'];
$quantity = $this->cartSession[$productTypeId][$i]['quantity'];
$tax = SC_Helper_DB_Ex::sfTax($price);
$total+= ($tax * $quantity);
}
return $total;
}
// 全商品の合計ポイント
function getAllProductsPoint($productTypeId) {
// ポイント合計
$total = 0;
if (USE_POINT !== false) {
$max = $this->getMax($productTypeId);
for ($i = 0; $i <= $max; $i++) {
$price = $this->cartSession[$productTypeId][$i]['price'];
$quantity = $this->cartSession[$productTypeId][$i]['quantity'];
if (!isset($this->cartSession[$productTypeId][$i]['point_rate'])) {
$this->cartSession[$productTypeId][$i]['point_rate'] = '';
}
$point_rate = $this->cartSession[$productTypeId][$i]['point_rate'];
if (!isset($this->cartSession[$productTypeId][$i]['id'][0])) {
$this->cartSession[$productTypeId][$i]['id'][0] = '';
}
$point = SC_Utils_Ex::sfPrePoint($price, $point_rate);
$total+= ($point * $quantity);
}
}
return $total;
}
// カートへの商品追加
function addProduct($product_class_id, $quantity) {
$objProduct = new SC_Product_Ex();
$arrProduct = $objProduct->getProductsClass($product_class_id);
$productTypeId = $arrProduct['product_type_id'];
$find = false;
$max = $this->getMax($productTypeId);
for ($i = 0; $i <= $max; $i++) {
if ($this->cartSession[$productTypeId][$i]['id'] == $product_class_id) {
$val = $this->cartSession[$productTypeId][$i]['quantity'] + $quantity;
if (strlen($val) <= INT_LEN) {
$this->cartSession[$productTypeId][$i]['quantity'] += $quantity;
}
$find = true;
}
}
if (!$find) {
$this->cartSession[$productTypeId][$max+1]['id'] = $product_class_id;
$this->cartSession[$productTypeId][$max+1]['quantity'] = $quantity;
$this->cartSession[$productTypeId][$max+1]['cart_no'] = $this->getNextCartID($productTypeId);
}
}
// 前頁のURLを記録しておく
function setPrevURL($url, $excludePaths = array()) {
// 前頁として記録しないページを指定する。
$arrExclude = array(
'/shopping/'
);
$arrExclude = array_merge($arrExclude, $excludePaths);
$exclude = false;
// ページチェックを行う。
foreach ($arrExclude as $val) {
if (preg_match('|' . preg_quote($val) . '|', $url)) {
$exclude = true;
break;
}
}
// 除外ページでない場合は、前頁として記録する。
if (!$exclude) {
$_SESSION['prev_url'] = $url;
}
}
// 前頁のURLを取得する
function getPrevURL() {
return isset($_SESSION['prev_url']) ? $_SESSION['prev_url'] : '';
}
// キーが一致した商品の削除
function delProductKey($keyname, $val, $productTypeId) {
$max = count($this->cartSession[$productTypeId]);
for ($i = 0; $i < $max; $i++) {
if ($this->cartSession[$productTypeId][$i][$keyname] == $val) {
unset($this->cartSession[$productTypeId][$i]);
}
}
}
function setValue($key, $val, $productTypeId) {
$this->cartSession[$productTypeId][$key] = $val;
}
function getValue($key, $productTypeId) {
return $this->cartSession[$productTypeId][$key];
}
/**
* セッション中の商品情報データの調整。
* productsClass項目から、不必要な項目を削除する。
*/
function adjustSessionProductsClass(&$arrProductsClass) {
$arrNecessaryItems = array(
'product_id' => true,
'product_class_id' => true,
'name' => true,
'price02' => true,
'point_rate' => true,
'main_list_image' => true,
'main_image' => true,
'product_code' => true,
'stock' => true,
'stock_unlimited' => true,
'sale_limit' => true,
'class_name1' => true,
'classcategory_name1' => true,
'class_name2' => true,
'classcategory_name2' => true,
'putting_name_flg' => true,
);
// 必要な項目以外を削除。
foreach ($arrProductsClass as $key => $value) {
if (!isset($arrNecessaryItems[$key])) {
unset($arrProductsClass[$key]);
}
}
}
/**
* 商品種別ごとにカート内商品の一覧を取得する.
*
* @param integer $productTypeId 商品種別ID
* @return array カート内商品一覧の配列
*/
function getCartList($productTypeId) {
$objProduct = new SC_Product_Ex();
$max = $this->getMax($productTypeId);
$arrRet = array();
for ($i = 0; $i <= $max; $i++) {
if (isset($this->cartSession[$productTypeId][$i]['cart_no'])
&& $this->cartSession[$productTypeId][$i]['cart_no'] != '') {
// 商品情報は常に取得
// TODO 同一インスタンス内では1回のみ呼ぶようにしたい
$this->cartSession[$productTypeId][$i]['productsClass']
=& $objProduct->getDetailAndProductsClass($this->cartSession[$productTypeId][$i]['id']);
$price = $this->cartSession[$productTypeId][$i]['productsClass']['price02'];
// 名入れ対応の場合は加算
if ($this->cartSession[$productTypeId][$i]['productsClass']['putting_name_flg'] == '1') {
$price += $this->cartSession[$productTypeId][$i]['productsClass']['putting_name_price'];
}
$this->cartSession[$productTypeId][$i]['price'] = $price;
$this->cartSession[$productTypeId][$i]['point_rate']
= $this->cartSession[$productTypeId][$i]['productsClass']['point_rate'];
$quantity = $this->cartSession[$productTypeId][$i]['quantity'];
$incTax = SC_Helper_DB_Ex::sfCalcIncTax($price);
$total = $incTax * $quantity;
$this->cartSession[$productTypeId][$i]['total_inctax'] = $total;
$arrRet[] = $this->cartSession[$productTypeId][$i];
// セッション変数のデータ量を抑制するため、一部の商品情報を切り捨てる
// XXX 上で「常に取得」するのだから、丸ごと切り捨てて良さそうにも感じる。
$this->adjustSessionProductsClass($this->cartSession[$productTypeId][$i]['productsClass']);
}
}
return $arrRet;
}
/**
* すべてのカートの内容を取得する.
*
* @return array すべてのカートの内容
*/
function getAllCartList() {
$results = array();
$cartKeys = $this->getKeys();
$i = 0;
foreach ($cartKeys as $key) {
$cartItems = $this->getCartList($key);
foreach ($cartItems as $itemKey => $itemValue) {
$cartItem =& $cartItems[$itemKey];
$results[$key][$i] =& $cartItem;
$i++;
}
}
return $results;
}
/**
* @deprected getAllProductClassID を使用して下さい
*/
function getAllProductID($productTypeId) {
trigger_error('正しく動作しないメソッドが呼び出されました。', E_USER_ERROR);
}
/**
* カート内にある商品規格IDを全て取得する.
*
* @param integer $productTypeId 商品種別ID
* @return array 商品規格ID の配列
*/
function getAllProductClassID($productTypeId) {
$max = $this->getMax($productTypeId);
$productClassIDs = array();
for ($i = 0; $i <= $max; $i++) {
if ($this->cartSession[$productTypeId][$i]['cart_no'] != '') {
$productClassIDs[] = $this->cartSession[$productTypeId][$i]['id'];
}
}
return $productClassIDs;
}
/**
* 商品種別ID を指定して, カート内の商品をすべて削除する.
*
* @param integer $productTypeId 商品種別ID
* @return void
*/
function delAllProducts($productTypeId) {
$max = $this->getMax($productTypeId);
for ($i = 0; $i <= $max; $i++) {
unset($this->cartSession[$productTypeId][$i]);
}
}
// 商品の削除
function delProduct($cart_no, $productTypeId) {
$max = $this->getMax($productTypeId);
for ($i = 0; $i <= $max; $i++) {
if ($this->cartSession[$productTypeId][$i]['cart_no'] == $cart_no) {
unset($this->cartSession[$productTypeId][$i]);
}
}
}
// 数量の増加
function upQuantity($cart_no, $productTypeId) {
$quantity = $this->getQuantity($cart_no, $productTypeId);
if (strlen($quantity + 1) <= INT_LEN) {
$this->setQuantity($quantity + 1, $cart_no, $productTypeId);
}
}
// 数量の減少
function downQuantity($cart_no, $productTypeId) {
$quantity = $this->getQuantity($cart_no, $productTypeId);
if ($quantity > 1) {
$this->setQuantity($quantity - 1, $cart_no, $productTypeId);
}
}
/**
* カート番号と商品種別IDを指定して, 数量を取得する.
*
* @param integer $cart_no カート番号
* @param integer $productTypeId 商品種別ID
* @return integer 該当商品規格の数量
*/
function getQuantity($cart_no, $productTypeId) {
$max = $this->getMax($productTypeId);
for ($i = 0; $i <= $max; $i++) {
if ($this->cartSession[$productTypeId][$i]['cart_no'] == $cart_no) {
return $this->cartSession[$productTypeId][$i]['quantity'];
}
}
}
/**
* カート番号と商品種別IDを指定して, 数量を設定する.
*
* @param integer $quantity 設定する数量
* @param integer $cart_no カート番号
* @param integer $productTypeId 商品種別ID
* @retrun void
*/
function setQuantity($quantity, $cart_no, $productTypeId) {
$max = $this->getMax($productTypeId);
for ($i = 0; $i <= $max; $i++) {
if ($this->cartSession[$productTypeId][$i]['cart_no'] == $cart_no) {
$this->cartSession[$productTypeId][$i]['quantity'] = $quantity;
}
}
}
/**
* カート番号と商品種別IDを指定して, 商品規格IDを取得する.
*
* @param integer $cart_no カート番号
* @param integer $productTypeId 商品種別ID
* @return integer 商品規格ID
*/
function getProductClassId($cart_no, $productTypeId) {
for ($i = 0; $i < count($this->cartSession[$productTypeId]); $i++) {
if ($this->cartSession[$productTypeId][$i]['cart_no'] == $cart_no) {
return $this->cartSession[$productTypeId][$i]['id'];
}
}
}
/**
* カート内の商品の妥当性をチェックする.
*
* エラーが発生した場合は, 商品をカート内から削除又は数量を調整し,
* エラーメッセージを返す.
*
* 1. 商品種別に関連づけられた配送業者の存在チェック
* 2. 削除/非表示商品のチェック
* 3. 販売制限数のチェック
* 4. 在庫数チェック
*
* @param string $productTypeId 商品種別ID
* @return string エラーが発生した場合はエラーメッセージ
*/
function checkProducts($productTypeId) {
$objProduct = new SC_Product_Ex();
$tpl_message = '';
// カート内の情報を取得
$arrItems = $this->getCartList($productTypeId);
foreach ($arrItems as &$arrItem) {
$product =& $arrItem['productsClass'];
/*
* 表示/非表示商品のチェック
*/
if (SC_Utils_Ex::isBlank($product) || $product['status'] != 1) {
$this->delProduct($arrItem['cart_no'], $productTypeId);
$tpl_message .= "※ 現時点で販売していない商品が含まれておりました。該当商品をカートから削除しました。\n";
} else {
/*
* 配送業者のチェック
*/
$arrDeliv = SC_Helper_Purchase_Ex::getDeliv($productTypeId);
if (SC_Utils_Ex::isBlank($arrDeliv)) {
$tpl_message .= '※「' . $product['name'] . '」はまだ配送の準備ができておりません。';
$tpl_message .= '恐れ入りますがお問い合わせページよりお問い合わせください。' . "\n";
$this->delProduct($arrItem['cart_no'], $productTypeId);
}
/*
* 販売制限数, 在庫数のチェック
*/
$limit = $objProduct->getBuyLimit($product);
if (!is_null($limit) && $arrItem['quantity'] > $limit) {
if ($limit > 0) {
$this->setProductValue($arrItem['id'], 'quantity', $limit, $productTypeId);
$total_inctax = SC_Helper_DB_Ex::sfCalcIncTax($arrItem['price']) * $limit;
$this->setProductValue($arrItem['id'], 'total_inctax', $total_inctax, $productTypeId);
$tpl_message .= '※「' . $product['name'] . '」は販売制限(または在庫が不足)しております。';
$tpl_message .= "一度に数量{$limit}を超える購入はできません。\n";
} else {
$this->delProduct($arrItem['cart_no'], $productTypeId);
$tpl_message .= '※「' . $product['name'] . "」は売り切れました。\n";
continue;
}
}
}
}
return $tpl_message;
}
/**
* 送料無料条件を満たすかどうかチェックする
*
* @param integer $productTypeId 商品種別ID
* @return boolean 送料無料の場合 true
*/
function isDelivFree($productTypeId) {
$objDb = new SC_Helper_DB_Ex();
$subtotal = $this->getAllProductsTotal($productTypeId);
// 送料無料の購入数が設定されている場合
if (DELIV_FREE_AMOUNT > 0) {
// 商品の合計数量
$total_quantity = $this->getTotalQuantity($productTypeId);
if ($total_quantity >= DELIV_FREE_AMOUNT) {
return true;
}
}
// 送料無料条件が設定されている場合
$arrInfo = $objDb->sfGetBasisData();
if ($arrInfo['free_rule'] > 0) {
// 小計が送料無料条件以上の場合
if ($subtotal >= $arrInfo['free_rule']) {
return true;
}
}
return false;
}
/**
* カートの内容を計算する.
*
* カートの内容を計算し, 下記のキーを保持する連想配列を返す.
*
* - tax: 税額
* - subtotal: カート内商品の小計
* - deliv_fee: カート内商品の合計送料
* - total: 合計金額
* - payment_total: お支払い合計
* - add_point: 加算ポイント
*
* @param integer $productTypeId 商品種別ID
* @param SC_Customer $objCustomer ログイン中の SC_Customer インスタンス
* @param integer $use_point 今回使用ポイント
* @param integer|array $deliv_pref 配送先都道府県ID.
複数に配送する場合は都道府県IDの配列
* @param integer $charge 手数料
* @param integer $discount 値引き
* @param integer $deliv_id 配送業者ID
* @return array カートの計算結果の配列
*/
function calculate($productTypeId, &$objCustomer, $use_point = 0,
$deliv_pref = '', $charge = 0, $discount = 0, $deliv_id = 0
) {
$results = array();
$total_point = $this->getAllProductsPoint($productTypeId);
$results['tax'] = $this->getAllProductsTax($productTypeId);
$results['subtotal'] = $this->getAllProductsTotal($productTypeId);
$results['deliv_fee'] = 0;
// 商品ごとの送料を加算
if (OPTION_PRODUCT_DELIV_FEE == 1) {
$cartItems = $this->getCartList($productTypeId);
foreach ($cartItems as $arrItem) {
$results['deliv_fee'] += $arrItem['productsClass']['deliv_fee'] * $arrItem['quantity'];
}
}
// 配送業者の送料を加算
if (OPTION_DELIV_FEE == 1
&& !SC_Utils_Ex::isBlank($deliv_pref)
&& !SC_Utils_Ex::isBlank($deliv_id)) {
$results['deliv_fee'] += $this->sfGetDelivFee($deliv_pref, $deliv_id);
}
// 送料無料チェック
if ($this->isDelivFree($productTypeId)) {
$results['deliv_fee'] = 0;
}
// 合計を計算
$results['total'] = $results['subtotal'];
$results['total'] += $results['deliv_fee'];
$results['total'] += $charge;
$results['total'] -= $discount;
// お支払い合計
$results['payment_total'] = $results['total'] - $use_point * POINT_VALUE;
// 加算ポイントの計算
if (USE_POINT !== false) {
$results['add_point'] = SC_Helper_DB_Ex::sfGetAddPoint($total_point, $use_point);
if ($objCustomer != '') {
// 誕生日月であった場合
if ($objCustomer->isBirthMonth()) {
$results['birth_point'] = BIRTH_MONTH_POINT;
$results['add_point'] += $results['birth_point'];
}
}
if ($results['add_point'] < 0) {
$results['add_point'] = 0;
}
}
return $results;
}
/**
* カートが保持するキー(商品種別ID)を配列で返す.
*
* @return array 商品種別IDの配列
*/
function getKeys() {
$keys = array_keys($this->cartSession);
// 数量が 0 の商品種別は削除する
foreach ($keys as $key) {
$quantity = $this->getTotalQuantity($key);
if ($quantity < 1) {
unset($this->cartSession[$key]);
}
}
return array_keys($this->cartSession);
}
/**
* カートに設定された現在のキー(商品種別ID)を登録する.
*
* @param integer $key 商品種別ID
* @return void
*/
function registerKey($key) {
$_SESSION['cartKey'] = $key;
}
/**
* カートに設定された現在のキー(商品種別ID)を削除する.
*
* @return void
*/
function unsetKey() {
unset($_SESSION['cartKey']);
}
/**
* カートに設定された現在のキー(商品種別ID)を取得する.
*
* @return integer 商品種別ID
*/
function getKey() {
return $_SESSION['cartKey'];
}
/**
* 複数商品種別かどうか.
*
* @return boolean カートが複数商品種別の場合 true
*/
function isMultiple() {
return count($this->getKeys()) > 1;
}
/**
* 引数の商品種別の商品がカートに含まれるかどうか.
*
* @param integer $product_type_id 商品種別ID
* @return boolean 指定の商品種別がカートに含まれる場合 true
*/
function hasProductType($product_type_id) {
return in_array($product_type_id, $this->getKeys());
}
/**
* 都道府県から配送料金を取得する.
*
* @param integer|array $pref_id 都道府県ID 又は都道府県IDの配列
* @param integer $deliv_id 配送業者ID
* @return string 指定の都道府県, 配送業者の配送料金
*/
function sfGetDelivFee($pref_id, $deliv_id = 0) {
$objQuery =& SC_Query_Ex::getSingletonInstance();
if (!is_array($pref_id)) {
$pref_id = array($pref_id);
}
$sql = <<< __EOS__
SELECT T1.fee AS fee
FROM dtb_delivfee T1
JOIN dtb_deliv T2
ON T1.deliv_id = T2.deliv_id
WHERE T1.pref = ?
AND T1.deliv_id = ?
AND T2.del_flg = 0
__EOS__;
$result = 0;
foreach ($pref_id as $pref) {
$result += $objQuery->getOne($sql, array($pref, $deliv_id));
}
return $result;
}
/**
* カートの中に名入れ対応商品が含まれるかどうか.
*
* @param integer $productTypeId 商品種別ID
* @return boolean 名入れ対応商品が含まれる場合 true
*/
function hasPuttingNamesoptions($productTypeId) {
$arrItems = $this->getCartList($productTypeId);
foreach ($arrItems as &$arrItem) {
if ($arrItem['productsClass']['putting_name_flg'] == '1') {
return true;
}
}
return false;
}
}
<?php
/* data/class/SC_Product.php
* This file is part of EC-CUBE
*
* Copyright(c) 2000-2012 LOCKON CO.,LTD. All Rights Reserved.
*
* http://www.lockon.co.jp/
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/**
* 商品を扱うサービスクラス.
*
* @author LOCKON CO.,LTD.
* @author Kentaro Ohkouchi
* @version $Id$
*/
class SC_Product {
/** 規格名一覧 */
var $arrClassName;
/** 規格分類名一覧 */
var $arrClassCatName;
/** このプロパティが保持する price01 及び price02 は、税金付与した金額である。 */
var $classCategories = array();
var $stock_find;
/** 規格1クラス名 */
var $className1 = '';
/** 規格2クラス名 */
var $className2 = '';
/** 規格1が設定されている */
var $classCat1_find;
/** 規格2が設定されている */
var $classCat2_find;
var $classCats1;
/** 検索用並び替え条件配列 */
var $arrOrderData;
/**
* 商品検索結果の並び順を指定する。
*
* ただし指定できるテーブルはproduct_idを持っているテーブルであることが必要.
*
* @param string $col 並び替えの基準とするフィールド
* @param string $table 並び替えの基準とするフィールドがあるテーブル
* @param string $order 並び替えの順序 ASC / DESC
* @return void
*/
function setProductsOrder($col, $table = 'dtb_products', $order = 'ASC') {
$this->arrOrderData = array('col' => $col, 'table' => $table, 'order' => $order);
}
/**
* SC_Queryインスタンスに設定された検索条件を元に並び替え済みの検索結果商品IDの配列を取得する。
*
* 検索条件は, SC_Query::setWhere() 関数で設定しておく必要があります.
*
* @param SC_Query $objQuery SC_Query インスタンス
* @param array $arrVal 検索パラメーターの配列
* @return array 商品IDの配列
*/
function findProductIdsOrder(&$objQuery, $arrVal = array()) {
$table = <<< __EOS__
dtb_products AS alldtl
__EOS__;
$objQuery->setGroupBy('alldtl.product_id');
if (is_array($this->arrOrderData) and $objQuery->order == '') {
$o_col = $this->arrOrderData['col'];
$o_table = $this->arrOrderData['table'];
$o_order = $this->arrOrderData['order'];
$order = <<< __EOS__
(
SELECT $o_col
FROM
$o_table as T2
WHERE T2.product_id = alldtl.product_id
ORDER BY T2.$o_col $o_order
LIMIT 1
) $o_order, product_id
__EOS__;
$objQuery->setOrder($order);
}
$results = $objQuery->select('alldtl.product_id', $table, '', $arrVal, MDB2_FETCHMODE_ORDERED);
$resultValues = array();
foreach ($results as $val) {
$resultValues[] = $val[0];
}
return $resultValues;
}
/**
* SC_Queryインスタンスに設定された検索条件をもとに対象商品数を取得する.
*
* 検索条件は, SC_Query::setWhere() 関数で設定しておく必要があります.
*
* @param SC_Query $objQuery SC_Query インスタンス
* @param array $arrVal 検索パラメーターの配列
* @return array 対象商品ID数
*/
function findProductCount(&$objQuery, $arrVal = array()) {
$table = <<< __EOS__
dtb_products AS alldtl
__EOS__;
return $objQuery->count($table, '', $arrVal);
}
/**
* SC_Queryインスタンスに設定された検索条件をもとに商品一覧の配列を取得する.
*
* 主に SC_Product::findProductIds() で取得した商品IDを検索条件にし,
* SC_Query::setOrder() や SC_Query::setLimitOffset() を設定して, 商品一覧
* の配列を取得する.
*
* @param SC_Query $objQuery SC_Query インスタンス
* @return array 商品一覧の配列
*/
function lists(&$objQuery) {
$col = <<< __EOS__
product_id
,product_code_min
,product_code_max
,name
,comment1
,comment2
,comment3
,main_list_comment
,main_image
,main_list_image
,price01_min
,price01_max
,price02_min
,price02_max
,stock_min
,stock_max
,stock_unlimited_min
,stock_unlimited_max
,deliv_date_id
,status
,del_flg
,update_date
,putting_name_flg
,putting_name_price
__EOS__;
$res = $objQuery->select($col, $this->alldtlSQL());
return $res;
}
/**
* 商品IDを指定し、商品一覧を取得する
*
* SC_Query::setOrder() や SC_Query::setLimitOffset() を設定して, 商品一覧
* の配列を取得する.
* FIXME: 呼び出し元で設定した、SC_Query::setWhere() も有効に扱いたい。
*
* @param SC_Query $objQuery SC_Query インスタンス
* @param array $arrProductId 商品ID
* @return array 商品一覧の配列 (キー: 商品ID)
*/
function getListByProductIds(&$objQuery, $arrProductId = array()) {
if (empty($arrProductId)) {
return array();
}
$where = 'alldtl.product_id IN (' . SC_Utils_Ex::repeatStrWithSeparator('?', count($arrProductId)) . ')';
$where .= ' AND alldtl.del_flg = 0';
$objQuery->setWhere($where, $arrProductId);
$arrProducts = $this->lists($objQuery);
// 配列のキーを商品IDに
$arrTmp = array();
foreach ($arrProducts as $arrProduct) {
$arrTmp[$arrProduct['product_id']] = $arrProduct;
}
$arrProducts =& $arrTmp;
unset($arrTmp);
// SC_Query::setOrder() の指定がない場合、$arrProductId で指定された商品IDの順に配列要素を並び替え
if (strlen($objQuery->order) === 0) {
$arrTmp = array();
foreach ($arrProductId as $product_id) {
$arrTmp[$product_id] = $arrProducts[$product_id];
}
$arrProducts =& $arrTmp;
unset($arrTmp);
}
// 税込金額を設定する
SC_Product_Ex::setIncTaxToProducts($arrProducts);
return $arrProducts;
}
/**
* 商品詳細を取得する.
*
* @param integer $productId 商品ID
* @return array 商品詳細情報の配列
*/
function getDetail($productId) {
$objQuery =& SC_Query_Ex::getSingletonInstance();
$arrProduct = $objQuery->getRow('*', $this->alldtlSQL('product_id = ?'),
'product_id = ?',
array($productId, $productId));
$arrProduct = (array)$arrProduct;
// 税込金額を設定する
SC_Product_Ex::setIncTaxToProduct($arrProduct);
return $arrProduct;
}
/**
* 商品詳細情報と商品規格を取得する.
*
* @param integer $productClassId 商品規格ID
* @return array 商品詳細情報と商品規格の配列
*/
function getDetailAndProductsClass($productClassId) {
$result = $this->getProductsClass($productClassId);
$result = array_merge($result, $this->getDetail($result['product_id']));
return $result;
}
/**
* 商品IDに紐づく商品規格を自分自身に設定する.
*
* 引数の商品IDの配列に紐づく商品規格を取得し, 自分自身のフィールドに
* 設定する.
*
* @param array $arrProductId 商品ID の配列
* @param boolean $has_deleted 削除された商品規格も含む場合 true; 初期値 false
* @return void
*/
function setProductsClassByProductIds($arrProductId, $has_deleted = false) {
foreach ($arrProductId as $productId) {
$arrProductClasses = $this->getProductsClassFullByProductId($productId, $has_deleted);
$classCats1 = array();
$classCats1['__unselected'] = '選択してください';
// 規格1クラス名
$this->className1[$productId] =
isset($arrProductClasses[0]['class_name1'])
? $arrProductClasses[0]['class_name1']
: '';
// 規格2クラス名
$this->className2[$productId] =
isset($arrProductClasses[0]['class_name2'])
? $arrProductClasses[0]['class_name2']
: '';
// 規格1が設定されている
$this->classCat1_find[$productId] = $arrProductClasses[0]['classcategory_id1'] > 0; // 要変更ただし、他にも改修が必要となる
// 規格2が設定されている
$this->classCat2_find[$productId] = $arrProductClasses[0]['classcategory_id2'] > 0; // 要変更ただし、他にも改修が必要となる
$this->stock_find[$productId] = false;
$classCategories = array();
$classCategories['__unselected']['__unselected']['name'] = '選択してください';
$classCategories['__unselected']['__unselected']['product_class_id'] = $arrProductClasses[0]['product_class_id'];
// 商品種別
$classCategories['__unselected']['__unselected']['product_type'] = $arrProductClasses[0]['product_type_id'];
$this->product_class_id[$productId] = $arrProductClasses[0]['product_class_id'];
// 商品種別
$this->product_type[$productId] = $arrProductClasses[0]['product_type_id'];
foreach ($arrProductClasses as $arrProductsClass) {
$arrClassCats2 = array();
$classcategory_id1 = $arrProductsClass['classcategory_id1'];
$classcategory_id2 = $arrProductsClass['classcategory_id2'];
// 在庫
$stock_find_class = ($arrProductsClass['stock_unlimited'] || $arrProductsClass['stock'] > 0);
$arrClassCats2['classcategory_id2'] = $classcategory_id2;
$arrClassCats2['name'] = $arrProductsClass['classcategory_name2'] . ($stock_find_class ? '' : ' (品切れ中)');
$arrClassCats2['stock_find'] = $stock_find_class;
if ($stock_find_class) {
$this->stock_find[$productId] = true;
}
if (!in_array($classcat_id1, $classCats1)) {
$classCats1[$classcategory_id1] = $arrProductsClass['classcategory_name1']
. ($classcategory_id2 == 0 && !$stock_find_class ? ' (品切れ中)' : '');
}
// 価格
$arrClassCats2['price01']
= strlen($arrProductsClass['price01'])
? number_format(SC_Helper_DB_Ex::sfCalcIncTax($arrProductsClass['price01']))
: '';
$arrClassCats2['price02']
= strlen($arrProductsClass['price02'])
? number_format(SC_Helper_DB_Ex::sfCalcIncTax($arrProductsClass['price02']))
: '';
// ポイント
$arrClassCats2['point']
= number_format(SC_Utils_Ex::sfPrePoint($arrProductsClass['price02'], $arrProductsClass['point_rate']));
// 商品コード
$arrClassCats2['product_code'] = $arrProductsClass['product_code'];
// 商品規格ID
$arrClassCats2['product_class_id'] = $arrProductsClass['product_class_id'];
// 商品種別
$arrClassCats2['product_type'] = $arrProductsClass['product_type_id'];
// #929(GC8 規格のプルダウン順序表示不具合)対応のため、2次キーは「#」を前置
if (!$this->classCat1_find[$productId]) {
$classcategory_id1 = '__unselected2';
}
$classCategories[$classcategory_id1]['#'] = array(
'classcategory_id2' => '',
'name' => '選択してください',
);
$classCategories[$classcategory_id1]['#' . $classcategory_id2] = $arrClassCats2;
}
$this->classCategories[$productId] = $classCategories;
// 規格1
$this->classCats1[$productId] = $classCats1;
}
}
/**
* SC_Query インスタンスに設定された検索条件を使用して商品規格を取得する.
*
* @param SC_Query $objQuery SC_Queryインスタンス
* @param array $params 検索パラメーターの配列
* @return array 商品規格の配列
*/
function getProductsClassByQuery(&$objQuery, $params) {
// 末端の規格を取得
$col = <<< __EOS__
T1.product_id,
T1.stock,
T1.stock_unlimited,
T1.sale_limit,
T1.price01,
T1.price02,
T1.point_rate,
T1.product_code,
T1.product_class_id,
T1.del_flg,
T1.product_type_id,
T1.down_filename,
T1.down_realfilename,
T3.name AS classcategory_name1,
T3.rank AS rank1,
T4.name AS class_name1,
T4.class_id AS class_id1,
T1.classcategory_id1,
T1.classcategory_id2,
dtb_classcategory2.name AS classcategory_name2,
dtb_classcategory2.rank AS rank2,
dtb_class2.name AS class_name2,
dtb_class2.class_id AS class_id2
__EOS__;
$table = <<< __EOS__
dtb_products_class T1
LEFT JOIN dtb_classcategory T3
ON T1.classcategory_id1 = T3.classcategory_id
LEFT JOIN dtb_class T4
ON T3.class_id = T4.class_id
LEFT JOIN dtb_classcategory dtb_classcategory2
ON T1.classcategory_id2 = dtb_classcategory2.classcategory_id
LEFT JOIN dtb_class dtb_class2
ON dtb_classcategory2.class_id = dtb_class2.class_id
__EOS__;
$objQuery->setOrder('T3.rank DESC, dtb_classcategory2.rank DESC'); // XXX
$arrRet = $objQuery->select($col, $table, '', $params);
return $arrRet;
}
/**
* 商品規格IDから商品規格を取得する.
*
* 削除された商品規格は取得しない.
*
* @param integer $productClassId 商品規格ID
* @return array 商品規格の配列
*/
function getProductsClass($productClassId) {
$objQuery =& SC_Query_Ex::getSingletonInstance();
$objQuery->setWhere('product_class_id = ? AND T1.del_flg = 0');
$arrRes = $this->getProductsClassByQuery($objQuery, $productClassId);
return (array)$arrRes[0];
}
/**
* 複数の商品IDに紐づいた, 商品規格を取得する.
*
* @param array $productIds 商品IDの配列
* @param boolean $has_deleted 削除された商品規格も含む場合 true; 初期値 false
* @return array 商品規格の配列
*/
function getProductsClassByProductIds($productIds = array(), $has_deleted = false) {
if (empty($productIds)) {
return array();
}
$objQuery =& SC_Query_Ex::getSingletonInstance();
$where = 'product_id IN (' . SC_Utils_Ex::repeatStrWithSeparator('?', count($productIds)) . ')';
if (!$has_deleted) {
$where .= ' AND T1.del_flg = 0';
}
$objQuery->setWhere($where);
return $this->getProductsClassByQuery($objQuery, $productIds);
}
/**
* 商品IDに紐づいた, 商品規格をすべての組み合わせごとに取得する.
*
* @param array $productId 商品ID
* @param boolean $has_deleted 削除された商品規格も含む場合 true; 初期値 false
* @return array すべての組み合わせの商品規格の配列
*/
function getProductsClassFullByProductId($productId, $has_deleted = false) {
$arrRet = $this->getProductsClassByProductIds(array($productId), $has_deleted);
return $arrRet;
}
/**
* 商品IDをキーにした, 商品ステータスIDの配列を取得する.
*
* @param array 商品ID の配列
* @return array 商品IDをキーにした商品ステータスIDの配列
*/
function getProductStatus($productIds) {
if (empty($productIds)) {
return array();
}
$objQuery =& SC_Query_Ex::getSingletonInstance();
$cols = 'product_id, product_status_id';
$from = 'dtb_product_status';
$where = 'del_flg = 0 AND product_id IN (' . SC_Utils_Ex::repeatStrWithSeparator('?', count($productIds)) . ')';
$productStatus = $objQuery->select($cols, $from, $where, $productIds);
$results = array();
foreach ($productStatus as $status) {
$results[$status['product_id']][] = $status['product_status_id'];
}
return $results;
}
/**
* 商品ステータスを設定する.
*
* TODO 現在は DELETE/INSERT だが, UPDATE を検討する.
*
* @param integer $productId 商品ID
* @param array $productStatusIds ON にする商品ステータスIDの配列
*/
function setProductStatus($productId, $productStatusIds) {
$val['product_id'] = $productId;
$val['creator_id'] = $_SESSION['member_id'];
$val['create_date'] = 'CURRENT_TIMESTAMP';
$val['update_date'] = 'CURRENT_TIMESTAMP';
$val['del_flg'] = '0';
$objQuery =& SC_Query_Ex::getSingletonInstance();
$objQuery->delete('dtb_product_status', 'product_id = ?', array($productId));
foreach ($productStatusIds as $productStatusId) {
if ($productStatusId == '') continue;
$val['product_status_id'] = $productStatusId;
$objQuery->insert('dtb_product_status', $val);
}
}
/**
* 商品詳細の結果から, 販売制限数を取得する.
*
* getDetailAndProductsClass() の結果から, 販売制限数を取得する.
*
* @param array $p 商品詳細の検索結果の配列
* @return integer 商品詳細の結果から求めた販売制限数.
* @see getDetailAndProductsClass()
*/
function getBuyLimit($p) {
$limit = null;
if ($p['stock_unlimited'] != '1' && is_numeric($p['sale_limit'])) {
$limit = min($p['sale_limit'], $p['stock']);
} elseif (is_numeric($p['sale_limit'])) {
$limit = $p['sale_limit'];
} elseif ($p['stock_unlimited'] != '1') {
$limit = $p['stock'];
}
return $limit;
}
/**
* 在庫を減少させる.
*
* 指定の在庫数まで, 在庫を減少させる.
* 減少させた結果, 在庫数が 0 未満になった場合, 引数 $quantity が 0 の場合は,
* 在庫の減少を中止し, false を返す.
* 在庫の減少に成功した場合は true を返す.
*
* @param integer $productClassId 商品規格ID
* @param integer $quantity 減少させる在庫数
* @return boolean 在庫の減少に成功した場合 true; 失敗した場合 false
*/
function reduceStock($productClassId, $quantity) {
if ($quantity == 0) {
return false;
}
$objQuery =& SC_Query_Ex::getSingletonInstance();
$objQuery->update('dtb_products_class', array(),
'product_class_id = ?', array($productClassId),
array('stock' => 'stock - ?'), array($quantity));
// TODO エラーハンドリング
$productsClass = $this->getDetailAndProductsClass($productClassId);
if ($productsClass['stock_unlimited'] != '1' && $productsClass['stock'] < 0) {
return false;
}
return true;
}
/**
* 商品情報の配列に, 税込金額を設定して返す.
*
* この関数は, 主にスマートフォンで使用します.
*
* @param array $arrProducts 商品情報の配列
* @return array 税込金額を設定した商品情報の配列
*/
function setPriceTaxTo($arrProducts) {
foreach ($arrProducts as $key => $value) {
$arrProducts[$key]['price01_min_format'] = number_format($arrProducts[$key]['price01_min']);
$arrProducts[$key]['price01_max_format'] = number_format($arrProducts[$key]['price01_max']);
$arrProducts[$key]['price02_min_format'] = number_format($arrProducts[$key]['price02_min']);
$arrProducts[$key]['price02_max_format'] = number_format($arrProducts[$key]['price02_max']);
$arrProducts[$key]['price01_min_tax'] = SC_Helper_DB::sfCalcIncTax($arrProducts[$key]['price01_min']);
$arrProducts[$key]['price01_max_tax'] = SC_Helper_DB::sfCalcIncTax($arrProducts[$key]['price01_max']);
$arrProducts[$key]['price02_min_tax'] = SC_Helper_DB::sfCalcIncTax($arrProducts[$key]['price02_min']);
$arrProducts[$key]['price02_max_tax'] = SC_Helper_DB::sfCalcIncTax($arrProducts[$key]['price02_max']);
$arrProducts[$key]['price01_min_tax_format'] = number_format($arrProducts[$key]['price01_min_tax']);
$arrProducts[$key]['price01_max_tax_format'] = number_format($arrProducts[$key]['price01_max_tax']);
$arrProducts[$key]['price02_min_tax_format'] = number_format($arrProducts[$key]['price02_min_tax']);
$arrProducts[$key]['price02_max_tax_format'] = number_format($arrProducts[$key]['price02_max_tax']);
}
return $arrProducts;
}
/**
* 商品情報の配列に税込金額を設定する
*
* @param array $arrProducts 商品情報の配列
* @return void
*/
static function setIncTaxToProducts(&$arrProducts) {
foreach ($arrProducts as &$arrProduct) {
SC_Product_Ex::setIncTaxToProduct($arrProduct);
}
}
/**
* 商品情報の配列に税込金額を設定する
*
* @param array $arrProducts 商品情報の配列
* @return void
*/
static function setIncTaxToProduct(&$arrProduct) {
$arrProduct['price01_min_inctax'] = isset($arrProduct['price01_min']) ? SC_Helper_DB::sfCalcIncTax($arrProduct['price01_min']) : null;
$arrProduct['price01_max_inctax'] = isset($arrProduct['price01_max']) ? SC_Helper_DB::sfCalcIncTax($arrProduct['price01_max']) : null;
$arrProduct['price02_min_inctax'] = isset($arrProduct['price02_min']) ? SC_Helper_DB::sfCalcIncTax($arrProduct['price02_min']) : null;
$arrProduct['price02_max_inctax'] = isset($arrProduct['price02_max']) ? SC_Helper_DB::sfCalcIncTax($arrProduct['price02_max']) : null;
}
/**
* 商品詳細の SQL を取得する.
*
* @param string $where_products_class 商品規格情報の WHERE 句
* @return string 商品詳細の SQL
*/
function alldtlSQL($where_products_class = '') {
if (!SC_Utils_Ex::isBlank($where_products_class)) {
$where_products_class = 'AND (' . $where_products_class . ')';
}
/*
* point_rate, deliv_fee は商品規格(dtb_products_class)ごとに保持しているが,
* 商品(dtb_products)ごとの設定なので MAX のみを取得する.
*/
$sql = <<< __EOS__
(
SELECT
dtb_products.product_id
,dtb_products.name
,dtb_products.maker_id
,dtb_products.status
,dtb_products.comment1
,dtb_products.comment2
,dtb_products.comment3
,dtb_products.comment4
,dtb_products.comment5
,dtb_products.comment6
,dtb_products.note
,dtb_products.main_list_comment
,dtb_products.main_list_image
,dtb_products.main_comment
,dtb_products.main_image
,dtb_products.main_large_image
,dtb_products.sub_title1
,dtb_products.sub_comment1
,dtb_products.sub_image1
,dtb_products.sub_large_image1
,dtb_products.sub_title2
,dtb_products.sub_comment2
,dtb_products.sub_image2
,dtb_products.sub_large_image2
,dtb_products.sub_title3
,dtb_products.sub_comment3
,dtb_products.sub_image3
,dtb_products.sub_large_image3
,dtb_products.sub_title4
,dtb_products.sub_comment4
,dtb_products.sub_image4
,dtb_products.sub_large_image4
,dtb_products.sub_title5
,dtb_products.sub_comment5
,dtb_products.sub_image5
,dtb_products.sub_large_image5
,dtb_products.sub_title6
,dtb_products.sub_comment6
,dtb_products.sub_image6
,dtb_products.sub_large_image6
,dtb_products.del_flg
,dtb_products.creator_id
,dtb_products.create_date
,dtb_products.update_date
,dtb_products.deliv_date_id
,dtb_products.putting_name_flg
,dtb_products.putting_name_price
,T4.product_code_min
,T4.product_code_max
,T4.price01_min
,T4.price01_max
,T4.price02_min
,T4.price02_max
,T4.stock_min
,T4.stock_max
,T4.stock_unlimited_min
,T4.stock_unlimited_max
,T4.point_rate
,T4.deliv_fee
,T4.class_count
,dtb_maker.name AS maker_name
FROM dtb_products
JOIN (
SELECT product_id,
MIN(product_code) AS product_code_min,
MAX(product_code) AS product_code_max,
MIN(price01) AS price01_min,
MAX(price01) AS price01_max,
MIN(price02) AS price02_min,
MAX(price02) AS price02_max,
MIN(stock) AS stock_min,
MAX(stock) AS stock_max,
MIN(stock_unlimited) AS stock_unlimited_min,
MAX(stock_unlimited) AS stock_unlimited_max,
MAX(point_rate) AS point_rate,
MAX(deliv_fee) AS deliv_fee,
COUNT(*) as class_count
FROM dtb_products_class
WHERE del_flg = 0 $where_products_class
GROUP BY product_id
) AS T4
ON dtb_products.product_id = T4.product_id
LEFT JOIN dtb_maker
ON dtb_products.maker_id = dtb_maker.maker_id
) AS alldtl
__EOS__;
return $sql;
}
/**
* 商品規格詳細の SQL を取得する.
*
* MEMO: 2.4系 vw_product_classに相当(?)するイメージ
*
* @param string $where 商品詳細の WHERE 句
* @return string 商品規格詳細の SQL
*/
function prdclsSQL($where = '') {
$where_clause = '';
if (!SC_Utils_Ex::isBlank($where)) {
$where_clause = ' WHERE ' . $where;
}
$sql = <<< __EOS__
(
SELECT dtb_products.*,
dtb_products_class.product_class_id,
dtb_products_class.product_type_id,
dtb_products_class.product_code,
dtb_products_class.stock,
dtb_products_class.stock_unlimited,
dtb_products_class.sale_limit,
dtb_products_class.price01,
dtb_products_class.price02,
dtb_products_class.deliv_fee,
dtb_products_class.point_rate,
dtb_products_class.down_filename,
dtb_products_class.down_realfilename,
dtb_products_class.classcategory_id1 AS classcategory_id, /* 削除 */
dtb_products_class.classcategory_id1,
dtb_products_class.classcategory_id2 AS parent_classcategory_id, /* 削除 */
dtb_products_class.classcategory_id2,
Tcc1.class_id as class_id,
Tcc1.name as classcategory_name,
Tcc2.class_id as parent_class_id,
Tcc2.name as parent_classcategory_name
FROM dtb_products
LEFT JOIN dtb_products_class
ON dtb_products.product_id = dtb_products_class.product_id
LEFT JOIN dtb_classcategory as Tcc1
ON dtb_products_class.classcategory_id1 = Tcc1.classcategory_id
LEFT JOIN dtb_classcategory as Tcc2
ON dtb_products_class.classcategory_id2 = Tcc2.classcategory_id
$where_clause
) as prdcls
__EOS__;
return $sql;
}
}
<!--{*
data/Smarty/templates/default/shopping/confirm.tpl
* This file is part of EC-CUBE
*
* Copyright(c) 2000-2012 LOCKON CO.,LTD. All Rights Reserved.
*
* http://www.lockon.co.jp/
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*}-->
<script type="text/javascript" src="<!--{$smarty.const.ROOT_URLPATH}-->js/jquery.facebox/facebox.js"></script>
<link rel="stylesheet" type="text/css" href="<!--{$smarty.const.ROOT_URLPATH}-->js/jquery.facebox/facebox.css" media="screen" />
<script type="text/javascript">//<![CDATA[
var send = true;
function fnCheckSubmit() {
if(send) {
send = false;
return true;
} else {
alert("只今、処理中です。しばらくお待ち下さい。");
return false;
}
}
$(document).ready(function() {
$('a.expansion').facebox({
loadingImage : '<!--{$smarty.const.ROOT_URLPATH}-->js/jquery.facebox/loading.gif',
closeImage : '<!--{$smarty.const.ROOT_URLPATH}-->js/jquery.facebox/closelabel.png'
});
});
//]]></script>
<!--CONTENTS-->
<div id="undercolumn">
<div id="undercolumn_shopping">
<p class="flow_area"><img src="<!--{$TPL_URLPATH}-->img/picture/img_flow_03.jpg" alt="購入手続きの流れ" /></p>
<h2 class="title"><!--{$tpl_title|h}--></h2>
<p class="information">下記ご注文内容で送信してもよろしいでしょうか?<br />
よろしければ、「<!--{if $use_module}-->次へ<!--{else}-->ご注文完了ページへ<!--{/if}-->」ボタンをクリックしてください。</p>
<form name="form1" id="form1" method="post" action="?">
<input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" />
<input type="hidden" name="mode" value="confirm" />
<input type="hidden" name="uniqid" value="<!--{$tpl_uniqid}-->" />
<div class="btn_area">
<ul>
<li>
<a href="./payment.php" onmouseover="chgImg('<!--{$TPL_URLPATH}-->img/button/btn_back_on.jpg', 'back04-top')" onmouseout="chgImg('<!--{$TPL_URLPATH}-->img/button/btn_back.jpg', 'back04-top')"><img src="<!--{$TPL_URLPATH}-->img/button/btn_back.jpg" alt="戻る" border="0" name="back04-top" id="back04-top" /></a>
</li>
<!--{if $use_module}-->
<li>
<input type="image" onclick="return fnCheckSubmit();" onmouseover="chgImgImageSubmit('<!--{$TPL_URLPATH}-->img/button/btn_next_on.jpg',this)" onmouseout="chgImgImageSubmit('<!--{$TPL_URLPATH}-->img/button/btn_next.jpg',this)" src="<!--{$TPL_URLPATH}-->img/button/btn_next.jpg" alt="次へ" name="next-top" id="next-top" />
</li>
<!--{else}-->
<li>
<input type="image" onclick="return fnCheckSubmit();" onmouseover="chgImgImageSubmit('<!--{$TPL_URLPATH}-->img/button/btn_order_complete_on.jpg',this)" onmouseout="chgImgImageSubmit('<!--{$TPL_URLPATH}-->img/button/btn_order_complete.jpg',this)" src="<!--{$TPL_URLPATH}-->img/button/btn_order_complete.jpg" alt="ご注文完了ページへ" name="next-top" id="next-top" />
</li>
<!--{/if}-->
</ul>
</div>
<table summary="ご注文内容確認">
<col width="10%" />
<col width="40%" />
<col width="20%" />
<col width="10%" />
<col width="20%" />
<tr>
<th scope="col">商品写真</th>
<th scope="col">商品名</th>
<th scope="col">単価</th>
<th scope="col">数量</th>
<th scope="col">小計</th>
</tr>
<!--{foreach from=$arrCartItems item=item}-->
<tr>
<td class="alignC">
<a
<!--{if $item.productsClass.main_image|strlen >= 1}--> href="<!--{$smarty.const.IMAGE_SAVE_URLPATH}--><!--{$item.productsClass.main_image|sfNoImageMainList|h}-->" class="expansion" target="_blank"
<!--{/if}-->
>
<img src="<!--{$smarty.const.ROOT_URLPATH}-->resize_image.php?image=<!--{$item.productsClass.main_list_image|sfNoImageMainList|h}-->&amp;width=65&amp;height=65" alt="<!--{$item.productsClass.name|h}-->" /></a>
</td>
<td>
<ul>
<li><strong><!--{$item.productsClass.name|h}--></strong></li>
<!--{if $item.productsClass.classcategory_name1 != ""}-->
<li><!--{$item.productsClass.class_name1}-->:<!--{$item.productsClass.classcategory_name1}--></li>
<!--{/if}-->
<!--{if $item.productsClass.classcategory_name2 != ""}-->
<li><!--{$item.productsClass.class_name2}-->:<!--{$item.productsClass.classcategory_name2}--></li>
<!--{/if}-->
</ul>
</td>
<td class="alignR">
<!--{$item.price|sfCalcIncTax|number_format}-->円
</td>
<td class="alignR"><!--{$item.quantity|number_format}--></td>
<td class="alignR"><!--{$item.total_inctax|number_format}-->円</td>
</tr>
<!--{/foreach}-->
<tr>
<th colspan="4" class="alignR" scope="row">小計</th>
<td class="alignR"><!--{$tpl_total_inctax[$cartKey]|number_format}-->円</td>
</tr>
<!--{if $smarty.const.USE_POINT !== false}-->
<tr>
<th colspan="4" class="alignR" scope="row">値引き(ポイントご使用時)</th>
<td class="alignR">
<!--{assign var=discount value=`$arrForm.use_point*$smarty.const.POINT_VALUE`}-->
-<!--{$discount|number_format|default:0}-->円</td>
</tr>
<!--{/if}-->
<tr>
<th colspan="4" class="alignR" scope="row">送料</th>
<td class="alignR"><!--{$arrForm.deliv_fee|number_format}-->円</td>
</tr>
<tr>
<th colspan="4" class="alignR" scope="row">手数料</th>
<td class="alignR"><!--{$arrForm.charge|number_format}-->円</td>
</tr>
<tr>
<th colspan="4" class="alignR" scope="row">合計</th>
<td class="alignR"><span class="price"><!--{$arrForm.payment_total|number_format}-->円</span></td>
</tr>
</table>
<!--{* ログイン済みの会員のみ *}-->
<!--{if $tpl_login == 1 && $smarty.const.USE_POINT !== false}-->
<table summary="ポイント確認" class="delivname">
<col width="30%" />
<col width="70%" />
<tr>
<th scope="row">ご注文前のポイント</th>
<td><!--{$tpl_user_point|number_format|default:0}-->Pt</td>
</tr>
<tr>
<th scope="row">ご使用ポイント</th>
<td>-<!--{$arrForm.use_point|number_format|default:0}-->Pt</td>
</tr>
<!--{if $arrForm.birth_point > 0}-->
<tr>
<th scope="row">お誕生月ポイント</th>
<td>+<!--{$arrForm.birth_point|number_format|default:0}-->Pt</td>
</tr>
<!--{/if}-->
<tr>
<th scope="row">今回加算予定のポイント</th>
<td>+<!--{$arrForm.add_point|number_format|default:0}-->Pt</td>
</tr>
<tr>
<!--{assign var=total_point value=`$tpl_user_point-$arrForm.use_point+$arrForm.add_point`}-->
<th scope="row">加算後のポイント</th>
<td><!--{$total_point|number_format}-->Pt</td>
</tr>
</table>
<!--{/if}-->
<!--{* ログイン済みの会員のみ *}-->
<!--お届け先ここから-->
<!--{* 販売方法判定(ダウンロード販売のみの場合はお届け先を表示しない) *}-->
<!--{if $cartKey != $smarty.const.PRODUCT_TYPE_DOWNLOAD}-->
<!--{foreach item=shippingItem from=$arrShipping name=shippingItem}-->
<h3>お届け先<!--{if $is_multiple}--><!--{$smarty.foreach.shippingItem.iteration}--><!--{/if}--></h3>
<!--{if $is_multiple}-->
<table summary="ご注文内容確認">
<col width="10%" />
<col width="60%" />
<col width="20%" />
<col width="10%" />
<tr>
<th scope="col">商品写真</th>
<th scope="col">商品名</th>
<th scope="col">単価</th>
<th scope="col">数量</th>
<!--{* XXX 購入小計と誤差が出るためコメントアウト
<th scope="col">小計</th>
*}-->
</tr>
<!--{foreach item=item from=$shippingItem.shipment_item}-->
<tr>
<td class="alignC">
<a
<!--{if $item.productsClass.main_image|strlen >= 1}--> href="<!--{$smarty.const.IMAGE_SAVE_URLPATH}--><!--{$item.productsClass.main_image|sfNoImageMainList|h}-->" class="expansion" target="_blank"
<!--{/if}-->
>
<img src="<!--{$smarty.const.ROOT_URLPATH}-->resize_image.php?image=<!--{$item.productsClass.main_list_image|sfNoImageMainList|h}-->&amp;width=65&amp;height=65" alt="<!--{$item.productsClass.name|h}-->" /></a>
</td>
<td><!--{* 商品名 *}--><strong><!--{$item.productsClass.name|h}--></strong><br />
<!--{if $item.productsClass.classcategory_name1 != ""}-->
<!--{$item.productsClass.class_name1}-->:<!--{$item.productsClass.classcategory_name1}--><br />
<!--{/if}-->
<!--{if $item.productsClass.classcategory_name2 != ""}-->
<!--{$item.productsClass.class_name2}-->:<!--{$item.productsClass.classcategory_name2}-->
<!--{/if}-->
</td>
<td class="alignR">
<!--{$item.price|sfCalcIncTax|number_format}-->円
</td>
<td class="alignC"><!--{$item.quantity}--></td>
<!--{* XXX 購入小計と誤差が出るためコメントアウト
<td class="alignR"><!--{$item.total_inctax|number_format}-->円</td>
*}-->
</tr>
<!--{/foreach}-->
</table>
<!--{/if}-->
<table summary="お届け先確認" class="delivname">
<col width="30%" />
<col width="70%" />
<tbody>
<tr>
<th scope="row">お名前</th>
<td><!--{$shippingItem.shipping_name01|h}--> <!--{$shippingItem.shipping_name02|h}--></td>
</tr>
<tr>
<th scope="row">お名前(フリガナ)</th>
<td><!--{$shippingItem.shipping_kana01|h}--> <!--{$shippingItem.shipping_kana02|h}--></td>
</tr>
<tr>
<th scope="row">郵便番号</th>
<td>〒<!--{$shippingItem.shipping_zip01|h}-->-<!--{$shippingItem.shipping_zip02|h}--></td>
</tr>
<tr>
<th scope="row">住所</th>
<td><!--{$arrPref[$shippingItem.shipping_pref]}--><!--{$shippingItem.shipping_addr01|h}--><!--{$shippingItem.shipping_addr02|h}--></td>
</tr>
<tr>
<th scope="row">電話番号</th>
<td><!--{$shippingItem.shipping_tel01}-->-<!--{$shippingItem.shipping_tel02}-->-<!--{$shippingItem.shipping_tel03}--></td>
</tr>
<tr>
<th scope="row">FAX番号</th>
<td>
<!--{if $shippingItem.shipping_fax01 > 0}-->
<!--{$shippingItem.shipping_fax01}-->-<!--{$shippingItem.shipping_fax02}-->-<!--{$shippingItem.shipping_fax03}-->
<!--{/if}-->
</td>
</tr>
<!--{if $cartKey != $smarty.const.PRODUCT_TYPE_DOWNLOAD}-->
<tr>
<th scope="row">お届け日</th>
<td><!--{$shippingItem.shipping_date|default:"指定なし"|h}--></td>
</tr>
<tr>
<th scope="row">お届け時間</th>
<td><!--{$shippingItem.shipping_time|default:"指定なし"|h}--></td>
</tr>
<!--{/if}-->
</tbody>
</table>
<!--{/foreach}-->
<!--{/if}-->
<!--お届け先ここまで-->
<h3>配送方法・お支払方法・その他お問い合わせ</h3>
<table summary="配送方法・お支払方法・その他お問い合わせ" class="delivname">
<col width="30%" />
<col width="70%" />
<tbody>
<tr>
<th scope="row">配送方法</th>
<td><!--{$arrDeliv[$arrForm.deliv_id]|h}--></td>
</tr>
<tr>
<th scope="row">お支払方法</th>
<td><!--{$arrForm.payment_method|h}--></td>
</tr>
<!--{if $hasPuttingNamesOptions == true}-->
<tr>
<th scope="row">名入れの内容</th>
<td><!--{$arrForm.putting_names_options|h|nl2br}--></td>
</tr>
<!--{/if}-->
<tr>
<th scope="row">その他お問い合わせ</th>
<td><!--{$arrForm.message|h|nl2br}--></td>
</tr>
</tbody>
</table>
<div class="btn_area">
<ul>
<li>
<a href="./payment.php" onmouseover="chgImg('<!--{$TPL_URLPATH}-->img/button/btn_back_on.jpg','back<!--{$key}-->');" onmouseout="chgImg('<!--{$TPL_URLPATH}-->img/button/btn_back.jpg','back<!--{$key}-->');"><img src="<!--{$TPL_URLPATH}-->img/button/btn_back.jpg" alt="戻る" name="back<!--{$key}-->" /></a>
</li>
<!--{if $use_module}-->
<li>
<input type="image" onclick="return fnCheckSubmit();" onmouseover="chgImgImageSubmit('<!--{$TPL_URLPATH}-->img/button/btn_next_on.jpg',this)" onmouseout="chgImgImageSubmit('<!--{$TPL_URLPATH}-->img/button/btn_next.jpg',this)" src="<!--{$TPL_URLPATH}-->img/button/btn_next.jpg" alt="次へ" name="next" id="next" />
</li>
<!--{else}-->
<li>
<input type="image" onclick="return fnCheckSubmit();" onmouseover="chgImgImageSubmit('<!--{$TPL_URLPATH}-->img/button/btn_order_complete_on.jpg',this)" onmouseout="chgImgImageSubmit('<!--{$TPL_URLPATH}-->img/button/btn_order_complete.jpg',this)" src="<!--{$TPL_URLPATH}-->img/button/btn_order_complete.jpg" alt="ご注文完了ページへ" name="next" id="next" />
</li>
<!--{/if}-->
</ul>
</div>
</form>
</div>
</div>
<!--{*
data/Smarty/templates/default/cart/index.tpl
* This file is part of EC-CUBE
*
* Copyright(c) 2000-2012 LOCKON CO.,LTD. All Rights Reserved.
*
* http://www.lockon.co.jp/
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*}-->
<script type="text/javascript" src="<!--{$smarty.const.ROOT_URLPATH}-->js/jquery.facebox/facebox.js"></script>
<link rel="stylesheet" type="text/css" href="<!--{$smarty.const.ROOT_URLPATH}-->js/jquery.facebox/facebox.css" media="screen" />
<script type="text/javascript">//<![CDATA[
$(document).ready(function() {
$('a.expansion').facebox({
loadingImage : '<!--{$smarty.const.ROOT_URLPATH}-->js/jquery.facebox/loading.gif',
closeImage : '<!--{$smarty.const.ROOT_URLPATH}-->js/jquery.facebox/closelabel.png'
});
});
//]]></script>
<div id="undercolumn">
<div id="undercolumn_cart">
<h2 class="title"><!--{$tpl_title|h}--></h2>
<!--{if $smarty.const.USE_POINT !== false || count($arrProductsClass) > 0}-->
<!--★ポイント案内★-->
<!--{if $smarty.const.USE_POINT !== false}-->
<div class="point_announce">
<!--{if $tpl_login}-->
<span class="user_name"><!--{$tpl_name|h}--> 様</span>の、現在の所持ポイントは「<span class="point"><!--{$tpl_user_point|number_format|default:0}--> pt</span>」です。<br />
<!--{else}-->
ポイント制度をご利用になられる場合は、会員登録後ログインしてくださいますようお願い致します。<br />
<!--{/if}-->
ポイントは商品購入時に<span class="price">1pt=<!--{$smarty.const.POINT_VALUE}-->円</span>として使用することができます。<br />
</div>
<!--{/if}-->
<!--{/if}-->
<p class="totalmoney_area">
<!--{* カゴの中に商品がある場合にのみ表示 *}-->
<!--{if count($cartKeys) > 1}-->
<span class="attentionSt"><!--{foreach from=$cartKeys item=key name=cartKey}--><!--{$arrProductType[$key]}--><!--{if !$smarty.foreach.cartKey.last}-->、<!--{/if}--><!--{/foreach}-->は同時購入できません。<br />
お手数ですが、個別に購入手続きをお願い致します。
</span>
<!--{/if}-->
<!--{if strlen($tpl_error) != 0}-->
<p class="attention"><!--{$tpl_error|h}--></p>
<!--{/if}-->
<!--{if strlen($tpl_message) != 0}-->
<p class="attention"><!--{$tpl_message|h|nl2br}--></p>
<!--{/if}-->
</p>
<!--{if count($cartItems) > 0}-->
<!--{foreach from=$cartKeys item=key}-->
<div class="form_area">
<form name="form<!--{$key}-->" id="form<!--{$key}-->" method="post" action="?">
<input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" />
<input type="hidden" name="mode" value="confirm" />
<input type="hidden" name="cart_no" value="" />
<input type="hidden" name="cartKey" value="<!--{$key}-->" />
<input type="hidden" name="category_id" value="<!--{$tpl_category_id|h}-->" />
<!--{if count($cartKeys) > 1}-->
<h3><!--{$arrProductType[$key]}--></h3>
<p>
<!--{$arrProductType[$key]}-->の合計金額は「<span class="price"><!--{$tpl_total_inctax[$key]|number_format}-->円</span>」です。
<!--{if $key != $smarty.const.PRODUCT_TYPE_DOWNLOAD}-->
<!--{if $arrInfo.free_rule > 0}-->
<!--{if !$arrData[$key].is_deliv_free}-->
あと「<span class="price"><!--{$tpl_deliv_free[$key]|number_format}-->円</span>」で送料無料です!!
<!--{else}-->
現在、「<span class="attention">送料無料</span>」です!!
<!--{/if}-->
<!--{/if}-->
<!--{/if}-->
</p>
<!--{else}-->
<p>
お買い上げ商品の合計金額は「<span class="price"><!--{$tpl_total_inctax[$key]|number_format}-->円</span>」です。
<!--{if $key != $smarty.const.PRODUCT_TYPE_DOWNLOAD}-->
<!--{if $arrInfo.free_rule > 0}-->
<!--{if !$arrData[$key].is_deliv_free}-->
あと「<span class="price"><!--{$tpl_deliv_free[$key]|number_format}-->円</span>」で送料無料です!!
<!--{else}-->
現在、「<span class="attention">送料無料</span>」です!!
<!--{/if}-->
<!--{/if}-->
<!--{/if}-->
</p>
<!--{/if}-->
<table summary="商品情報">
<col width="10%" />
<col width="15%" />
<col width="30%" />
<col width="15%" />
<col width="15%" />
<col width="15%" />
<tr>
<th class="alignC">削除</th>
<th class="alignC">商品写真</th>
<th class="alignC">商品名</th>
<th class="alignC">単価</th>
<th class="alignC">数量</th>
<th class="alignC">小計</th>
</tr>
<!--{foreach from=$cartItems[$key] item=item}-->
<tr style="<!--{if $item.error}-->background-color: <!--{$smarty.const.ERR_COLOR}-->;<!--{/if}-->">
<td class="alignC"><a href="?" onclick="fnFormModeSubmit('form<!--{$key}-->', 'delete', 'cart_no', '<!--{$item.cart_no}-->'); return false;">削除</a>
</td>
<td class="alignC">
<a class="expansion" target="_blank"
<!--{if $item.productsClass.main_image|strlen >= 1}--> href="<!--{$smarty.const.IMAGE_SAVE_URLPATH}--><!--{$item.productsClass.main_image|sfNoImageMainList|h}-->"
<!--{/if}-->
>
<img src="<!--{$smarty.const.ROOT_URLPATH}-->resize_image.php?image=<!--{$item.productsClass.main_list_image|sfNoImageMainList|h}-->&amp;width=65&amp;height=65" alt="<!--{$item.productsClass.name|h}-->" />
</a>
</td>
<td><!--{* 商品名 *}--><strong><!--{$item.productsClass.name|h}--></strong><br />
<!--{if $item.productsClass.classcategory_name1 != ""}-->
<!--{$item.productsClass.class_name1}-->:<!--{$item.productsClass.classcategory_name1}--><br />
<!--{/if}-->
<!--{if $item.productsClass.classcategory_name2 != ""}-->
<!--{$item.productsClass.class_name2}-->:<!--{$item.productsClass.classcategory_name2}-->
<!--{/if}-->
<!--{if $item.productsClass.putting_name_flg == '1'}-->
(名入れ対応)
<!--{/if}-->
</td>
<td class="alignR">
<!--{$item.price|sfCalcIncTax|number_format}-->円
</td>
<td class="alignC"><!--{$item.quantity}-->
<ul id="quantity_level">
<li><a href="?" onclick="fnFormModeSubmit('form<!--{$key}-->','up','cart_no','<!--{$item.cart_no}-->'); return false"><img src="<!--{$TPL_URLPATH}-->img/button/btn_plus.jpg" width="16" height="16" alt="+" /></a></li>
<li><a href="?" onclick="fnFormModeSubmit('form<!--{$key}-->','down','cart_no','<!--{$item.cart_no}-->'); return false"><img src="<!--{$TPL_URLPATH}-->img/button/btn_minus.jpg" width="16" height="16" alt="-" /></a></li>
</ul>
</td>
<td class="alignR"><!--{$item.total_inctax|number_format}-->円</td>
</tr>
<!--{/foreach}-->
<tr>
<th colspan="5" class="alignR">小計</th>
<td class="alignR"><!--{$tpl_total_inctax[$key]|number_format}-->円</td>
</tr>
<tr>
<th colspan="5" class="alignR">合計</th>
<td class="alignR"><span class="price"><!--{$arrData[$key].total-$arrData[$key].deliv_fee|number_format}-->円</span></td>
</tr>
<!--{if $smarty.const.USE_POINT !== false}-->
<!--{if $arrData[$key].birth_point > 0}-->
<tr>
<th colspan="5" class="alignR">お誕生月ポイント</th>
<td class="alignR"><!--{$arrData[$key].birth_point|number_format}-->pt</td>
</tr>
<!--{/if}-->
<tr>
<th colspan="5" class="alignR">今回加算ポイント</th>
<td class="alignR"><!--{$arrData[$key].add_point|number_format}-->pt</td>
</tr>
<!--{/if}-->
</table>
<!--{if strlen($tpl_error) == 0}-->
<p class="alignC">上記内容でよろしければ「購入手続きへ」ボタンをクリックしてください。</p>
<!--{/if}-->
<div class="btn_area">
<ul>
<li>
<!--{if $tpl_prev_url != ""}-->
<a href="<!--{$tpl_prev_url|h}-->" onmouseover="chgImg('<!--{$TPL_URLPATH}-->img/button/btn_back_on.jpg','back<!--{$key}-->');" onmouseout="chgImg('<!--{$TPL_URLPATH}-->img/button/btn_back.jpg','back<!--{$key}-->');">
<img src="<!--{$TPL_URLPATH}-->img/button/btn_back.jpg" alt="戻る" name="back<!--{$key}-->" /></a>
<!--{/if}-->
</li>
<li>
<!--{if strlen($tpl_error) == 0}-->
<input type="hidden" name="cartKey" value="<!--{$key}-->" />
<input type="image" onmouseover="chgImgImageSubmit('<!--{$TPL_URLPATH}-->img/button/btn_buystep_on.jpg',this)" onmouseout="chgImgImageSubmit('<!--{$TPL_URLPATH}-->img/button/btn_buystep.jpg',this)" src="<!--{$TPL_URLPATH}-->img/button/btn_buystep.jpg" alt="購入手続きへ" name="confirm" />
<!--{/if}-->
</li>
</ul>
</div>
</form>
</div>
<!--{/foreach}-->
<!--{else}-->
<p class="empty"><span class="attention">※ 現在カート内に商品はございません。</span></p>
<!--{/if}-->
</div>
</div>
<!--{*
data/Smarty/templates/default/products/detail.tpl
* This file is part of EC-CUBE
*
* Copyright(c) 2000-2012 LOCKON CO.,LTD. All Rights Reserved.
*
* http://www.lockon.co.jp/
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*}-->
<script type="text/javascript" src="<!--{$smarty.const.ROOT_URLPATH}-->js/products.js"></script>
<script type="text/javascript" src="<!--{$smarty.const.ROOT_URLPATH}-->js/jquery.facebox/facebox.js"></script>
<link rel="stylesheet" type="text/css" href="<!--{$smarty.const.ROOT_URLPATH}-->js/jquery.facebox/facebox.css" media="screen" />
<script type="text/javascript">//<![CDATA[
// 規格2に選択肢を割り当てる。
function fnSetClassCategories(form, classcat_id2_selected) {
var $form = $(form);
var product_id = $form.find('input[name=product_id]').val();
var $sele1 = $form.find('select[name=classcategory_id1]');
var $sele2 = $form.find('select[name=classcategory_id2]');
setClassCategories($form, product_id, $sele1, $sele2, classcat_id2_selected);
}
$(document).ready(function() {
$('a.expansion').facebox({
loadingImage : '<!--{$smarty.const.ROOT_URLPATH}-->js/jquery.facebox/loading.gif',
closeImage : '<!--{$smarty.const.ROOT_URLPATH}-->js/jquery.facebox/closelabel.png'
});
});
//]]></script>
<div id="undercolumn">
<form name="form1" id="form1" method="post" action="?">
<input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" />
<div id="detailarea" class="clearfix">
<div id="detailphotobloc">
<div class="photo">
<!--{assign var=key value="main_image"}-->
<!--★画像★-->
<!--{if $arrProduct.main_large_image|strlen >= 1}-->
<a
href="<!--{$smarty.const.IMAGE_SAVE_URLPATH}--><!--{$arrProduct.main_large_image|h}-->"
class="expansion"
target="_blank"
>
<!--{/if}-->
<img src="<!--{$arrFile[$key].filepath|h}-->" width="<!--{$arrFile[$key].width}-->" height="<!--{$arrFile[$key].height}-->" alt="<!--{$arrProduct.name|h}-->" class="picture" />
<!--{if $arrProduct.main_large_image|strlen >= 1}-->
</a>
<!--{/if}-->
</div>
<!--{if $arrProduct.main_large_image|strlen >= 1}-->
<span class="mini">
<!--★拡大する★-->
<a
href="<!--{$smarty.const.IMAGE_SAVE_URLPATH}--><!--{$arrProduct.main_large_image|h}-->"
class="expansion"
target="_blank"
>
画像を拡大する</a>
</span>
<!--{/if}-->
</div>
<div id="detailrightbloc">
<!--▼商品ステータス-->
<!--{assign var=ps value=$productStatus[$tpl_product_id]}-->
<!--{if count($ps) > 0}-->
<ul class="status_icon clearfix">
<!--{foreach from=$ps item=status}-->
<li>
<img src="<!--{$TPL_URLPATH}--><!--{$arrSTATUS_IMAGE[$status]}-->" width="60" height="17" alt="<!--{$arrSTATUS[$status]}-->" id="icon<!--{$status}-->" />
</li>
<!--{/foreach}-->
</ul>
<!--{/if}-->
<!--▲商品ステータス-->
<!--★商品コード★-->
<dl class="product_code">
<dt>商品コード:</dt>
<dd>
<span id="product_code_default">
<!--{if $arrProduct.product_code_min == $arrProduct.product_code_max}-->
<!--{$arrProduct.product_code_min|h}-->
<!--{else}-->
<!--{$arrProduct.product_code_min|h}-->~<!--{$arrProduct.product_code_max|h}-->
<!--{/if}-->
</span><span id="product_code_dynamic"></span>
</dd>
</dl>
<!--★商品名★-->
<h2><!--{$arrProduct.name|h}--></h2>
<!--★通常価格★-->
<!--{if $arrProduct.price01_min_inctax > 0}-->
<dl class="normal_price">
<dt><!--{$smarty.const.NORMAL_PRICE_TITLE}-->(税込):</dt>
<dd class="price">
<span id="price01_default"><!--{strip}-->
<!--{if $arrProduct.price01_min_inctax == $arrProduct.price01_max_inctax}-->
<!--{$arrProduct.price01_min_inctax|number_format}-->
<!--{else}-->
<!--{$arrProduct.price01_min_inctax|number_format}-->~<!--{$arrProduct.price01_max_inctax|number_format}-->
<!--{/if}-->
</span><span id="price01_dynamic"></span><!--{/strip}-->
</dd>
</dl>
<!--{/if}-->
<!--★販売価格★-->
<dl class="sale_price">
<dt><!--{$smarty.const.SALE_PRICE_TITLE}-->(税込):</dt>
<dd class="price">
<span id="price02_default"><!--{strip}-->
<!--{if $arrProduct.price02_min_inctax == $arrProduct.price02_max_inctax}-->
<!--{$arrProduct.price02_min_inctax|number_format}-->
<!--{else}-->
<!--{$arrProduct.price02_min_inctax|number_format}-->~<!--{$arrProduct.price02_max_inctax|number_format}-->
<!--{/if}-->
</span><span id="price02_dynamic"></span><!--{/strip}-->
</dd>
</dl>
<!--★ポイント★-->
<!--{if $smarty.const.USE_POINT !== false}-->
<div class="point">ポイント:
<span id="point_default"><!--{strip}-->
<!--{if $arrProduct.price02_min == $arrProduct.price02_max}-->
<!--{$arrProduct.price02_min|sfPrePoint:$arrProduct.point_rate|number_format}-->
<!--{else}-->
<!--{if $arrProduct.price02_min|sfPrePoint:$arrProduct.point_rate == $arrProduct.price02_max|sfPrePoint:$arrProduct.point_rate}-->
<!--{$arrProduct.price02_min|sfPrePoint:$arrProduct.point_rate|number_format}-->
<!--{else}-->
<!--{$arrProduct.price02_min|sfPrePoint:$arrProduct.point_rate|number_format}-->~<!--{$arrProduct.price02_max|sfPrePoint:$arrProduct.point_rate|number_format}-->
<!--{/if}-->
<!--{/if}-->
</span><span id="point_dynamic"></span><!--{/strip}-->
Pt
</div>
<!--{/if}-->
<!--{* ▼メーカー *}-->
<!--{if $arrProduct.maker_name|strlen >= 1}-->
<dl class="maker">
<dt>メーカー:</dt>
<dd><!--{$arrProduct.maker_name|h}--></dd>
</dl>
<!--{/if}-->
<!--{* ▲メーカー *}-->
<!--▼メーカーURL-->
<!--{if $arrProduct.comment1|strlen >= 1}-->
<dl class="comment1">
<dt>メーカーURL:</dt>
<dd><a href="<!--{$arrProduct.comment1|h}-->"><!--{$arrProduct.comment1|h}--></a></dd>
</dl>
<!--{/if}-->
<!--▼メーカーURL-->
<!--★関連カテゴリ★-->
<dl class="relative_cat">
<dt>関連カテゴリ:</dt>
<!--{section name=r loop=$arrRelativeCat}-->
<dd>
<!--{section name=s loop=$arrRelativeCat[r]}-->
<a href="<!--{$smarty.const.ROOT_URLPATH}-->products/list.php?category_id=<!--{$arrRelativeCat[r][s].category_id}-->"><!--{$arrRelativeCat[r][s].category_name}--></a>
<!--{if !$smarty.section.s.last}--><!--{$smarty.const.SEPA_CATNAVI}--><!--{/if}-->
<!--{/section}-->
</dd>
<!--{/section}-->
</dl>
<!--★詳細メインコメント★-->
<div class="main_comment"><!--{$arrProduct.main_comment|nl2br_html}--></div>
<!--★名入れオプション★-->
<!--{if $arrProduct.putting_name_flg == '1'}-->
<div class="putting_name">
この商品は名入れ対応です。(<!--{if $arrProduct.putting_name_price > 0}-->+<!--{$arrProduct.putting_name_price|h}-->円<!--{else}-->無料<!--{/if}-->)
</div>
<!--{/if}-->
<!--▼買い物かご-->
<div class="cart_area clearfix">
<input type="hidden" name="mode" value="cart" />
<input type="hidden" name="product_id" value="<!--{$tpl_product_id}-->" />
<input type="hidden" name="product_class_id" value="<!--{$tpl_product_class_id}-->" id="product_class_id" />
<input type="hidden" name="favorite_product_id" value="" />
<!--{if $tpl_stock_find}-->
<!--{if $tpl_classcat_find1}-->
<div class="classlist">
<!--▼規格1-->
<ul class="clearfix">
<li><!--{$tpl_class_name1|h}-->:</li>
<li>
<select name="classcategory_id1" style="<!--{$arrErr.classcategory_id1|sfGetErrorColor}-->">
<!--{html_options options=$arrClassCat1 selected=$arrForm.classcategory_id1.value}-->
</select>
<!--{if $arrErr.classcategory_id1 != ""}-->
<br /><span class="attention">※ <!--{$tpl_class_name1}-->を入力して下さい。</span>
<!--{/if}-->
</li>
</ul>
<!--▲規格1-->
<!--{if $tpl_classcat_find2}-->
<!--▼規格2-->
<ul class="clearfix">
<li><!--{$tpl_class_name2|h}-->:</li>
<li>
<select name="classcategory_id2" style="<!--{$arrErr.classcategory_id2|sfGetErrorColor}-->">
</select>
<!--{if $arrErr.classcategory_id2 != ""}-->
<br /><span class="attention">※ <!--{$tpl_class_name2}-->を入力して下さい。</span>
<!--{/if}-->
</li>
</ul>
<!--▲規格2-->
<!--{/if}-->
</div>
<!--{/if}-->
<!--★数量★-->
<dl class="quantity">
<dt>数量:</dt>
<dd><input type="text" class="box60" name="quantity" value="<!--{$arrForm.quantity.value|default:1|h}-->" maxlength="<!--{$smarty.const.INT_LEN}-->" style="<!--{$arrErr.quantity|sfGetErrorColor}-->" />
<!--{if $arrErr.quantity != ""}-->
<br /><span class="attention"><!--{$arrErr.quantity}--></span>
<!--{/if}-->
</dd>
</dl>
<div class="cartin">
<div class="cartin_btn">
<div id="cartbtn_default">
<!--★カゴに入れる★-->
<a href="javascript:void(document.form1.submit())" onmouseover="chgImg('<!--{$TPL_URLPATH}-->img/button/btn_cartin_on.jpg','cart');" onmouseout="chgImg('<!--{$TPL_URLPATH}-->img/button/btn_cartin.jpg','cart');">
<img src="<!--{$TPL_URLPATH}-->img/button/btn_cartin.jpg" alt="カゴに入れる" name="cart" id="cart" /></a>
</div>
</div>
</div>
<div class="attention" id="cartbtn_dynamic"></div>
<!--{else}-->
<div class="attention">申し訳ございませんが、只今品切れ中です。</div>
<!--{/if}-->
<!--★お気に入り登録★-->
<!--{if $smarty.const.OPTION_FAVORITE_PRODUCT == 1 && $tpl_login === true}-->
<div class="favorite_btn">
<!--{assign var=add_favorite value="add_favorite`$product_id`"}-->
<!--{if $arrErr[$add_favorite]}-->
<div class="attention"><!--{$arrErr[$add_favorite]}--></div>
<!--{/if}-->
<!--{if !$is_favorite}-->
<a href="javascript:fnChangeAction('?product_id=<!--{$arrProduct.product_id|h}-->'); fnModeSubmit('add_favorite','favorite_product_id','<!--{$arrProduct.product_id|h}-->');" onmouseover="chgImg('<!--{$TPL_URLPATH}-->img/button/btn_add_favorite_on.jpg','add_favorite_product');" onmouseout="chgImg('<!--{$TPL_URLPATH}-->img/button/btn_add_favorite.jpg','add_favorite_product');"><img src="<!--{$TPL_URLPATH}-->img/button/btn_add_favorite.jpg" alt="お気に入りに追加" name="add_favorite_product" id="add_favorite_product" /></a>
<!--{else}-->
<img src="<!--{$TPL_URLPATH}-->img/button/btn_add_favorite_on.jpg" alt="お気に入り登録済" name="add_favorite_product" id="add_favorite_product" />
<script type="text/javascript" src="<!--{$smarty.const.ROOT_URLPATH}-->js/jquery.tipsy.js"></script>
<script type="text/javascript">
var favoriteButton = $("#add_favorite_product");
favoriteButton.tipsy({gravity: $.fn.tipsy.autoNS, fallback: "お気に入りに登録済み", fade: true });
<!--{if $just_added_favorite == true}-->
favoriteButton.load(function(){$(this).tipsy("show")});
$(function(){
var tid = setTimeout('favoriteButton.tipsy("hide")',5000);
});
<!--{/if}-->
</script>
<!--{/if}-->
</div>
<!--{/if}-->
</div>
</div>
<!--▲買い物かご-->
</div>
</form>
<!--詳細ここまで-->
<!--▼サブコメント-->
<!--{section name=cnt loop=$smarty.const.PRODUCTSUB_MAX}-->
<!--{assign var=key value="sub_title`$smarty.section.cnt.index+1`"}-->
<!--{assign var=ikey value="sub_image`$smarty.section.cnt.index+1`"}-->
<!--{if $arrProduct[$key] != "" or $arrProduct[$ikey]|strlen >= 1}-->
<div class="sub_area clearfix">
<h3><!--★サブタイトル★--><!--{$arrProduct[$key]|h}--></h3>
<!--{assign var=ckey value="sub_comment`$smarty.section.cnt.index+1`"}-->
<!--▼サブ画像-->
<!--{assign var=lkey value="sub_large_image`$smarty.section.cnt.index+1`"}-->
<!--{if $arrProduct[$ikey]|strlen >= 1}-->
<div class="subtext"><!--★サブテキスト★--><!--{$arrProduct[$ckey]|nl2br_html}--></div>
<div class="subphotoimg">
<!--{if $arrProduct[$lkey]|strlen >= 1}-->
<a href="<!--{$smarty.const.IMAGE_SAVE_URLPATH}--><!--{$arrProduct[$lkey]|h}-->" class="expansion" target="_blank" >
<!--{/if}-->
<img src="<!--{$arrFile[$ikey].filepath}-->" alt="<!--{$arrProduct.name|h}-->" width="<!--{$arrFile[$ikey].width}-->" height="<!--{$arrFile[$ikey].height}-->" />
<!--{if $arrProduct[$lkey]|strlen >= 1}--></a>
<span class="mini">
<a href="<!--{$smarty.const.IMAGE_SAVE_URLPATH}--><!--{$arrProduct[$lkey]|h}-->" class="expansion" target="_blank">
画像を拡大する</a>
</span>
<!--{/if}-->
</div>
<!--{else}-->
<p class="subtext"><!--★サブテキスト★--><!--{$arrProduct[$ckey]|nl2br_html}--></p>
<!--{/if}-->
<!--▲サブ画像-->
</div>
<!--{/if}-->
<!--{/section}-->
<!--▲サブコメント-->
<!--この商品に対するお客様の声-->
<div id="customervoice_area">
<h2><img src="<!--{$TPL_URLPATH}-->img/title/tit_product_voice.jpg" alt="この商品に対するお客様の声" /></h2>
<div class="review_bloc clearfix">
<p>この商品に対するご感想をぜひお寄せください。</p>
<div class="review_btn">
<!--{if count($arrReview) < $smarty.const.REVIEW_REGIST_MAX}-->
<!--★新規コメントを書き込む★-->
<a href="./review.php"
onclick="win02('./review.php?product_id=<!--{$arrProduct.product_id}-->','review','600','640'); return false;"
onmouseover="chgImg('<!--{$TPL_URLPATH}-->img/button/btn_comment_on.jpg','review');"
onmouseout="chgImg('<!--{$TPL_URLPATH}-->img/button/btn_comment.jpg','review');" target="_blank">
<img src="<!--{$TPL_URLPATH}-->img/button/btn_comment.jpg" alt="新規コメントを書き込む" name="review" id="review" /></a>
<!--{/if}-->
</div>
</div>
<!--{if count($arrReview) > 0}-->
<ul>
<!--{section name=cnt loop=$arrReview}-->
<li>
<p class="voicetitle"><!--{$arrReview[cnt].title|h}--></p>
<p class="voicedate"><!--{$arrReview[cnt].create_date|sfDispDBDate:false}--> 投稿者:<!--{if $arrReview[cnt].reviewer_url}--><a href="<!--{$arrReview[cnt].reviewer_url}-->" target="_blank"><!--{$arrReview[cnt].reviewer_name|h}--></a><!--{else}--><!--{$arrReview[cnt].reviewer_name|h}--><!--{/if}--> おすすめレベル:<span class="recommend_level"><!--{assign var=level value=$arrReview[cnt].recommend_level}--><!--{$arrRECOMMEND[$level]|h}--></span></p>
<p class="voicecomment"><!--{$arrReview[cnt].comment|h|nl2br}--></p>
</li>
<!--{/section}-->
</ul>
<!--{/if}-->
</div>
<!--お客様の声ここまで-->
<!--▼関連商品-->
<!--{if $arrRecommend}-->
<div id="whobought_area">
<h2><img src="<!--{$TPL_URLPATH}-->img/title/tit_product_recommend.jpg" alt="その他のオススメ商品" /></h2>
<!--{foreach from=$arrRecommend item=arrItem name="arrRecommend"}-->
<div class="product_item">
<div class="productImage">
<a href="<!--{$smarty.const.P_DETAIL_URLPATH}--><!--{$arrItem.product_id|u}-->">
<img src="<!--{$smarty.const.ROOT_URLPATH}-->resize_image.php?image=<!--{$arrItem.main_list_image|sfNoImageMainList|h}-->&amp;width=65&amp;height=65" alt="<!--{$arrItem.name|h}-->" /></a>
</div>
<!--{assign var=price02_min value=`$arrItem.price02_min_inctax`}-->
<!--{assign var=price02_max value=`$arrItem.price02_max_inctax`}-->
<div class="productContents">
<h3><a href="<!--{$smarty.const.P_DETAIL_URLPATH}--><!--{$arrItem.product_id|u}-->"><!--{$arrItem.name|h}--></a></h3>
<p class="sale_price"><!--{$smarty.const.SALE_PRICE_TITLE}-->(税込):<span class="price">
<!--{if $price02_min == $price02_max}-->
<!--{$price02_min|number_format}-->
<!--{else}-->
<!--{$price02_min|number_format}-->~<!--{$price02_max|number_format}-->
<!--{/if}-->円</span></p>
<p class="mini"><!--{$arrItem.comment|h|nl2br}--></p>
</div>
</div><!--{* /.item *}-->
<!--{if $smarty.foreach.arrRecommend.iteration % 2 === 0}-->
<div class="clear"></div>
<!--{/if}-->
<!--{/foreach}-->
</div>
<!--{/if}-->
<!--▲関連商品-->
</div>
<!--{*
data/Smarty/templates/default/shopping/payment.tpl
* This file is part of EC-CUBE
*
* Copyright(c) 2000-2012 LOCKON CO.,LTD. All Rights Reserved.
*
* http://www.lockon.co.jp/
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*}-->
<script type="text/javascript">//<![CDATA[
$(function() {
if ($('input[name=deliv_id]:checked').val()
|| $('#deliv_id').val()) {
showForm(true);
} else {
showForm(false);
}
$('input[id^=deliv_]').click(function() {
showForm(true);
var data = {};
data.mode = 'select_deliv';
data.deliv_id = $(this).val();
data['<!--{$smarty.const.TRANSACTION_ID_NAME}-->'] = '<!--{$transactionid}-->';
$.ajax({
type : 'POST',
url : location.pathname,
data: data,
cache : false,
dataType : 'json',
error : remoteException,
success : function(data, dataType) {
if (data.error) {
remoteException();
} else {
// 支払い方法の行を生成
var payment_tbody = $('#payment tbody');
payment_tbody.empty();
for (var i in data.arrPayment) {
// ラジオボタン
<!--{* IE7未満対応のため name と id をベタ書きする *}-->
var radio = $('<input type="radio" name="payment_id" id="pay_' + i + '" />')
.val(data.arrPayment[i].payment_id);
// ラベル
var label = $('<label />')
.attr('for', 'pay_' + i)
.text(data.arrPayment[i].payment_method);
// 行
var tr = $('<tr />')
.append($('<td />')
.addClass('alignC')
.append(radio))
.append($('<td />').append(label));
// 支払方法の画像が登録されている場合は表示
if (data.img_show) {
var payment_image = data.arrPayment[i].payment_image;
$('th#payment_method').attr('colspan', 3);
if (payment_image) {
var img = $('<img />').attr('src', '<!--{$smarty.const.IMAGE_SAVE_URLPATH}-->' + payment_image);
tr.append($('<td />').append(img));
} else {
tr.append($('<td />'));
}
} else {
$('th#payment_method').attr('colspan', 2);
}
tr.appendTo(payment_tbody);
}
// お届け時間を生成
var deliv_time_id_select = $('select[id^=deliv_time_id]');
deliv_time_id_select.empty();
deliv_time_id_select.append($('<option />').text('指定なし').val(''));
for (var i in data.arrDelivTime) {
var option = $('<option />')
.val(i)
.text(data.arrDelivTime[i])
.appendTo(deliv_time_id_select);
}
}
}
});
});
/**
* 通信エラー表示.
*/
function remoteException(XMLHttpRequest, textStatus, errorThrown) {
alert('通信中にエラーが発生しました。カート画面に移動します。');
location.href = '<!--{$smarty.const.CART_URLPATH}-->';
}
/**
* 配送方法の選択状態により表示を切り替える
*/
function showForm(show) {
if (show) {
$('#payment, div.delivdate, .select-msg').show();
$('.non-select-msg').hide();
} else {
$('#payment, div.delivdate, .select-msg').hide();
$('.non-select-msg').show();
}
}
});
//]]></script>
<div id="undercolumn">
<div id="undercolumn_shopping">
<p class="flow_area">
<img src="<!--{$TPL_URLPATH}-->img/picture/img_flow_02.jpg" alt="購入手続きの流れ" />
</p>
<h2 class="title"><!--{$tpl_title|h}--></h2>
<form name="form1" id="form1" method="post" action="?">
<input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" />
<input type="hidden" name="mode" value="confirm" />
<input type="hidden" name="uniqid" value="<!--{$tpl_uniqid}-->" />
<!--{assign var=key value="deliv_id"}-->
<!--{if $is_single_deliv}-->
<input type="hidden" name="<!--{$key}-->" value="<!--{$arrForm[$key].value}-->" id="deliv_id" />
<!--{else}-->
<div class="pay_area">
<h3>配送方法の指定</h3>
<p>配送方法をご選択ください。</p>
<!--{if $arrErr[$key] != ""}-->
<p class="attention"><!--{$arrErr[$key]}--></p>
<!--{/if}-->
<table summary="配送方法選択">
<col width="20%" />
<col width="80%" />
<tr>
<th class="alignC">選択</th>
<th class="alignC" colspan="2">配送方法</th>
</tr>
<!--{section name=cnt loop=$arrDeliv}-->
<tr>
<td class="alignC"><input type="radio" id="deliv_<!--{$smarty.section.cnt.iteration}-->" name="<!--{$key}-->" value="<!--{$arrDeliv[cnt].deliv_id}-->" style="<!--{$arrErr[$key]|sfGetErrorColor}-->" <!--{$arrDeliv[cnt].deliv_id|sfGetChecked:$arrForm[$key].value}--> />
</td>
<td>
<label for="deliv_<!--{$smarty.section.cnt.iteration}-->"><!--{$arrDeliv[cnt].name|h}--><!--{if $arrDeliv[cnt].remark != ""}--><p><!--{$arrDeliv[cnt].remark|h|nl2br}--></p><!--{/if}--></label>
</td>
</tr>
<!--{/section}-->
</table>
</div>
<!--{/if}-->
<div class="pay_area">
<h3>お支払方法の指定</h3>
<p class="select-msg">お支払方法をご選択ください。</p>
<p class="non-select-msg">まずはじめに、配送方法を選択ください。</p>
<!--{assign var=key value="payment_id"}-->
<!--{if $arrErr[$key] != ""}-->
<p class="attention"><!--{$arrErr[$key]}--></p>
<!--{/if}-->
<table summary="お支払方法選択" id="payment">
<col width="20%" />
<col width="80%" />
<thead>
<tr>
<th class="alignC">選択</th>
<th class="alignC" colspan="<!--{if !$img_show}-->2<!--{else}-->3<!--{/if}-->" id="payment_method">お支払方法</th>
</tr>
</thead>
<tbody>
<!--{section name=cnt loop=$arrPayment}-->
<tr>
<td class="alignC"><input type="radio" id="pay_<!--{$smarty.section.cnt.iteration}-->" name="<!--{$key}-->" value="<!--{$arrPayment[cnt].payment_id}-->" style="<!--{$arrErr[$key]|sfGetErrorColor}-->" <!--{$arrPayment[cnt].payment_id|sfGetChecked:$arrForm[$key].value}--> /></td>
<td>
<label for="pay_<!--{$smarty.section.cnt.iteration}-->"><!--{$arrPayment[cnt].payment_method|h}--><!--{if $arrPayment[cnt].note != ""}--><!--{/if}--></label>
</td>
<!--{if $img_show}-->
<td>
<!--{if $arrPayment[cnt].payment_image != ""}-->
<img src="<!--{$smarty.const.IMAGE_SAVE_URLPATH}--><!--{$arrPayment[cnt].payment_image}-->" />
<!--{/if}-->
</td>
<!--{/if}-->
</tr>
<!--{/section}-->
</tbody>
</table>
</div>
<!--{if $cartKey != $smarty.const.PRODUCT_TYPE_DOWNLOAD}-->
<div class="pay_area02">
<h3>お届け時間の指定</h3>
<p class="select-msg">ご希望の方は、お届け時間を選択してください。</p>
<p class="non-select-msg">まずはじめに、配送方法を選択ください。</p>
<!--{foreach item=shippingItem name=shippingItem from=$arrShipping}-->
<!--{assign var=index value=$shippingItem.shipping_id}-->
<div class="delivdate top">
<!--{if $is_multiple}-->
<span class="st">▼<!--{$shippingItem.shipping_name01}--><!--{$shippingItem.shipping_name02}-->
<!--{$arrPref[$shippingItem.shipping_pref]}--><!--{$shippingItem.shipping_addr01}--><!--{$shippingItem.shipping_addr02}--></span><br/>
<!--{/if}-->
<!--★お届け日★-->
<!--{assign var=key value="deliv_date`$index`"}-->
<span class="attention"><!--{$arrErr[$key]}--></span>
お届け日:
<!--{if !$arrDelivDate}-->
ご指定頂けません。
<!--{else}-->
<select name="<!--{$key}-->" id="<!--{$key}-->" style="<!--{$arrErr[$key]|sfGetErrorColor}-->">
<option value="" selected="">指定なし</option>
<!--{assign var=shipping_date_value value=$arrForm[$key].value|default:$shippingItem.shipping_date}-->
<!--{html_options options=$arrDelivDate selected=$shipping_date_value}-->
</select>&nbsp;
<!--{/if}-->
<!--★お届け時間★-->
<!--{assign var=key value="deliv_time_id`$index`"}-->
<span class="attention"><!--{$arrErr[$key]}--></span>
お届け時間:
<select name="<!--{$key}-->" id="<!--{$key}-->" style="<!--{$arrErr[$key]|sfGetErrorColor}-->">
<option value="" selected="">指定なし</option>
<!--{assign var=shipping_time_value value=$arrForm[$key].value|default:$shippingItem.time_id}-->
<!--{html_options options=$arrDelivTime selected=$shipping_time_value}-->
</select>
</div>
<!--{/foreach}-->
</div>
<!--{/if}-->
<!-- ▼ポイント使用 ここから -->
<!--{if $tpl_login == 1 && $smarty.const.USE_POINT !== false}-->
<div class="point_area">
<h3>ポイント使用の指定</h3>
<p><span class="attention">1ポイントを<!--{$smarty.const.POINT_VALUE|number_format}-->円</span>として使用する事ができます。<br />
使用する場合は、「ポイントを使用する」にチェックを入れた後、使用するポイントをご記入ください。
</p>
<div class="point_announce">
<p><span class="user_name"><!--{$name01|h}--> <!--{$name02|h}-->様</span>の、現在の所持ポイントは「<span class="point"><!--{$tpl_user_point|default:0|number_format}-->Pt</span>」です。<br />
今回ご購入合計金額:<span class="price"><!--{$arrPrices.subtotal|number_format}-->円</span> <span class="attention">(送料、手数料を含みません。)</span>
</p>
<ul>
<li>
<input type="radio" id="point_on" name="point_check" value="1" <!--{$arrForm.point_check.value|sfGetChecked:1}--> onclick="fnCheckInputPoint();" /><label for="point_on">ポイントを使用する</label>
<!--{assign var=key value="use_point"}--><br />
今回のお買い物で、<input type="text" name="<!--{$key}-->" value="<!--{$arrForm[$key].value|default:$tpl_user_point}-->" maxlength="<!--{$arrForm[$key].length}-->" style="<!--{$arrErr[$key]|sfGetErrorColor}-->" class="box60" />&nbsp;Ptを使用する。<span class="attention"><!--{$arrErr[$key]}--></span>
</li>
<li><input type="radio" id="point_off" name="point_check" value="2" <!--{$arrForm.point_check.value|sfGetChecked:2}--> onclick="fnCheckInputPoint();" /><label for="point_off">ポイントを使用しない</label></li>
</ul>
</div>
</div>
<!--{/if}-->
<!-- ▲ポイント使用 ここまで -->
<!--{if $hasPuttingNamesOptions == true}-->
<div class="pay_area02">
<h3>名入れの内容</h3>
<p>名入れ対応商品をご購入の場合は、内容をご入力ください。</p>
<div>
<!--{assign var=key value="putting_names_options"}-->
<span class="attention"><!--{$arrErr[$key]}--></span>
<textarea name="<!--{$key}-->" style="<!--{$arrErr[$key]|sfGetErrorColor}-->" cols="70" rows="8" class="txtarea" wrap="hard"><!--{$arrForm[$key].value|h}--></textarea>
<p class="attention"> (<!--{$smarty.const.LTEXT_LEN}-->文字まで)</p>
</div>
</div>
<!--{/if}-->
<div class="pay_area02">
<h3>その他お問い合わせ</h3>
<p>その他お問い合わせ事項がございましたら、こちらにご入力ください。</p>
<div>
<!--★その他お問い合わせ事項★-->
<!--{assign var=key value="message"}-->
<span class="attention"><!--{$arrErr[$key]}--></span>
<textarea name="<!--{$key}-->" style="<!--{$arrErr[$key]|sfGetErrorColor}-->" cols="70" rows="8" class="txtarea" wrap="hard"><!--{$arrForm[$key].value|h}--></textarea>
<p class="attention"> (<!--{$smarty.const.LTEXT_LEN}-->文字まで)</p>
</div>
</div>
<div class="btn_area">
<ul>
<li>
<a href="?mode=return" onmouseover="chgImg('<!--{$TPL_URLPATH}-->img/button/btn_back_on.jpg','back03')" onmouseout="chgImg('<!--{$TPL_URLPATH}-->img/button/btn_back.jpg','back03')">
<img src="<!--{$TPL_URLPATH}-->img/button/btn_back.jpg" alt="戻る" border="0" name="back03" id="back03" /></a>
</li>
<li>
<input type="image" onmouseover="chgImgImageSubmit('<!--{$TPL_URLPATH}-->img/button/btn_next_on.jpg',this)" onmouseout="chgImgImageSubmit('<!--{$TPL_URLPATH}-->img/button/btn_next.jpg',this)" src="<!--{$TPL_URLPATH}-->img/button/btn_next.jpg" alt="次へ" name="next" id="next" />
</li>
</ul>
</div>
</form>
</div>
</div>
ALTER TABLE dtb_products ADD COLUMN putting_name_flg smallint NOT NULL DEFAULT 0;
ALTER TABLE dtb_products ADD COLUMN putting_name_price numeric NOT NULL DEFAULT 0;
ALTER TABLE dtb_order_temp ADD COLUMN putting_names_options TEXT;
ALTER TABLE dtb_order ADD COLUMN putting_names_options TEXT;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment