バージョン選択

フォーラム

メニュー

オンライン状況

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

サイト内検索

質問 > フロント機能 > 商品詳細ページのレイアウト

フロント機能

新規スレッドを追加する

フラット表示 前のトピック | 次のトピック
投稿者 スレッド
kameleon
投稿日時: 2007/8/17 12:17
対応状況: −−−
常連
登録日: 2007/4/25
居住地: 東京都
投稿: 39
Re: 商品詳細ページのレイアウト
アドバイスを頂き、下記のように実装したら動作しました!

念のため簡単にまとめておきます。

■やりたかったこと
一商品を他商品より目立たせたかった為、商品詳細ページのレイアウトを変更したい

■作業内容
管理画面より新規ページを追加

追加したページのphpファイルに下記を追加
引用:

<?php
require_once("/virtual/www/require.php");

class LC_Page {
function LC_Page() {
/** 必ず変更する **/
$this->tpl_mainpage = "/virtual/www/user_data/templates/(追加した新規ページ).tpl";
$this->tpl_css = '/css/layout/contact/index.css'; // メインCSSパス
global $arrSTATUS;
$this->arrSTATUS = $arrSTATUS;
global $arrSTATUS_IMAGE;
$this->arrSTATUS_IMAGE = $arrSTATUS_IMAGE;
global $arrDELIVERYDATE;
$this->arrDELIVERYDATE = $arrDELIVERYDATE;
global $arrRECOMMEND;
$this->arrRECOMMEND = $arrRECOMMEND;

/*
session_start時のno-cacheヘッダーを抑制することで
「戻る」ボタン使用時の有効期限切れ表示を抑制する。
private-no-expire:クライアントのキャッシュを許可する。
*/
session_cache_limiter('private-no-expire');
}
}

$objPage = new LC_Page();
$objView = new SC_SiteView();
$objCustomer = new SC_Customer();
$objQuery = new SC_Query();


// レイアウトデザインを取得
$objPage = sfGetPageLayout($objPage);

// パラメータ管理クラス
$objFormParam = new SC_FormParam();
// パラメータ情報の初期化
lfInitParam();
// POST値の取得
$objFormParam->setParam($_POST);

// ファイル管理クラス
$objUpFile = new SC_UploadFile(IMAGE_TEMP_DIR, IMAGE_SAVE_DIR);
// ファイル情報の初期化
lfInitFile();

if (empty($_POST['mode'])) {
$tmp_id = $_GET['product_id'];
} else {
$tmp_id = $_POST['product_id'];
}

// 値の正当性チェック
if(!sfIsInt($_GET['product_id']) || !sfIsRecord("dtb_products", "product_id", $tmp_id, $where)) {
sfDispSiteError(PRODUCT_NOT_FOUND);
}

// 規格選択セレクトボックスの作成
$objPage = lfMakeSelect($objPage, $tmp_id);

// 商品IDをFORM内に保持する。
$objPage->tpl_product_id = $tmp_id;

switch($_POST['mode']) {
case 'cart':
// 入力値の変換
$objFormParam->convParam();
$objPage->arrErr = lfCheckError();
if(count($objPage->arrErr) == 0) {
$objCartSess = new SC_CartSession();
$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'));
header("Location: " . URL_CART_TOP);

exit;
}
break;

default:
break;
}

$objQuery = new SC_Query();
// DBから商品情報を取得する。
$arrRet = $objQuery->select("*", "vw_products_allclass_detail AS alldtl", "product_id = ?", array($tmp_id));
$objPage->arrProduct = $arrRet[0];

// 商品コードの取得
$code_sql = "SELECT product_code FROM dtb_products_class AS prdcls WHERE prdcls.product_id = ? GROUP BY product_code ORDER BY product_code";
$arrProductCode = $objQuery->getall($code_sql, array($tmp_id));
$arrProductCode = sfswaparray($arrProductCode);
$objPage->arrProductCode = $arrProductCode["product_code"];

// 購入制限数を取得
if($objPage->arrProduct['sale_unlimited'] == 1 || $objPage->arrProduct['sale_limit'] > SALE_LIMIT_MAX) {
$objPage->tpl_sale_limit = SALE_LIMIT_MAX;
} else {
$objPage->tpl_sale_limit = $objPage->arrProduct['sale_limit'];
}

// サブタイトルを取得
$arrFirstCat = sfGetFirstCat($arrRet[0]['category_id']);
$tpl_subtitle = $arrFirstCat['name'];
$objPage->tpl_subtitle = $tpl_subtitle;

// DBからのデータを引き継ぐ
$objUpFile->setDBFileList($objPage->arrProduct);
// ファイル表示用配列を渡す
$objPage->arrFile = $objUpFile->getFormFileList(IMAGE_TEMP_URL, IMAGE_SAVE_URL, true);
// 支払方法の取得
$objPage->arrPayment = lfGetPayment();
// 入力情報を渡す
$objPage->arrForm = $objFormParam->getFormParamList();
//レビュー情報の取得
$objPage->arrReview = lfGetReviewData($tmp_id);
// トラックバック情報の取得

// トラックバック機能の稼働状況チェック
if (sfGetSiteControlFlg(SITE_CONTROL_TRACKBACK) != 1) {
$objPage->arrTrackbackView = "OFF";
} else {
$objPage->arrTrackbackView = "ON";
$objPage->arrTrackback = lfGetTrackbackData($tmp_id);
}
$objPage->trackback_url = TRACKBACK_TO_URL . $tmp_id;
// タイトルに商品名を入れる
$objPage->tpl_title = "商品詳細 ". $objPage->arrProduct["name"];
//オススメ商品情報表示
$objPage->arrRecommend = lfPreGetRecommendProducts($tmp_id);
//この商品を買った人はこんな商品も買っています
$objPage->arrRelateProducts = lfGetRelateProducts($tmp_id);

// 拡大画像のウィンドウサイズをセット
$image_path = IMAGE_SAVE_DIR . basename($objPage->arrFile["main_large_image"]["filepath"]);
list($large_width, $large_height) = getimagesize($image_path);
$objPage->tpl_large_width = $large_width + 60;
$objPage->tpl_large_height = $large_height + 80;

lfConvertParam();

// 画面の表示
$objView->assignobj($objPage);
$objView->display(SITE_FRAME);


上記関数以下は、detail.phpの関数を引用しました。

http://○○.net/user_data/新規ページ.php?product_id=商品ID
にアクセス

上記手順で、他商品とは別の商品詳細ページを作成することができます!

説明が分かりづらかったらすみません

アドバイス頂き、ありがとうございました!
フラット表示 前のトピック | 次のトピック


題名 投稿者 日時
   商品詳細ページのレイアウト kameleon 2007/8/9 10:01
     Re: 商品詳細ページのレイアウト nanasess 2007/8/9 12:19
       Re: 商品詳細ページのレイアウト kameleon 2007/8/9 13:11
       Re: 商品詳細ページのレイアウト kameleon 2007/8/9 21:18
         Re: 商品詳細ページのレイアウト nanasess 2007/8/10 9:15
           Re: 商品詳細ページのレイアウト kameleon 2007/8/10 10:27
             Re: 商品詳細ページのレイアウト ryo 2007/8/10 10:45
             Re: 商品詳細ページのレイアウト nanasess 2007/8/10 16:09
               Re: 商品詳細ページのレイアウト kameleon 2007/8/10 18:43
                 Re: 商品詳細ページのレイアウト nanasess 2007/8/10 18:50
                 » Re: 商品詳細ページのレイアウト kameleon 2007/8/17 12:17

 



ログイン


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

統計情報

総メンバー数は90,354名です
総投稿数は110,371件です

投稿数ランキング

1
seasoft
7369
2
468
3217
3
AMUAMU
2712
4
nanasess
2314
5
umebius
2085
6
yuh
1819
7
h_tanaka
1693
8
red
1571
9
mcontact
1363
10
tsuji
958
11
fukap
907
12
shutta
835
13
tao_s
799
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.