EC-CUBE:ポップアップウィンドウを中央に表示する

(1)ポップアップウィンドウのスタイルを変更。
 背景を表示しない。
■data/Smarty/templates/default/popup_header.tpl にスタイルを適用。

 <body style="background:none;">

 幅の設定、線の設定を除く。
■html/user_data/packages/default/css/popup.css

 div#windowcolumn {
/*border-top: solid 3px #f90;*/
/*width: 560px;*/

その他のすべてのwidth設定をコメントアウトする。

(2)jQueryの「PopUpWindow」を利用する。
■html/jsフォルダに「jquery.popupwindow」フォルダを追加
jquery.popupwindowの中身→jquery.popupwindow.js jquery.popupwindow.settings.js

ウィンドウの調整は■jquery.popupwindow.settings.jsで行う。

 var profiles =
 {
 windowReview:
 {
 width:590,
 height:640,
 center:1,
 scrollbars:1
 },

windowDeliv:
 {
 width:590,
 height:550,
 center:1,
 scrollbars:1
 },

windowMailview:
 {
 width:640,
 height:700,
 center:1,
 scrollbars:1
 },
 };
 $(function()
 {
 $(".popupwindow").popupwindow(profiles);
 });

(3)■data/Smarty/templates/default/site_frame.tpl 追記

 <!--ポップアップウインドウ-->
 <script type="text/javascript" src="<!--{$smarty.const.ROOT_URLPATH}-->js/jquery.popupwindow/jquery.popupwindow.js"></script>
 <script type="text/javascript" src="<!--{$smarty.const.ROOT_URLPATH}-->js/jquery.popupwindow/jquery.popupwindow.settings.js"></script>

(4)下記のポップアップ画面へのリンク記述を修正する。
 商品詳細ページの「新規コメントを書き込む」
■data/Smarty/templates/default/products/detail.tpl

 <!--★新規コメントを書き込む★-->
 <a href="./review.php" onclick="win02('./review.php?product_id=<!--{$arrProduct.product_id}-->','review','600','640'); return false;"
 ↓
 <a class="popupwindow" rel="windowReview" href="./review.php?product_id=<!--{$arrProduct.product_id}-->"

 お届け先指定の「新しいお届け先を追加する」
■data/Smarty/templates/default/shopping/deliv.tpl

 <a href="<!--{$smarty.const.ROOT_URLPATH}-->mypage/delivery_addr.php" onclick="win02('<!--{$smarty.const.ROOT_URLPATH}-->mypage/delivery_addr.php?page=<!--{$smarty.server.PHP_SELF|h}-->','new_deiv','600','640'); return false;"
 ↓
 <a class="popupwindow" rel="windowDeliv" href="<!--{$smarty.const.ROOT_URLPATH}-->mypage/delivery_addr.php?page=<!--{$smarty.server.PHP_SELF|h}-->"

 MYページの「新しいお届け先を追加する」
■data/Smarty/templates/default/mypage/delivery.tpl

 <a href="<!--{$smarty.const.ROOT_URLPATH}-->mypage/delivery_addr.php" onclick="win03('./delivery_addr.php','delivadd','600','640'); return false;"
 ↓
 <a class="popupwindow" rel="windowDeliv" href="./delivery_addr.php"

 MYページの「メール配信履歴一覧」
■data/Smarty/templates/default/mypage/history.tpl

 <a href="#" onclick="win02('./mail_view.php?send_id=<!--{$tpl_arrMailHistory[cnt].send_id}-->','mail_view','650','800'); return false;">
 ↓
 <a class="popupwindow" rel="windowMailview" href="./mail_view.php?send_id=<!--{$tpl_arrMailHistory[cnt].send_id}-->">