仙人 登録日: 2011/3/27 居住地: 投稿: 309 |
Re: 【EC-CUBE 2.11.0】商品一覧、商品詳細画面での規格内容の表示、取得不具合 nanasess様 お返事頂きましてありがとうございます。 また、当方の度重なる理解不足でお手間を取らせてしまいまして 申し訳ございません・・・。 引用: ブラウザの JavaScript エラーが発生すると思います nanasess様が仰られる通り、phpエラーの方は違うようです。 (今回の取得作業中は1度も発生しませんでした。) 再度確認いたしましたところ、下記のエラーが出ておりました。 エラー: productsClassCategories[product_id][classcat_id1] is undefined ソースファイル: HPアドレス/js/products.js 行: 70 該当箇所のソースは以下の通りです。
function checkStock($form, product_id, classcat_id1, classcat_id2) {
classcat_id2 = classcat_id2 ? classcat_id2 : '';
var classcat2;
// 商品一覧時
if (typeof productsClassCategories != 'undefined') {
classcat2 = productsClassCategories[product_id][classcat_id1]['#' + classcat_id2];
}
// 詳細表示時
else {
classcat2 = classCategories[classcat_id1]['#' + classcat_id2];
}
引用: JSON エンコードされた JavaScript の記述があると思いますが、正常なパターンと, うまく表示されないパターンのソースを貼っていただけますでしょうか こちらは取得いたしました。(長いです。) 【商品一覧で正常時】 <script type="text/javascript">//<![CDATA[
var productsClassCategories = { ・・・
"205":{"":{"":{"name":"\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044","product_class_id":"2581","product_type":"1"}},"12":{"#":{"classcategory_id2":"","name":"\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044"},"#6":{"classcategory_id2":"6","name":"S","stock_find":true,"price01":"","price02":"840","point":"0","product_code":"商品コード1G","product_class_id":"2581","product_type":"1"},"#4":{"classcategory_id2":"4","name":"L","stock_find":true,"price01":"","price02":"1,260","point":"0","product_code":"商品コード2G","product_class_id":"2583","product_type":"1"}},"11":{"#":{"classcategory_id2":"","name":"\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044"},"#6":{"classcategory_id2":"6","name":"S (\u54c1\u5207\u308c\u4e2d)","stock_find":false,"price01":"","price02":"840","point":"0","product_code":"商品コード1E","product_class_id":"2584","product_type":"1"},"#4":{"classcategory_id2":"4","name":"L","stock_find":true,"price01":"","price02":"1,260","point":"0","product_code":"商品コード2E","product_class_id":"2586","product_type":"1"}},"10":{"#":{"classcategory_id2":"","name":"\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044"},"#6":{"classcategory_id2":"6","name":"S","stock_find":true,"price01":"","price02":"840","point":"0","product_code":"商品コード1D","product_class_id":"2587","product_type":"1"},"#4":{"classcategory_id2":"4","name":"L (\u54c1\u5207\u308c\u4e2d)","stock_find":false,"price01":"","price02":"1,260","point":"0","product_code":"商品コード2D","product_class_id":"2589","product_type":"1"}},"9":{"#":{"classcategory_id2":"","name":"\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044"},"#6":{"classcategory_id2":"6","name":"S","stock_find":true,"price01":"","price02":"840","point":"0","product_code":"商品コード1C","product_class_id":"2590","product_type":"1"},"#4":{"classcategory_id2":"4","name":"L","stock_find":true,"price01":"","price02":"1,260","point":"0","product_code":"商品コード2C","product_class_id":"2592","product_type":"1"}},"8":{"#":{"classcategory_id2":"","name":"\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044"},"#6":{"classcategory_id2":"6","name":"S (\u54c1\u5207\u308c\u4e2d)","stock_find":false,"price01":"","price02":"840","point":"0","product_code":"商品コード1B","product_class_id":"2593","product_type":"1"},"#4":{"classcategory_id2":"4","name":"L","stock_find":true,"price01":"","price02":"1,260","point":"0","product_code":"商品コード2B","product_class_id":"2595","product_type":"1"}},"7":{"#":{"classcategory_id2":"","name":"\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044"},"#6":{"classcategory_id2":"6","name":"S (\u54c1\u5207\u308c\u4e2d)","stock_find":false,"price01":"","price02":"840","point":"0","product_code":"商品コード1A","product_class_id":"2596","product_type":"1"},"#4":{"classcategory_id2":"4","name":"L (\u54c1\u5207\u308c\u4e2d)","stock_find":false,"price01":"","price02":"1,260","point":"0","product_code":"商品コード2A","product_class_id":"2598","product_type":"1"}}},・・・;fnSetClassCategories(document.product_form205);・・・}
$(function(){
fnOnLoad();
});
//]]>
</script>
【商品一覧で異常時】 <script type="text/javascript">//<![CDATA[
var productsClassCategories = {・・・
"205":{"__unselected":{"__unselected":{"name":"\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044","product_class_id":"2581","product_type":"1"}},"12":{"#":{"classcategory_id2":"","name":"\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044"},"#6":{"classcategory_id2":"6","name":"S","stock_find":true,"price01":"","price02":"840","point":"0","product_code":"商品コード1G","product_class_id":"2581","product_type":"1"},"#4":{"classcategory_id2":"4","name":"L","stock_find":true,"price01":"","price02":"1,260","point":"0","product_code":"商品コード2G","product_class_id":"2583","product_type":"1"}},"11":{"#":{"classcategory_id2":"","name":"\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044"},"#6":{"classcategory_id2":"6","name":"S (\u54c1\u5207\u308c\u4e2d)","stock_find":false,"price01":"","price02":"840","point":"0","product_code":"商品コード1E","product_class_id":"2584","product_type":"1"},"#4":{"classcategory_id2":"4","name":"L","stock_find":true,"price01":"","price02":"1,260","point":"0","product_code":"商品コード2E","product_class_id":"2586","product_type":"1"}},"10":{"#":{"classcategory_id2":"","name":"\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044"},"#6":{"classcategory_id2":"6","name":"S","stock_find":true,"price01":"","price02":"840","point":"0","product_code":"商品コード1D","product_class_id":"2587","product_type":"1"},"#4":{"classcategory_id2":"4","name":"L (\u54c1\u5207\u308c\u4e2d)","stock_find":false,"price01":"","price02":"1,260","point":"0","product_code":"商品コード2D","product_class_id":"2589","product_type":"1"}},"9":{"#":{"classcategory_id2":"","name":"\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044"},"#6":{"classcategory_id2":"6","name":"S","stock_find":true,"price01":"","price02":"840","point":"0","product_code":"商品コード1C","product_class_id":"2590","product_type":"1"},"#4":{"classcategory_id2":"4","name":"L","stock_find":true,"price01":"","price02":"1,260","point":"0","product_code":"商品コード2C","product_class_id":"2592","product_type":"1"}},"8":{"#":{"classcategory_id2":"","name":"\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044"},"#6":{"classcategory_id2":"6","name":"S (\u54c1\u5207\u308c\u4e2d)","stock_find":false,"price01":"","price02":"840","point":"0","product_code":"商品コード1B","product_class_id":"2593","product_type":"1"},"#4":{"classcategory_id2":"4","name":"L","stock_find":true,"price01":"","price02":"1,260","point":"0","product_code":"商品コード2B","product_class_id":"2595","product_type":"1"}},"7":{"#":{"classcategory_id2":"","name":"\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044"},"#6":{"classcategory_id2":"6","name":"S (\u54c1\u5207\u308c\u4e2d)","stock_find":false,"price01":"","price02":"840","point":"0","product_code":"商品コード1A","product_class_id":"2596","product_type":"1"},"#4":{"classcategory_id2":"4","name":"L (\u54c1\u5207\u308c\u4e2d)","stock_find":false,"price01":"","price02":"1,260","point":"0","product_code":"商品コード2A","product_class_id":"2598","product_type":"1"}}},・・・;fnSetClassCategories(document.product_form205);・・・}
$(function(){
fnOnLoad();
});
//]]>
</script>
【商品詳細で正常時】 <script type="text/javascript">//<![CDATA[
classCategories = {"":{"":{"name":"\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044","product_class_id":"2581","product_type":"1"}},"12":{"#":{"classcategory_id2":"","name":"\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044"},"#6":{"classcategory_id2":"6","name":"S","stock_find":true,"price01":"","price02":"840","point":"0","product_code":"商品コード1G","product_class_id":"2581","product_type":"1"},"#4":{"classcategory_id2":"4","name":"L","stock_find":true,"price01":"","price02":"1,260","point":"0","product_code":"商品コード2G","product_class_id":"2583","product_type":"1"}},"11":{"#":{"classcategory_id2":"","name":"\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044"},"#6":{"classcategory_id2":"6","name":"S (\u54c1\u5207\u308c\u4e2d)","stock_find":false,"price01":"","price02":"840","point":"0","product_code":"商品コード1E","product_class_id":"2584","product_type":"1"},"#4":{"classcategory_id2":"4","name":"L","stock_find":true,"price01":"","price02":"1,260","point":"0","product_code":"商品コード2E","product_class_id":"2586","product_type":"1"}},"10":{"#":{"classcategory_id2":"","name":"\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044"},"#6":{"classcategory_id2":"6","name":"S","stock_find":true,"price01":"","price02":"840","point":"0","product_code":"商品コード1D","product_class_id":"2587","product_type":"1"},"#4":{"classcategory_id2":"4","name":"L (\u54c1\u5207\u308c\u4e2d)","stock_find":false,"price01":"","price02":"1,260","point":"0","product_code":"商品コード2D","product_class_id":"2589","product_type":"1"}},"9":{"#":{"classcategory_id2":"","name":"\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044"},"#6":{"classcategory_id2":"6","name":"S","stock_find":true,"price01":"","price02":"840","point":"0","product_code":"商品コード1C","product_class_id":"2590","product_type":"1"},"#4":{"classcategory_id2":"4","name":"L","stock_find":true,"price01":"","price02":"1,260","point":"0","product_code":"商品コード2C","product_class_id":"2592","product_type":"1"}},"8":{"#":{"classcategory_id2":"","name":"\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044"},"#6":{"classcategory_id2":"6","name":"S (\u54c1\u5207\u308c\u4e2d)","stock_find":false,"price01":"","price02":"840","point":"0","product_code":"商品コード1B","product_class_id":"2593","product_type":"1"},"#4":{"classcategory_id2":"4","name":"L","stock_find":true,"price01":"","price02":"1,260","point":"0","product_code":"商品コード2B","product_class_id":"2595","product_type":"1"}},"7":{"#":{"classcategory_id2":"","name":"\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044"},"#6":{"classcategory_id2":"6","name":"S (\u54c1\u5207\u308c\u4e2d)","stock_find":false,"price01":"","price02":"840","point":"0","product_code":"商品コード1A","product_class_id":"2596","product_type":"1"},"#4":{"classcategory_id2":"4","name":"L (\u54c1\u5207\u308c\u4e2d)","stock_find":false,"price01":"","price02":"1,260","point":"0","product_code":"商品コード2A","product_class_id":"2598","product_type":"1"}}};function lnOnLoad(){fnSetClassCategories(document.form1, ""); }
$(function(){
lnOnLoad();
});
//]]>
</script>
【商品詳細で異常?】 <script type="text/javascript">//<![CDATA[
classCategories = {"__unselected":{"__unselected":{"name":"\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044","product_class_id":"2581","product_type":"1"}},"12":{"#":{"classcategory_id2":"","name":"\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044"},"#6":{"classcategory_id2":"6","name":"S","stock_find":true,"price01":"","price02":"840","point":"0","product_code":"商品コード1G","product_class_id":"2581","product_type":"1"},"#4":{"classcategory_id2":"4","name":"L","stock_find":true,"price01":"","price02":"1,260","point":"0","product_code":"商品コード2G","product_class_id":"2583","product_type":"1"}},"11":{"#":{"classcategory_id2":"","name":"\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044"},"#6":{"classcategory_id2":"6","name":"S (\u54c1\u5207\u308c\u4e2d)","stock_find":false,"price01":"","price02":"840","point":"0","product_code":"商品コード1E","product_class_id":"2584","product_type":"1"},"#4":{"classcategory_id2":"4","name":"L","stock_find":true,"price01":"","price02":"1,260","point":"0","product_code":"商品コード2E","product_class_id":"2586","product_type":"1"}},"10":{"#":{"classcategory_id2":"","name":"\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044"},"#6":{"classcategory_id2":"6","name":"S","stock_find":true,"price01":"","price02":"840","point":"0","product_code":"商品コード1D","product_class_id":"2587","product_type":"1"},"#4":{"classcategory_id2":"4","name":"L (\u54c1\u5207\u308c\u4e2d)","stock_find":false,"price01":"","price02":"1,260","point":"0","product_code":"商品コード2D","product_class_id":"2589","product_type":"1"}},"9":{"#":{"classcategory_id2":"","name":"\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044"},"#6":{"classcategory_id2":"6","name":"S","stock_find":true,"price01":"","price02":"840","point":"0","product_code":"商品コード1C","product_class_id":"2590","product_type":"1"},"#4":{"classcategory_id2":"4","name":"L","stock_find":true,"price01":"","price02":"1,260","point":"0","product_code":"商品コード2C","product_class_id":"2592","product_type":"1"}},"8":{"#":{"classcategory_id2":"","name":"\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044"},"#6":{"classcategory_id2":"6","name":"S (\u54c1\u5207\u308c\u4e2d)","stock_find":false,"price01":"","price02":"840","point":"0","product_code":"商品コード1B","product_class_id":"2593","product_type":"1"},"#4":{"classcategory_id2":"4","name":"L","stock_find":true,"price01":"","price02":"1,260","point":"0","product_code":"商品コード2B","product_class_id":"2595","product_type":"1"}},"7":{"#":{"classcategory_id2":"","name":"\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044"},"#6":{"classcategory_id2":"6","name":"S (\u54c1\u5207\u308c\u4e2d)","stock_find":false,"price01":"","price02":"840","point":"0","product_code":"商品コード1A","product_class_id":"2596","product_type":"1"},"#4":{"classcategory_id2":"4","name":"L (\u54c1\u5207\u308c\u4e2d)","stock_find":false,"price01":"","price02":"1,260","point":"0","product_code":"商品コード2A","product_class_id":"2598","product_type":"1"}}};function lnOnLoad(){fnSetClassCategories(document.form1, ""); }
$(function(){
lnOnLoad();
});
//]]>
</script>
商品一覧につきましては規格が2つあるものを抜粋しております。 それと、不思議なことに商品詳細についてはパッチを当てても 正常に規格の取得・表示ができていました。 (ですので?を付けました。) ご確認頂ければ幸いです。 何卒よろしくお願いいたします。<(_ _)>
|