- 目次
- CHAPTER 2 フロント機能をカスタマイズする
- SECTION-2 商品詳細
- Tips 030 商品サブ画像を追加する
商品サブ画像追加のカスタマイズをすると商品一覧ページでシステムエラーが発生してしまう
本書のとおりに、DBにカラムを追加して、ダウンロードファイルで差し替えても、最新版のバージョン2.4.3だとエラーになります。
バージョン2.4.0から2.4.3へのバージョンアップにともなって、ちょうどここでカスタマイズしているファイルのロジックが変更されたのが原因です。
EC-CUBE最新版のソースコードを直接変更する
以下のファイルを修正してください。
- data\class\db\dbfactory\SC_DB_DBFactory_MYSQL.php
ダウンロードファイルは2.4.0をベースにしているので、今回は、2.4.3のオリジナルファイルに直接変更を加えていきます。
SC_DB_DBFactory_MYSQL.php 303行目あたり
- 変更前
-
dtb_products.main_image, dtb_products.main_large_image, dtb_products.sub_title1, dtb_products.sub_comment1, - 変更後
-
dtb_products.main_image, dtb_products.main_large_image, __EOS__; if (PHOTO_GALLERY_IMAGE_NUM > 0) for ($cnt = 1;$cnt <= PHOTO_GALLERY_IMAGE_NUM;$cnt++) $sql['vw_products_allclass_detail'] .= 'photo_gallery_image'.$cnt.','; $sql['vw_products_allclass_detail'] .=<<< __EOS__ dtb_products.sub_title1, dtb_products.sub_comment1,
SC_DB_DBFactory_MYSQL.php 367行目あたり
- 変更前
) __EOS__; return array( "vw_cross_class" => '- 変更後
-
) __EOS__; $vw_products_nonclass = ' (SELECT T1.product_id, T1.name, T1.deliv_fee, T1.sale_limit, T1.sale_unlimited, T1.category_id, T1.rank, T1.status, T1.product_flag, T1.point_rate, T1.comment1, T1.comment2, T1.comment3, T1.comment4, T1.comment5, T1.comment6, T1.file1, T1.file2, T1.file3, T1.file4, T1.file5, T1.file6, T1.main_list_comment, T1.main_list_image, T1.main_comment, T1.main_image, T1.main_large_image,'; if (PHOTO_GALLERY_IMAGE_NUM > 0) for ($cnt = 1; $cnt <= PHOTO_GALLERY_IMAGE_NUM; $cnt++) $vw_products_nonclass .= 'photo_gallery_image'.$cnt.','; $vw_products_nonclass .= ' T1.sub_title1, T1.sub_comment1, T1.sub_image1, T1.sub_large_image1, T1.sub_title2, T1.sub_comment2, T1.sub_image2, T1.sub_large_image2, T1.sub_title3, T1.sub_comment3, T1.sub_image3, T1.sub_large_image3, T1.sub_title4, T1.sub_comment4, T1.sub_image4, T1.sub_large_image4, T1.sub_title5, T1.sub_comment5, T1.sub_image5, T1.sub_large_image5, T1.sub_title6, T1.sub_comment6, T1.sub_image6, T1.sub_large_image6, T1.del_flg, T1.creator_id, T1.create_date, T1.update_date, T1.note, T1.deliv_date_id, T2.product_id_sub, T2.product_code, T2.price01, T2.price02, T2.stock, T2.stock_unlimited, T2.classcategory_id1, T2.classcategory_id2 FROM (SELECT * FROM dtb_products &&noncls_where&&) AS T1 LEFT JOIN (SELECT product_id AS product_id_sub, product_code, price01, price02, stock, stock_unlimited, classcategory_id1, classcategory_id2 FROM dtb_products_class WHERE classcategory_id1 = 0 AND classcategory_id2 = 0) AS T2 ON T1.product_id = T2.product_id_sub) '; return array( "vw_cross_class" => '
- 変更前
-
"vw_products_nonclass" => ' (SELECT T1.product_id, T1.name, T1.deliv_fee, T1.sale_limit, T1.sale_unlimited, T1.category_id, T1.rank, T1.status, T1.product_flag, T1.point_rate, T1.comment1, T1.comment2, T1.comment3, T1.comment4, T1.comment5, T1.comment6, T1.file1, T1.file2, T1.file3, T1.file4, T1.file5, T1.file6, T1.main_list_comment, T1.main_list_image, T1.main_comment, T1.main_image, T1.main_large_image, T1.sub_title1, T1.sub_comment1, T1.sub_image1, T1.sub_large_image1, T1.sub_title2, T1.sub_comment2, T1.sub_image2, T1.sub_large_image2, T1.sub_title3, T1.sub_comment3, T1.sub_image3, T1.sub_large_image3, T1.sub_title4, T1.sub_comment4, T1.sub_image4, T1.sub_large_image4, T1.sub_title5, T1.sub_comment5, T1.sub_image5, T1.sub_large_image5, T1.sub_title6, T1.sub_comment6, T1.sub_image6, T1.sub_large_image6, T1.del_flg, T1.creator_id, T1.create_date, T1.update_date, T1.note, T1.deliv_date_id, T2.product_id_sub, T2.product_code, T2.price01, T2.price02, T2.stock, T2.stock_unlimited, T2.classcategory_id1, T2.classcategory_id2 FROM (SELECT * FROM dtb_products &&noncls_where&&) AS T1 LEFT JOIN (SELECT product_id AS product_id_sub, product_code, price01, price02, stock, stock_unlimited, classcategory_id1, classcategory_id2 FROM dtb_products_class WHERE classcategory_id1 = 0 AND classcategory_id2 = 0) AS T2 ON T1.product_id = T2.product_id_sub) ', "vw_products_allclass" => - 変更後
-
"vw_products_nonclass" => $vw_products_nonclass, "vw_products_allclass" => "
基本的には、ダウンロードファイルに施されたカスタマイズ内容を、そのまま2.4.3のファイルに適用しているだけです。
- source:
- エスキュービズム
- updated:
- 2010.07.21 02:07:21




