Index: /branches/comu-ver2/data/class/SC_Product.php
===================================================================
--- /branches/comu-ver2/data/class/SC_Product.php	(revision 18277)
+++ /branches/comu-ver2/data/class/SC_Product.php	(revision 18278)
@@ -130,4 +130,7 @@
                 $classCategories[$productsClass1][$productsClass2]['point']
                     = SC_Utils_Ex::sfPrePoint($productsClass['price02'], $productsClass['point_rate']);
+                
+                // 商品コード
+                $classCategories[$productsClass1][$productsClass2]['product_code'] = $productsClass['product_code'];
             }
             
@@ -149,6 +152,6 @@
         // 商品規格取得
         $objQuery = new SC_Query();
-        $col = "product_id, classcategory_id1, classcategory_id2, class_id1, class_id2, stock, stock_unlimited, price01, price02, point_rate";
-        $table = "vw_product_class AS prdcls";
+        $col = 'product_id, classcategory_id1, classcategory_id2, class_id1, class_id2, stock, stock_unlimited, price01, price02, point_rate, product_code';
+        $table = 'vw_product_class AS prdcls';
         $where = 'product_id IN (' . implode(', ', array_pad(array(), count($arrProductId), '?')) . ')';
         $objQuery->setorder("product_id, rank1 DESC, rank2 DESC");
Index: /branches/comu-ver2/data/class/pages/products/LC_Page_Products_Detail.php
===================================================================
--- /branches/comu-ver2/data/class/pages/products/LC_Page_Products_Detail.php	(revision 18277)
+++ /branches/comu-ver2/data/class/pages/products/LC_Page_Products_Detail.php	(revision 18278)
@@ -232,10 +232,4 @@
         $this->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($product_id));
-        $arrProductCode = SC_Utils_Ex::sfswaparray($arrProductCode);
-        $this->arrProductCode = $arrProductCode["product_code"];
-
         // 購入制限数を取得
         if (!SC_Utils_Ex::sfIsInt($this->arrProduct['sale_limit']) || $this->arrProduct['sale_limit'] > SALE_LIMIT_MAX) {
@@ -444,10 +438,4 @@
         $arrRet = $objQuery->select("*", "vw_products_allclass_detail AS alldtl", "product_id = ?", array($product_id));
         $this->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($product_id));
-        $arrProductCode = SC_Utils_Ex::sfswaparray($arrProductCode);
-        $this->arrProductCode = $arrProductCode["product_code"];
 
         // 購入制限数を取得
Index: /branches/comu-ver2/data/Smarty/templates/default/detail.tpl
===================================================================
--- /branches/comu-ver2/data/Smarty/templates/default/detail.tpl	(revision 18277)
+++ /branches/comu-ver2/data/Smarty/templates/default/detail.tpl	(revision 18278)
@@ -53,4 +53,18 @@
     classcat2 = classCategories[classcat_id1][classcat_id2];
     
+    // 商品コード
+    eleDefault = document.getElementById('product_code_default');
+    eleDynamic = document.getElementById('product_code_dynamic');
+    if (
+           classcat2
+        && typeof classcat2.product_code != 'undefined'
+    ) {
+        eleDefault.style.display = 'none';
+        eleDynamic.innerHTML = classcat2.product_code;
+    } else {
+        eleDefault.style.display = '';
+        eleDynamic.innerHTML = '';
+    }
+    
     // 在庫(品切れ)
     eleDefault = document.getElementById('cartbtn_default');
@@ -159,12 +173,12 @@
 
             <!--★商品コード★-->
-            <!--{assign var=codecnt value=$arrProductCode|@count}-->
-            <!--{assign var=codemax value=`$codecnt-1`}-->
             <div>商品コード：
-                <!--{if $codecnt > 1}-->
-                    <!--{$arrProductCode.0}-->～<!--{$arrProductCode[$codemax]}-->
-                <!--{else}-->
-                    <!--{$arrProductCode.0}-->
-                <!--{/if}-->
+                <span id="product_code_default">
+                    <!--{if $arrProduct.product_code_min == $arrProduct.product_code_max}-->
+                        <!--{$arrProduct.product_code_min|escape}-->
+                    <!--{else}-->
+                        <!--{$arrProduct.product_code_min|escape}-->～<!--{$arrProduct.product_code_max|escape}-->
+                    <!--{/if}-->
+                </span><span id="product_code_dynamic"></span>
             </div>
             
