バージョン選択

フォーラム

メニュー

オンライン状況

93 人のユーザが現在オンラインです。 (78 人のユーザが フォーラム を参照しています。)
登録ユーザ: 0
ゲスト: 93
もっと...

サイト内検索

 > フロント機能 > ブロック[現在のカゴの中]

フロント機能

新規スレッドを追加する

スレッド表示 | 新しいものから 前のトピック | 次のトピック | 下へ
投稿者 スレッド
ramrun
投稿日時: 2007/2/7 11:55
対応状況: −−−
仙人
登録日: 2006/11/3
居住地:
投稿: 789
ブロック[現在のカゴの中]
カゴの中に入れた商品が、ブロック[カゴの中]に表示されるようにしてみました。

あとその際にカゴの中にLocationしないようにしました。
(そのほうが購入がスムーズになるかと思ったので)

サンプルサイト

一応、変更点は自サイトのtracで確認できるようにしていますが、よくわかっていないところもあるので問題があれば指摘してください。

ブロックのテンプレートはまだ整理できていないので、後ほど...
tomitomi
投稿日時: 2007/2/21 13:59
対応状況: −−−
半人前
登録日: 2006/9/22
居住地: 広島
投稿: 15
Re: ブロック[現在のカゴの中]
これは、良いですね!!
素晴らしいです。

>ブロックのテンプレートはまだ整理できていないので、後ほど...

楽しみです。


----------------
----------------------------------
(株)システムフレンド 富永 義臣
http://www.systemfriend.co.jp

----------------------------------

ramrun
投稿日時: 2007/2/23 23:08
対応状況: −−−
仙人
登録日: 2006/11/3
居住地:
投稿: 789
Re: ブロック[現在のカゴの中]
ありがとうございます。

しかし現在は忙しくて、手が出ない状況(汗)。
中途半端ではありますが、ブロックのカゴだけでも提示しておきます。

<!--{*
* Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved.
*
* http://www.lockon.co.jp/
*}-->
<!--▼現在のカゴの中ここから-->
<div style="background:#fee;margin-bottom:10px;padding:0px 5px 5px 5px">

<!--タイトル-->
<h3>現在のカゴの中</h3>
<div>商品数:<!--{$arrCartList.0.TotalQuantity|number_format|default:0}-->点</div>

<!--{if $arrCartList.0.TotalQuantity > 0}-->
<!--{section name=cnt loop=$arrCartList}-->
	<!--商品画像-->
	<div style="float:left"><a href="<!--{$smarty.const.URL_DIR}-->cart/index.php">
		<img src="<!--{$smarty.const.SITE_URL}-->resize_image.php?image=<!--{$smarty.const.IMAGE_SAVE_DIR}-->/<!--{$arrCartList[cnt].img}-->&width=48&height=48" alt="<!--{$arrCartList[cnt].product_name|escape}-->" />
	</a></div>
	
	<div style="text-align:right">
		<!--商品名-->
		<div style="color:#4a6fa6"><strong><!--{$arrCartList[cnt].product_name|escape}--></strong></div>
		
		<!--販売価格×数量-->
		<div style="">
			<!--{$arrCartList[cnt].price|sfPreTax:$arrInfo.tax:$arrInfo.tax_rule|number_format|default:0}-->円×<!--{$arrCartList[cnt].quantity|escape}-->
		</div>
	</div><br style="clear:both" />
<!--{/section}-->
<!--{/if}-->

<hr />

<div style="text-align:right">
	<span class="redst">合計:<!--{$arrCartList.0.ProductsTotal|number_format|default:0}-->円</span>
</div>

<!-- カゴの中に商品がある場合にのみ表示 -->
<!--{if $arrCartList.0.TotalQuantity > 0}-->
	<div style="text-align:center;font-size:14px">
	<!--{if $arrCartList.0.deliv_free > 0}-->
		送料手数料無料まであと<!--{$arrCartList.0.deliv_free|number_format|default:0}-->円(税込)です。
	<!--{else}-->
		現在、送料は「<span class="redst">無料</span>」です。
	<!--{/if}-->
	</div>
<!--{/if}-->

<!--カゴの中を見るボタン-->
<div style="margin-top:5px;text-align:center">
	<a href="<!--{$smarty.const.URL_DIR}-->cart/index.php" onmouseover="chgImg('<!--{$smarty.const.URL_DIR}-->img/side/button_cartin_on.gif','button_cartin');" onmouseout="chgImg('<!--{$smarty.const.URL_DIR}-->img/side/button_cartin.gif','button_cartin');"><img src="<!--{$smarty.const.URL_DIR}-->img/side/button_cartin.gif" width="87" height="22" alt="カゴの中を見る" border="0" name="button_cartin" /></a>
</div>

</div>
<!--▲現在のカゴの中ここまで-->


横に長くてごめんなさい(汗)。
nanasess
投稿日時: 2007/2/24 0:20
対応状況: −−−
登録日: 2006/9/9
居住地:
投稿: 2303
Re: ブロック[現在のカゴの中]
大河内です。

素晴しいです。

リキッドレイアウトや、テーブルタグを使用しないテンプレートを作ろうと思いながらも忙しさに負けて、なかなか手が出ませんでした。。

XHTML Strict なのも嬉しいですが、a タグの target 属性が使えなくなる等、表現の自由度が減ってしまうため、 XHTML Transitional の方が良いかもしれません。

更なるアイディアとしては、CSS を工夫して、中央のカラム(main の部分)がソースの上部になるようにできれば、もっと良いかもしれません。
(現在は、カゴやカテゴリが左カラムに配置されると、ソースの上部が占領され、SEO 効果が減少しやすいため)

もう少し余裕が出れば、当方でもいろいろやってみようかと思います。
ramrun
投稿日時: 2007/3/14 20:58
対応状況: −−−
仙人
登録日: 2006/11/3
居住地:
投稿: 789
Re: ブロック[現在のカゴの中]
遅レス失礼しました。

大河内様、SEOなど意識したことがなかったので、なるほど勉強になります。

引用:
更なるアイディアとしては、CSS を工夫して、中央のカラム(main の部分)がソースの上部になるようにできれば、もっと良いかもしれません。


確定申告も終わって手も空いてきたので、ボチボチいじってみようかと思います。

ブロック「おすすめ情報」などは無理にtableを廃止したせいか、IEでは表示が出ないことがときどきあるみたいで改善せねば(汗)。
IEが憎らしい...

引用:
XHTML Strict なのも嬉しいですが、a タグの target 属性が使えなくなる等、表現の自由度が減ってしまうため、 XHTML Transitional の方が良いかもしれません。


こちらはとりあえず、Strictっぽく?作っていこうかなぁと思ってます。
ゲスト
投稿日時: 2007/4/14 16:22
対応状況: −−−
Re: ブロック[現在のカゴの中]
ramrunさん
杉沼(初心者)です。

2007-04-13 かごの中の機能を復活!!!
サンプルサイト
http://ryusendo.no-ip.biz/
このかごの中すばらしいですね。

またまたブロックのかごの中を見せていただけないでしょうか?
よろしくお願いします。
ゲスト
投稿日時: 2007/4/14 19:34
対応状況: −−−
Re: ブロック[現在のカゴの中]
追記です。

かごの中へブロックのかごの中ソースをコピペしてみたのですが、
画像が表示されません。


<!--{$arrCartList[cnt].img}-->&
この文があやしいのですが、

他に書きくわえしないといけない場所はありますか?

よろしくお願いします
ramrun
投稿日時: 2007/4/15 11:13
対応状況: −−−
仙人
登録日: 2006/11/3
居住地:
投稿: 789
Re: ブロック[現在のカゴの中]
ちと難しいですよ。
下記のコード(赤字部分のあたり)を変更もしくは追加してもらう必要があります。

eccube/html/frontparts/bloc/cart.php
if (count($_SESSION[$objCart->key]) > 0){
	// カート情報を取得
	$arrCartList = $objCart->getCartList();
	
	// カート内の商品ID一覧を取得
	$arrAllProductID = $objCart->getAllProductID();
	// 商品が1つ以上入っている場合には商品名称を取得
	if (count($arrAllProductID) > 0){
		$objQuery = new SC_Query();
		$arrVal = array();
		$sql = "";
		$sql = "SELECT product_id,name,main_list_image FROM dtb_products WHERE product_id IN ( ?";
		$arrVal = array($arrAllProductID[0]);
		for($i = 1 ; $i < count($arrAllProductID) ; $i++){
			$sql.= " ,? ";
			array_push($arrVal, $arrAllProductID[$i]);
		}
		$sql.= " )";
		
		$arrProduct_list = $objQuery->getAll($sql, $arrVal);
		
		$item_list = array();
		for($i = 0; $i < count($arrProduct_list); $i++){
			$item_list[$arrProduct_list[$i]['product_id']]['name'] = $arrProduct_list[$i]['name'];
			$item_list[$arrProduct_list[$i]['product_id']]['main_list_image'] = $arrProduct_list[$i]['main_list_image'];
		}
		for($i = 0; $i < count($arrCartList); $i++){
			$arrCartList[$i]['product_name'] = $item_list[$arrCartList[$i]['id'][0]]['name'];
			$arrCartList[$i]['img'] = $item_list[$arrCartList[$i]['id'][0]]['main_list_image'];
		}
	}
	// 店舗情報の取得
	$arrInfo = $objSiteInfo->data;
	// 購入金額合計
	$ProductsTotal = $objCart->getAllProductsTotal($arrInfo);
	
	// 合計個数
	$TotalQuantity = $objCart->getTotalQuantity();
	
	// 送料無料までの金額
	$arrCartList[0]['ProductsTotal'] = $ProductsTotal;
	$arrCartList[0]['TotalQuantity'] = $TotalQuantity;
	$deliv_free = $arrInfo['free_rule'] - $ProductsTotal;
	$arrCartList[0]['free_rule'] = $arrInfo['free_rule'];
	$arrCartList[0]['deliv_free'] = $deliv_free;
	
	$objSubPage->arrCartList = $arrCartList;
	$objSubPage->arrInfo = $arrInfo;
}


cart_delitem.phpは商品リスト削除用のコードで、新規に作成してください。
eccube/html/frontparts/bloc/cart_delitem.php
<?php

require_once("../../require.php");

$objCartSess = new SC_CartSession("", false);

switch($_POST['mode']) {
case 'up':
    $objCartSess->upQuantity($_POST['cart_no']);
    header("Location: " . URL_DIR);
    break;
case 'down':
    $objCartSess->downQuantity($_POST['cart_no']);
    header("Location: " . URL_DIR);
    break;
case 'delete':
    $objCartSess->delProduct($_POST['cart_no']);
    header("Location: " . URL_DIR);
    break;
default:
    header("Location: " . URL_DIR);
    break;
}

?>


商品一覧よりカゴに入れた場合の処理
eccube/html/products/list.php
if($_POST['mode'] == "cart" && $_POST['product_id'] != "") {
	// 値の正当性チェック
	if(!sfIsInt($_POST['product_id']) || !sfIsRecord("dtb_products", "product_id", $_POST['product_id'], "del_flg = 0 AND status = 1")) {
		sfDispSiteError(PRODUCT_NOT_FOUND);
	} else {
		// 入力値の変換
		$objPage->arrErr = lfCheckError($_POST['product_id']);
		if(count($objPage->arrErr) == 0) {
			$objCartSess = new SC_CartSession();
			
			$objSiteInfo = new SC_SiteInfo;
			// 店舗情報の取得
			$arrInfo = $objSiteInfo->data;
			
			$classcategory_id = "classcategory_id". $_POST['product_id'];
			$classcategory_id1 = $_POST[$classcategory_id. '_1'];
			$classcategory_id2 = $_POST[$classcategory_id. '_2'];
			$quantity = "quantity". $_POST['product_id'];
			// 規格1が設定されていない場合
			if(!$objPage->tpl_classcat_find1[$_POST['product_id']]) {
				$classcategory_id1 = '0';
			}
			// 規格2が設定されていない場合
			if(!$objPage->tpl_classcat_find2[$_POST['product_id']]) {
				$classcategory_id2 = '0';
			}
			$objCartSess->setPrevURL($_SERVER['REQUEST_URI']);
			$objCartSess->addProduct(array($_POST['product_id'], $classcategory_id1, $classcategory_id2), $_POST[$quantity]);
			$objPage = sfTotalCart($objPage, $objCartSess, $arrInfo);
			header("Location: " . $objCartSess->getPrevURL() . "#top");
			exit;
		}
	}
}


商品詳細よりカゴに入れたときの処理
eccube/html/products/detail.php
switch($_POST['mode']) {
case 'cart':
	// 入力値の変換
	$objFormParam->convParam();
	$objPage->arrErr = lfCheckError();
	if(count($objPage->arrErr) == 0) {
		$objCartSess = new SC_CartSession();
		
		$objSiteInfo = new SC_SiteInfo;
		// 店舗情報の取得
		$arrInfo = $objSiteInfo->data;
		
		$classcategory_id1 = $_POST['classcategory_id1'];
		$classcategory_id2 = $_POST['classcategory_id2'];
				
		// 規格1が設定されていない場合
		if(!$objPage->tpl_classcat_find1) {
			$classcategory_id1 = '0';
		}
		
		// 規格2が設定されていない場合
		if(!$objPage->tpl_classcat_find2) {
			$classcategory_id2 = '0';
		}
		
		$objCartSess->setPrevURL($_SERVER['REQUEST_URI']);
		$objCartSess->addProduct(array($_POST['product_id'], $classcategory_id1, $classcategory_id2), $objFormParam->getValue('quantity'));
		$objPage = sfTotalCart($objPage, $objCartSess, $arrInfo);
		header("Location: " . $objCartSess->getPrevURL() . "#top");
		exit;
	}
	break;
		
default:
	break;
}


テンプレートはテーブルタグをやめてしまったので、ご自分のテンプレートに合わせて修正が必要でしょうか。
一応、大事なところは青くしておきます。
eccube/html/user_data/include/bloc/cart.tpl
<!--{*
* Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved.
*
* http://www.lockon.co.jp/
*}-->
<!--▼現在のカゴの中ここから-->
<div class="sb-base">

	<!--★タイトル★-->
	<h4><img src="<!--{$smarty.const.URL_DIR}-->img/side/title_cartin.jpg" alt="現在のカゴの中" /></h4>

	<div class="sb-main">
		<div class="sb-content">

			<!--★商品点数★-->
			<div><span class="fs10">商品数:<!--{$arrCartList.0.TotalQuantity|number_format|default:0}-->点</span></div>

			<!--{if $arrCartList.0.TotalQuantity > 0}-->
			<form name="form2" id="form2" method="post" action="<!--{$smarty.const.URL_DIR}-->frontparts/bloc/cart_delitem.php">
			<input type="hidden" name="mode" value="delete" />
			<input type="hidden" name="cart_no" value="" />
			<!--{section name=cnt loop=$arrCartList}-->
			<div style="margin-bottom:5px">
				<!--★商品画像★-->
				<div style="width:50px;float:left"><a href="<!--{$smarty.const.URL_DIR}-->cart/index.php">
					<img src="<!--{$smarty.const.SITE_URL}-->resize_image.php?image=<!--{$smarty.const.IMAGE_SAVE_DIR}-->/<!--{$arrCartList[cnt].img}-->&width=48&height=48" alt="<!--{$arrCartList[cnt].product_name|escape}-->" />
				</a></div>
				
				<div style="width:95px;float:right">
					<!--★商品名★-->
					<div style="color:#4a6fa6;font-size:14px">
						<strong><!--{$arrCartList[cnt].product_name|escape}--></strong>
					</div>
					
					<!--★販売価格×数量★-->
					<div style="text-align:right;font-size:12px">
						<!--{$arrCartList[cnt].price|sfPreTax:$arrInfo.tax:$arrInfo.tax_rule|number_format|default:0}-->円×<!--{$arrCartList[cnt].quantity|escape}-->
						<a href="<!--{$smarty.const.URL_DIR}-->frontparts/bloc/cart_delitem.php" onclick="fnFormModeSubmit('form2', 'delete', 'cart_no', '<!--{$arrCartList[cnt].cart_no}-->'); return false;"><img src="<!--{$smarty.const.URL_DIR}-->img/contents/icon_delete.jpg" alt="この商品の購入を取り消す" /></a>
					</div>
				</div><br style="clear:both" />
			</div>
			<!--{/section}-->
			</form>
			<!--{/if}-->

			<!--★区切り線★-->
			<hr />

			<!--★合計★-->
			<div style="margin-bottom:5px;text-align:right">
				<span class="redst"><span class="fs14">合計:<!--{$arrCartList.0.ProductsTotal|number_format|default:0}-->円</span></span>
			</div>

			<!--★カゴの中に商品がある場合にのみ表示★-->
			<!--{if $arrCartList.0.TotalQuantity > 0 and $arrCartList.0.free_rule > 0}-->
				<div style="margin-bottom:10px">
					<span class="fs10">
					<!--{if $arrCartList.0.deliv_free > 0}-->
						送料手数料無料まであと<!--{$arrCartList.0.deliv_free|number_format|default:0}-->円(税込)です。
					<!--{else}-->
						現在、送料は「<span class="redst">無料</span>」です。
					<!--{/if}-->
					</span>
				</div>
			<!--{/if}-->

			<!--★ボタン★-->
			<div style="margin-top:5px;text-align:center">
				<a href="<!--{$smarty.const.URL_DIR}-->cart/index.php" onmouseover="chgImg('<!--{$smarty.const.URL_DIR}-->img/side/button_cartin_on.gif','button_cartin');" onmouseout="chgImg('<!--{$smarty.const.URL_DIR}-->img/side/button_cartin.gif','button_cartin');"><img src="<!--{$smarty.const.URL_DIR}-->img/side/button_cartin.gif" alt="カゴの中を見る" name="button_cartin" /></a>
			</div>
		</div>
	</div>
	<div class="sb-bottom"></div>
</div>
<!--▲現在のカゴの中ここまで-->

loc
投稿日時: 2007/4/16 12:00
対応状況: 解決済
半人前
登録日: 2007/4/14
居住地:
投稿: 12
Re: ブロック[現在のカゴの中]
ramrunさま
locです。
わかりやすく解説ありがとうございます。
赤色 青色の部分を挿入し、無事同じカートがカスタマイズされました。本当にありがとうございます。
見やすく、使いやすいカートですね。ありがとうございます。
loc
投稿日時: 2007/4/23 17:40
対応状況: −−−
半人前
登録日: 2007/4/14
居住地:
投稿: 12
Re: ブロック[現在のカゴの中]
ramrun さん
再びLOCです。ご教授いただいた 使いやすいカートの
商品キャンセルボタン”X ”について質問です。
現在、キャンセルボタンを押して商品をキャンセルするとTOPページに飛んでしまうのですが、これを商品だけ、キャンセルして、その場のページにとどまるにはどのように書き換えればいいのでしょうか?

質問ばかりで申し訳ないです。よろしくお願いします。


(1) 2 »
スレッド表示 | 新しいものから 前のトピック | 次のトピック | トップ


 



ログイン


EC-CUBE公式 Amazon Payプラグイン

統計情報

総メンバー数は88,301名です
総投稿数は109,692件です

投稿数ランキング

1
seasoft
7365
2
468
3217
3
AMUAMU
2712
4
nanasess
2303
5
umebius
2085
6
yuh
1818
7
h_tanaka
1610
8
red
1568
9
mcontact
1240
10
tsuji
958
11
fukap
907
12
shutta
835
13
tao_s
796
14 ramrun 789
15 karin 689
16 sumida 641
17
homan
633
18 DELIGHT 572
19
patapata
502
20
flealog
485


ネットショップの壺

EC-CUBEインテグレートパートナー

Copyright© EC-CUBE CO.,LTD. All Rights Reserved.