<?php /* $Id: product_info.php,v 1.7 2005/03/01 10:03:23 hiroyuki Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); //3D属性を持っていたら別ページデザインで表示 $sql = sprintf( "select * from %s where products_id='%s'", TABLE_PRODUCTS_3D, (int)$HTTP_GET_VARS['products_id'] ) ; $threed_info_query = tep_db_query( $sql ); if ( tep_db_num_rows($threed_info_query) ) { $threedInfo = tep_db_fetch_array($threed_info_query) ; require( 'product_info_3d.php' ); exit ; } // 2005-08-06 delete // require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO); define('TEXT_PRODUCT_NOT_FOUND', '商品が見つかりません...'); define('TEXT_CURRENT_REVIEWS', '最新のレビュー:'); define('TEXT_MORE_INFORMATION', 'もっと詳しい情報は、この商品の<a href="%s" target="_blank">ウェブページでご覧ください</a>。'); define('TEXT_DATE_ADDED', 'この商品は %s にカタログに登録されました。'); define('TEXT_DATE_AVAILABLE', '<span class="warning">この商品は %s に入荷予定です。</span>'); define('TEXT_ALSO_PURCHASED_PRODUCTS', 'この商品を買った人は、こんな商品も買っています'); define('TEXT_CLICK_TO_ENLARGE', '【イメージを拡大】'); define('TEXT_PRODUCT_QTY', '個数:'); define('TEXT_OPEN_PRICE', 'オープン価格'); define('TEXT_IN_STOCK', '現在の在庫数:'); define('TEXT_IN_STOCK_TAIL', '個'); define('TEXT_OUT_OF_STOCK', '完売しました'); define('TEXT_OUT_OF_STOCK2', '現在在庫がございませんが、ご注文承ります'); define('TEXT_PRODUCT_OPTIONS', '▼ 下記の選択肢からご希望の商品をお選びください。'); define('TEXT_MATRIX_OPTIONS', '▼ 下記のリストからご希望の商品をお選びください。'); define('TEXT_MATRIX_SOLDOUT', '×・・・売り切れ'); define('TEXT_MATRIX_SHORT', '△・・・残りわずか'); define('TEXT_MATRIX_OUT_OF_STOCK', '完売しました'); define('MATRIX_SHORT','△'); define('MATRIX_ZERO','×'); define('TEXT_CONTACT_US','について'); $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_qda, p.products_image, p.products_subimage1, p.products_subimage2, p.products_subimage3, p.products_subimage4, p.products_subimage5, p.products_subimage6, p.products_bimage, p.products_bsubimage1, p.products_bsubimage2, p.products_bsubimage3, p.products_bsubimage4, p.products_bsubimage5, p.products_bsubimage6, pd.products_url, p.products_price, p.regular_price, p.open_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . $languages_id . "'"); if (tep_db_num_rows($product_info_query)) { $product_info = tep_db_fetch_array($product_info_query); } // カテゴリ説明文の取得 2005-08-22 add $products_categories_desc = array(); $products_categories_desc = get_category_desc($HTTP_GET_VARS['products_id']); if (count($products_categories_desc) > 0 ) { $oscaTplt->assign('products_categories_desc', $products_categories_desc); } // メーカー名の取得 2005-08-25 add $oscaTplt->assign('manufacturers_name', get_manufacturers_name($product_info['manufacturers_id'])); // $products_name_striped = strip_tags($product_info['products_name']); $subtitle = $products_name_striped; require(DIR_WS_INCLUDES . 'header.php'); $matrix_attributes_query = tep_db_query("select count(*) as total from " . TABLE_MATRIX_ATTRIBUTES . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'"); $matrix_attributes = tep_db_fetch_array($matrix_attributes_query); $out_of_stock = tep_check_stock_from_products_id($HTTP_GET_VARS['products_id']); if($HTTP_GET_VARS['error']){ $messageStack->add('option', $HTTP_GET_VARS['error']); } $oscaTplt->assign('form_link',tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action','error_message')) . 'action=add_product')); if (!tep_db_num_rows($product_info_query)) { // product not found in database $oscaTplt->assign('product_not_found',TEXT_PRODUCT_NOT_FOUND); // 2006-04-26 $pagetop_lnk = tep_href_link(basename($PHP_SELF), tep_get_all_get_params()) . "#pagetop"; $oscaTplt->assign("pagetop_lnk", $pagetop_lnk); $oscaTplt->assign("default_lnk", tep_href_link(FILENAME_DEFAULT)); $oscaTplt->assign("button_top_img", tep_image_button('button_top.gif', IMAGE_BUTTON_TOP)); } else { tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . $languages_id . "'"); // 基本情報 $oscaTplt->assign('products_name',$product_info['products_name']); $oscaTplt->assign('product_qty',TEXT_PRODUCT_QTY); $oscaTplt->assign('products_model',$product_info['products_model']); $oscaTplt->assign('products_description',$product_info['products_description']); // 価格表示 if ($new_price = tep_get_products_special_price($product_info['products_id'])) { $oscaTplt->assign('products_total_price',$currencies->display_total_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']))); $oscaTplt->assign('new_total_price',$currencies->display_total_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id']))); $oscaTplt->assign('new_hontai_price',$currencies->display_hontai_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id']))); if (MODULE_EXTENSION_POINTS_STATUS == 'true') { $oscaTplt->assign('points_awarded',floor($new_price * POINTS_PER_DOLLAR_PURCHASE / 100)); } } else { $oscaTplt->assign('products_total_price',$currencies->display_total_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']))); $oscaTplt->assign('products_hontai_price',$currencies->display_hontai_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']))); if (MODULE_EXTENSION_POINTS_STATUS == 'true') { $oscaTplt->assign('points_awarded',floor($product_info['products_price'] * POINTS_PER_DOLLAR_PURCHASE / 100)); } } if($product_info['open_price'] == 1) { $oscaTplt->assign('open_price',TEXT_OPEN_PRICE); } elseif($product_info['open_price'] == 2) { $oscaTplt->assign('regular_total_price',$currencies->display_total_price($product_info['regular_price'], tep_get_tax_rate($product_info['products_tax_class_id']))); $oscaTplt->assign('regular_hontai_price',$currencies->display_hontai_price($product_info['regular_price'], tep_get_tax_rate($product_info['products_tax_class_id']))); } // 在庫表示 $oscaTplt->assign('out_of_stock', $out_of_stock); if ($matrix_attributes['total'] > 0) { // 在庫選択肢があるとき if($out_of_stock == '3') { $lc_text = TEXT_OUT_OF_STOCK; $lc_class = ' class="warning"'; } } else { switch ($product_info['products_qda']) { case '0': // 在庫数表示しない if ($product_info['products_quantity'] > 0) { $lc_text = ''; } else { if(STOCK_ALLOW_CHECKOUT == 'true') { $lc_text = TEXT_OUT_OF_STOCK2; $lc_class = ' class="warning"'; } else { $lc_text = TEXT_OUT_OF_STOCK; $lc_class = ' class="warning"'; } } break; case '1': // 在庫数表示する if ($product_info['products_quantity'] > 0) { $lc_text = TEXT_IN_STOCK . $product_info['products_quantity'] . TEXT_IN_STOCK_TAIL; $lc_class = ''; } else { if(STOCK_ALLOW_CHECKOUT == 'true') { $lc_text = TEXT_OUT_OF_STOCK2; $lc_class = ' class="warning"'; } else { $lc_text = TEXT_OUT_OF_STOCK; $lc_class = ' class="warning"'; } } break; case '2': // 在庫管理しない $lc_text = ''; break; default: $lc_text = ''; } } $oscaTplt->assign('lc_text', $lc_text); $oscaTplt->assign('lc_class', $lc_class); // 項目選択肢が存在する際のエラー表示 if ($messageStack->size('option') > 0) { $oscaTplt->assign('message',$messageStack->output('option')); } // 2005-10-01 add //画像イメージ未登録で「予約受付中」カテゴリの商品なら「写真準備中」の画像を表示 if (!tep_not_null($product_info['products_image'])) { $prod_cat_query = tep_db_query("SELECT count(products_id) as pcount FROM " . TABLE_PRODUCTS_TO_CATEGORIES . " WHERE products_id=" . $product_info['products_id'] . " and categories_id=" . CATEGORY_ID_2); if (tep_db_num_rows($prod_cat_query)>0) { $pcount_result = tep_db_fetch_array($prod_cat_query); if ($pcount_result['pcount'] > 0) { $product_info['products_image'] = "pleasewait.gif"; } } } if (!$product_info['products_bimage']) { $product_info['products_bimage'] = $product_info['products_image']; } if (!$product_info['products_bsubimage1']) { $product_info['products_bsubimage1'] = $product_info['products_subimage1']; } if (!$product_info['products_bsubimage2']) { $product_info['products_bsubimage2'] = $product_info['products_subimage2']; } if (!$product_info['products_bsubimage3']) { $product_info['products_bsubimage3'] = $product_info['products_subimage3']; } if (!$product_info['products_bsubimage4']) { $product_info['products_bsubimage4'] = $product_info['products_subimage4']; } if (!$product_info['products_bsubimage5']) { $product_info['products_bsubimage5'] = $product_info['products_subimage5']; } if (!$product_info['products_bsubimage6']) { $product_info['products_bsubimage6'] = $product_info['products_subimage6']; } $oscaTplt->assign('click_to_enlarge',TEXT_CLICK_TO_ENLARGE); // メイン画像 if (tep_not_null($product_info['products_image'])) { //2005-10-01 add if ($product_info['products_image'] != "pleasewait.gif") { $products_image = '<script language="javascript"><!--'."n"; $products_image .= 'document.write('<a href="javascript:popupWindow('' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id'] . '&tID=0') . '')">'; //2005-10-01 add } $products_image .= tep_image(DIR_WS_IMAGES . $product_info['products_bimage'], addslashes($products_name_striped), MAIN_IMAGE_WIDTH, MAIN_IMAGE_HEIGHT, 'hspace="5" vspace="5"'); //2005-10-01 add if ($product_info['products_image'] != "pleasewait.gif") { $products_image .= '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>')'."n"; $products_image .= '//--></script>'."n"; $products_image .= '<noscript>'."n"; $products_image .= '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '">' . tep_image(DIR_WS_IMAGES . $product_info['products_bimage'], $products_name_striped, MAIN_IMAGE_WIDTH, MAIN_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'."n"; $products_image .= '</noscript>'."n"; //2005-10-01 add } $oscaTplt->assign('products_image',$products_image); $products_image_tag = tep_image(DIR_WS_IMAGES . $product_info['products_bimage'], addslashes($products_name_striped), MAIN_IMAGE_WIDTH, MAIN_IMAGE_HEIGHT); $popup_image_link = tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id'] . '&tID=0'); $non_popup_image_link = tep_href_link(DIR_WS_IMAGES . $product_info['products_image']); $oscaTplt->assign('products_image_tag',$products_image_tag); $oscaTplt->assign('popup_image_link',$popup_image_link); $oscaTplt->assign('non_popup_image_link',$non_popup_image_link); } if (tep_not_null($product_info['products_subimage1'])) { $products_image1 = '<script language="javascript"><!--'."n"; $products_image1 .= 'document.write('<a href="javascript:popupWindow('' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id'] . '&tID=1') . '')">' . tep_image(DIR_WS_IMAGES . $product_info['products_bsubimage1'], addslashes($products_name_striped), SUB_IMAGE_WIDTH, SUB_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a>')'."n"; $products_image1 .= '//--></script>'."n"; $products_image1 .= '<noscript>'."n"; $products_image1 .= '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_subimage1']) . '">' . tep_image(DIR_WS_IMAGES . $product_info['products_bsubimage1'], $products_name_striped, SUB_IMAGE_WIDTH, SUB_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a>'."n"; $products_image1 .= '</noscript>'."n"; $oscaTplt->assign('products_subimage1',$products_image1); $products_image_tag1 = tep_image(DIR_WS_IMAGES . $product_info['products_bsubimage1'], addslashes($products_name_striped)); $popup_image_link1 = tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id'] . '&tID=1'); $non_popup_image_link1 = tep_href_link(DIR_WS_IMAGES . $product_info['products_subimage1']); $oscaTplt->assign('popup_image_link1',$popup_image_link1); $oscaTplt->assign('products_subimage_tag1',$products_image_tag1); $oscaTplt->assign('non_popup_image_link1',$non_popup_image_link1); // 2005-08-21 add $subimage_exist = true; // } if (tep_not_null($product_info['products_subimage2'])) { $products_image2 = '<script language="javascript"><!--'."n"; $products_image2 .= 'document.write('<a href="javascript:popupWindow('' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id'] . '&tID=2') . '')">' . tep_image(DIR_WS_IMAGES . $product_info['products_bsubimage2'], addslashes($products_name_striped), SUB_IMAGE_WIDTH, SUB_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a>')'."n"; $products_image2 .= '//--></script>'."n"; $products_image2 .= '<noscript>'."n"; $products_image2 .= '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_subimage2']) . '">' . tep_image(DIR_WS_IMAGES . $product_info['products_bsubimage2'], $products_name_striped, SUB_IMAGE_WIDTH, SUB_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a>'."n"; $products_image2 .= '</noscript>'."n"; $oscaTplt->assign('products_subimage2',$products_image2); $products_image_tag2 = tep_image(DIR_WS_IMAGES . $product_info['products_bsubimage2'], addslashes($products_name_striped)); $popup_image_link2 = tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id'] . '&tID=2'); $non_popup_image_link2 = tep_href_link(DIR_WS_IMAGES . $product_info['products_subimage2']); $oscaTplt->assign('popup_image_link2',$popup_image_link2); $oscaTplt->assign('products_subimage_tag2',$products_image_tag2); $oscaTplt->assign('non_popup_image_link2',$non_popup_image_link2); // 2005-08-21 add $subimage_exist = true; // } if (tep_not_null($product_info['products_subimage3'])) { $products_image3 = '<script language="javascript"><!--'."n"; $products_image3 .= 'document.write('<a href="javascript:popupWindow('' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id'] . '&tID=3') . '')">' . tep_image(DIR_WS_IMAGES . $product_info['products_bsubimage3'], addslashes($products_name_striped), SUB_IMAGE_WIDTH, SUB_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a>')'."n"; $products_image3 .= '//--></script>'."n"; $products_image3 .= '<noscript>'."n"; $products_image3 .= '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_subimage3']) . '">' . tep_image(DIR_WS_IMAGES . $product_info['products_bsubimage3'], $products_name_striped, SUB_IMAGE_WIDTH, SUB_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a>'."n"; $products_image3 .= '</noscript>'."n"; $oscaTplt->assign('products_subimage3',$products_image3); $products_image_tag3 = tep_image(DIR_WS_IMAGES . $product_info['products_bsubimage3'], addslashes($products_name_striped)); $popup_image_link3 = tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id'] . '&tID=3'); $non_popup_image_link3 = tep_href_link(DIR_WS_IMAGES . $product_info['products_subimage3']); $oscaTplt->assign('popup_image_link3',$popup_image_link3); $oscaTplt->assign('products_subimage_tag3',$products_image_tag3); $oscaTplt->assign('non_popup_image_link3',$non_popup_image_link3); // 2005-08-21 add $subimage_exist = true; // } if (tep_not_null($product_info['products_subimage4'])) { $products_image4 = '<script language="javascript"><!--'."n"; $products_image4 .= 'document.write('<a href="javascript:popupWindow('' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id'] . '&tID=4') . '')">' . tep_image(DIR_WS_IMAGES . $product_info['products_bsubimage4'], addslashes($products_name_striped), SUB_IMAGE_WIDTH, SUB_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a>')'."n"; $products_image4 .= '//--></script>'."n"; $products_image4 .= '<noscript>'."n"; $products_image4 .= '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_subimage4']) . '">' . tep_image(DIR_WS_IMAGES . $product_info['products_bsubimage4'], $products_name_striped, SUB_IMAGE_WIDTH, SUB_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a>'."n"; $products_image4 .= '</noscript>'."n"; $oscaTplt->assign('products_subimage4',$products_image4); $products_image_tag4 = tep_image(DIR_WS_IMAGES . $product_info['products_bsubimage4'], addslashes($products_name_striped)); $popup_image_link4 = tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id'] . '&tID=4'); $non_popup_image_link4 = tep_href_link(DIR_WS_IMAGES . $product_info['products_subimage4']); $oscaTplt->assign('popup_image_link4',$popup_image_link4); $oscaTplt->assign('products_subimage_tag4',$products_image_tag4); $oscaTplt->assign('non_popup_image_link4',$non_popup_image_link4); // 2005-08-21 add $subimage_exist = true; // } if (tep_not_null($product_info['products_subimage5'])) { $products_image5 = '<script language="javascript"><!--'."n"; $products_image5 .= 'document.write('<a href="javascript:popupWindow('' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id'] . '&tID=5') . '')">' . tep_image(DIR_WS_IMAGES . $product_info['products_bsubimage5'], addslashes($products_name_striped), SUB_IMAGE_WIDTH, SUB_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a>')'."n"; $products_image5 .= '//--></script>'."n"; $products_image5 .= '<noscript>'."n"; $products_image5 .= '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_subimage5']) . '">' . tep_image(DIR_WS_IMAGES . $product_info['products_bsubimage5'], $products_name_striped, SUB_IMAGE_WIDTH, SUB_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a>'."n"; $products_image5 .= '</noscript>'."n"; $oscaTplt->assign('products_subimage5',$products_image5); $products_image_tag5 = tep_image(DIR_WS_IMAGES . $product_info['products_bsubimage5'], addslashes($products_name_striped)); $popup_image_link5 = tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id'] . '&tID=5'); $non_popup_image_link5 = tep_href_link(DIR_WS_IMAGES . $product_info['products_subimage5']); $oscaTplt->assign('popup_image_link5',$popup_image_link5); $oscaTplt->assign('products_subimage_tag5',$products_image_tag5); $oscaTplt->assign('non_popup_image_link5',$non_popup_image_link5); // 2005-08-21 add $subimage_exist = true; // } if (tep_not_null($product_info['products_subimage6'])) { $products_image6 = '<script language="javascript"><!--'."n"; $products_image6 .= 'document.write('<a href="javascript:popupWindow('' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id'] . '&tID=6') . '')">' . tep_image(DIR_WS_IMAGES . $product_info['products_bsubimage6'], addslashes($products_name_striped), SUB_IMAGE_WIDTH, SUB_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a>')'."n"; $products_image6 .= '//--></script>'."n"; $products_image6 .= '<noscript>'."n"; $products_image6 .= '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_subimage6']) . '">' . tep_image(DIR_WS_IMAGES . $product_info['products_bsubimage6'], $products_name_striped, SUB_IMAGE_WIDTH, SUB_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a>'."n"; $products_image6 .= '</noscript>'."n"; $oscaTplt->assign('products_subimage6',$products_image6); $products_image_tag6 = tep_image(DIR_WS_IMAGES . $product_info['products_bsubimage6'], addslashes($products_name_striped)); $popup_image_link6 = tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id'] . '&tID=6'); $non_popup_image_link6 = tep_href_link(DIR_WS_IMAGES . $product_info['products_subimage6']); $oscaTplt->assign('popup_image_link6',$popup_image_link6); $oscaTplt->assign('products_subimage_tag6',$products_image_tag6); $oscaTplt->assign('non_popup_image_link6',$non_popup_image_link6); // 2005-08-21 add $subimage_exist = true; // } // 2005-08-21 add if ($subimage_exist) { $oscaTplt->assign('subimage_exist', true); } // // 選択肢表示 $products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . $languages_id . "'"); $products_attributes = tep_db_fetch_array($products_attributes_query); $new_attributes_query = tep_db_query("select count(*) as total from " . TABLE_NEW_ATTRIBUTES . " na, " . TABLE_NEW_DESCRIPTION . " nd where na.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and na.products_new_attributes_id = nd.products_new_attributes_id and nd.language_id = '" . $languages_id . "'"); $new_attributes = tep_db_fetch_array($new_attributes_query); if ($products_attributes['total'] > 0 || $new_attributes['total'] > 0) { $oscaTplt->assign('text_product_options',TEXT_PRODUCT_OPTIONS); $product_options = '<table border="0" cellpadding="0" cellspacing"0">'; } // 項目選択肢表示 if ($products_attributes['total'] > 0) { $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . $languages_id . "' order by popt.products_options_id"); while ($products_options_name = tep_db_fetch_array($products_options_name_query)) { $selected = 0; $products_options_array = array(); $product_options .= '<tr><td>' . $products_options_name['products_options_name'] . ':</td><td>' . "n"; $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . $products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . $languages_id . "'"); while ($products_options = tep_db_fetch_array($products_options_query)) { $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']); if ($products_options['options_values_price'] != '0') { if(JPTAX == 'on') { $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_total_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . $currencies->display_hontai_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } else { $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_hontai_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } } } $product_options .= tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']]); $product_options .= '</td></tr>'; } } // 新項目選択肢表示 if ($new_attributes['total'] > 0) { $new_description_query = tep_db_query("select nd.products_new_attributes_id, nd.products_option, concat('nd:', nd.products_new_attributes_id) as ndid from " . TABLE_NEW_DESCRIPTION . " nd, " . TABLE_NEW_ATTRIBUTES . " na where na.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and na.products_new_attributes_id = nd.products_new_attributes_id and nd.language_id = '" . $languages_id . "' order by nd.products_new_attributes_id"); while ($new_description = tep_db_fetch_array($new_description_query)) { $selected = 0; $new_description_array = array(); $product_options .= '<tr><td>' . $new_description['products_option'] . ':</td><td>' . "n"; $new_description_values_query = tep_db_query("select * from " . TABLE_NEW_DESCRIPTION . " nd where products_new_attributes_id = '" . $new_description['products_new_attributes_id'] . "' and language_id = '" . $languages_id . "'"); while ($new_description_values = tep_db_fetch_array($new_description_values_query)) { for($i = 1; $i <=20; $i++) { if($new_description_values['products_value_'.$i]) { $new_description_array[] = array('id' => $i, 'text' => $new_description_values['products_value_'.$i]); } if ($new_description_values['products_price_'.$i] != '0') { if(JPTAX == 'on') { $new_description_array[sizeof($new_description_array)-1]['text'] .= ' (' . $new_description_values['products_prefix_'.$i] . $currencies->display_total_price($new_description_values['products_price_'.$i], tep_get_tax_rate($product_info['products_tax_class_id'])) . $currencies->display_hontai_price($new_description_values['products_price_'.$i], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } else { $new_description_array[sizeof($new_description_array)-1]['text'] .= ' (' . $new_description_values['products_prefix_'.$i] . $currencies->display_hontai_price($new_description_values['products_price_'.$i], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } } } } $product_options .= tep_draw_pull_down_menu('id[' . $new_description['ndid'] . ']', $new_description_array, $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$new_description['ndid']]); $product_options .= '</td></tr>'; } } if ($products_attributes['total'] > 0 || $new_attributes['total'] > 0) { $product_options .= '</table>'; $oscaTplt->assign('product_options',$product_options); } // 在庫選択肢表示 // matrix attributes start if ($matrix_attributes['total'] > 0) { $options = tep_db_query("select products_matrix_option, products_matrix_option_qty, concat('md:', products_matrix_attributes_id) as mdid from " . TABLE_MATRIX_ATTRIBUTES . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'"); $options_values = tep_db_fetch_array($options); $options_x1 = tep_db_query("select ma.products_matrix_attributes_id, md.products_xy_id, md.products_xy_title, products_value_1, products_value_2, products_value_3, products_value_4, products_value_5, products_value_6, products_value_7, products_value_8, products_value_9 from " . TABLE_MATRIX_ATTRIBUTES . " ma, " . TABLE_MATRIX_DESCRIPTION . " md where ma.products_matrix_attributes_id = md.products_matrix_attributes_id and ma.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and md.products_xy_id = 'x1' order by ma.products_matrix_attributes_id"); $options_y1 = tep_db_query("select ma.products_matrix_attributes_id, md.products_xy_id, md.products_xy_title, products_value_1, products_value_2, products_value_3, products_value_4, products_value_5, products_value_6, products_value_7, products_value_8, products_value_9 from " . TABLE_MATRIX_ATTRIBUTES . " ma, " . TABLE_MATRIX_DESCRIPTION . " md where ma.products_matrix_attributes_id = md.products_matrix_attributes_id and ma.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and md.products_xy_id = 'y1' order by ma.products_matrix_attributes_id"); $options_x2 = tep_db_query("select ma.products_matrix_attributes_id, md.products_xy_id, products_value_1, products_value_2, products_value_3, products_value_4, products_value_5, products_value_6, products_value_7, products_value_8, products_value_9 from " . TABLE_MATRIX_ATTRIBUTES . " ma, " . TABLE_MATRIX_DESCRIPTION . " md where ma.products_matrix_attributes_id = md.products_matrix_attributes_id and ma.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and md.products_xy_id = 'x2' order by ma.products_matrix_attributes_id"); $options_y2 = tep_db_query("select ma.products_matrix_attributes_id, md.products_xy_id, products_value_1, products_value_2, products_value_3, products_value_4, products_value_5, products_value_6, products_value_7, products_value_8, products_value_9 from " . TABLE_MATRIX_ATTRIBUTES . " ma, " . TABLE_MATRIX_DESCRIPTION . " md where ma.products_matrix_attributes_id = md.products_matrix_attributes_id and ma.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and md.products_xy_id = 'y2' order by ma.products_matrix_attributes_id"); $options_values_x1 = tep_db_fetch_array($options_x1); $options_values_y1 = tep_db_fetch_array($options_y1); $options_values_x2 = tep_db_fetch_array($options_x2); $options_values_y2 = tep_db_fetch_array($options_y2); if($options_values_x1['products_xy_title'] && $options_values_y1['products_xy_title']) { $option_title = $options_values_x1['products_xy_title'].' '.MATRIX_BY.' '.$options_values_y1['products_xy_title']."<br>n"; } elseif($options_values_x1['products_xy_title'] || $options_values_y1['products_xy_title']) { $option_title = $options_values_x1['products_xy_title'].$options_values_y1['products_xy_title']."<br>n"; } $array_x = array(); $array_y = array(); array_push($array_x, "0"); array_push($array_y, "0"); for($i = 1; $i <=9; $i++) { if($options_values_x1['products_value_'.$i]) { array_push($array_x, $i); } if($options_values_y1['products_value_'.$i]) { array_push($array_y, $i); } } $count_x = count($array_x); $count_y = count($array_y); $cart_mdid = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$options_values['mdid']]; $oscaTplt->assign('text_matrix_options',TEXT_MATRIX_OPTIONS); $matrix_options = '<table border="0" cellpadding="0" cellspacing"0"><tr><td>' . $option_title . '</td></tr>'; $matrix_options .= '<tr><td>'; $matrix_options .= '<table border="1" cellspacing="0" cellpadding="4" bgcolor="#ffffff">'."n"; if($count_x == 1 && $count_y ==1) { } else { if($count_x == 1) { for($y = 1; $y < $count_y; $y++){ $xy = $y * 10 + 1; $options_xy = tep_db_query("select mq.products_xy_qty from " . TABLE_MATRIX_ATTRIBUTES . " ma, " . TABLE_MATRIX_QTY . " mq where ma.products_matrix_attributes_id = mq.products_matrix_attributes_id and ma.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and mq.products_xy = '" . $xy . "'"); $options_values_xy = tep_db_fetch_array($options_xy); $matrix_options .= '<tr><td align="center" bgcolor="#ffffcc">'.$options_values_y1['products_value_'.$array_y[$y]].'</td><td align="center">'; if($options_values_xy['products_xy_qty'] > 0) { if($cart_mdid == $xy){ $matrix_options .= tep_draw_radio_field('id[' . $options_values['mdid'] . ']', $xy, 'true'); } else { $matrix_options .= tep_draw_radio_field('id[' . $options_values['mdid'] . ']', $xy); } $matrix_options .= tep_get_matrix_qty($options_values_xy['products_xy_qty'], stripslashes($options_values['products_matrix_option']), stripslashes($options_values['products_matrix_option_qty'])); } else { $matrix_options .= MATRIX_ZERO; } $matrix_options .= '</td></tr>'."n"; } } elseif($count_y == 1) { $matrix_options .= '<tr>'; for($x = 1; $x < $count_x; $x++){ $matrix_options .= '<td align="center" bgcolor="#ffffcc">'.$options_values_x1['products_value_'.$array_x[$x]]."</td>"; } $matrix_options .= '</tr>'."n"; $matrix_options .= '<tr>'; for($x = 1; $x < $count_x; $x++){ $xy = 10 + $x; $options_xy = tep_db_query("select mq.products_xy_qty from " . TABLE_MATRIX_ATTRIBUTES . " ma, " . TABLE_MATRIX_QTY . " mq where ma.products_matrix_attributes_id = mq.products_matrix_attributes_id and ma.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and mq.products_xy = '" . $xy . "'"); $options_values_xy = tep_db_fetch_array($options_xy); $matrix_options .= '<td align="center">'; if($options_values_xy['products_xy_qty'] > 0) { if($cart_mdid == $xy){ $matrix_options .= tep_draw_radio_field('id[' . $options_values['mdid'] . ']', $xy, 'true'); } else { $matrix_options .= tep_draw_radio_field('id[' . $options_values['mdid'] . ']', $xy); } $matrix_options .= tep_get_matrix_qty($options_values_xy['products_xy_qty'], stripslashes($options_values['products_matrix_option']), stripslashes($options_values['products_matrix_option_qty'])); } else { $matrix_options .= MATRIX_ZERO; } $matrix_options .= '</td>'; } $matrix_options .= '</tr>'."n"; } else { $matrix_options .= '<tr><td bgcolor="#ffffcc"> </td>'; for($x = 1; $x < $count_x; $x++){ $matrix_options .= '<td align="center" bgcolor="#ffffcc">'.$options_values_x1['products_value_'.$array_x[$x]]."</td>"; } $matrix_options .= '</tr>'."n"; for($y = 1; $y < $count_y; $y++){ $matrix_options .= '<tr><td align="center" bgcolor="#ffffcc">'.$options_values_y1['products_value_'.$array_y[$y]]."</td>"; for($x = 1; $x < $count_x; $x++){ $xy = $y * 10 + $x; $options_xy = tep_db_query("select mq.products_xy_qty from " . TABLE_MATRIX_ATTRIBUTES . " ma, " . TABLE_MATRIX_QTY . " mq where ma.products_matrix_attributes_id = mq.products_matrix_attributes_id and ma.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and mq.products_xy = '" . $xy . "'"); $options_values_xy = tep_db_fetch_array($options_xy); $matrix_options .= '<td align="center">'; if($options_values_xy['products_xy_qty'] > 0) { if($cart_mdid == $xy){ $matrix_options .= tep_draw_radio_field('id[' . $options_values['mdid'] . ']', $xy, 'true'); } else { $matrix_options .= tep_draw_radio_field('id[' . $options_values['mdid'] . ']', $xy); } $matrix_options .= tep_get_matrix_qty($options_values_xy['products_xy_qty'], stripslashes($options_values['products_matrix_option']), stripslashes($options_values['products_matrix_option_qty'])); } else { $matrix_options .= MATRIX_ZERO; } $matrix_options .= '</td>'; } } $matrix_options .= '</tr>'."n"; } } $matrix_options .= '</table>'."n"; $matrix_options .= '<tr><td>' . TEXT_MATRIX_SOLDOUT; if($options_values['products_matrix_option'] == "2") { $matrix_options .= '  '.TEXT_MATRIX_SHORT; } $matrix_options .= '</td></tr>'; $matrix_options .= '</table>'; $oscaTplt->assign('matrix_options',$matrix_options); } // matrix attributes end // レビュー数表示 $reviews = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " where products_id = '" . $HTTP_GET_VARS['products_id'] . "'"); $reviews_values = tep_db_fetch_array($reviews); if ($reviews_values['count'] > 0) { $oscaTplt->assign('text_current_reviews',TEXT_CURRENT_REVIEWS); $oscaTplt->assign('reviews_values',$reviews_values['count']); } // 関連URL表示 if (tep_not_null($product_info['products_url'])) { $oscaTplt->assign('products_url',sprintf(TEXT_MORE_INFORMATION, tep_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($product_info['products_url']), 'NONSSL', true, false))); } // 情報登録日、入荷日表示 if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) { $oscaTplt->assign('date_available',sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available']))); } else { $oscaTplt->assign('date_added',sprintf(TEXT_DATE_ADDED, tep_date_long($product_info['products_date_added']))); } $oscaTplt->assign('button_reviews','<a href="'.tep_href_link(FILENAME_PRODUCT_REVIEWS, substr(tep_get_all_get_params(array('error_message')), 0, -1)).'">'.tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS).'</a>'); if ($out_of_stock > 1) { $oscaTplt->assign('button_in_cart',tep_image_button('button_in_cart_na.gif', IMAGE_BUTTON_IN_CART_NA)); } else { $oscaTplt->assign('hidden_products_id',tep_draw_hidden_field('products_id', $product_info['products_id'])); $oscaTplt->assign('button_in_cart',tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART)); } //これを買った人は、こんなのも買ってます // if ( (USE_CACHE == 'true') && !SID ) { //$oscaTplt->assign('also_purchased',tep_cache_also_purchased(3600)); // } else { require(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS); // } // 友達に知らせる表示 $oscaTplt->assign("tell_a_friend",tep_href_link(FILENAME_TELL_A_FRIEND, 'products_id=' . $HTTP_GET_VARS['products_id'])); // お問い合わせ表示 $oscaTplt->assign("contuct_us",tep_href_link(FILENAME_CONTACT_US, 'products_id=' . $HTTP_GET_VARS['products_id'] . '&kind=inquiry')); } // 2005-08-29 add if (strstr($PHP_SELF, '.php')) { $oscaTplt->assign("contents_main", str_replace(".php", ".html", basename($PHP_SELF))); } else { $oscaTplt->assign("contents_main", str_replace(".cgi", ".html", basename($PHP_SELF))); } require(DIR_WS_INCLUDES . 'column_side.php'); require(DIR_WS_INCLUDES . 'footer.php'); require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>