Quantcast
Channel: Welcart コミュニティー|ECサイト構築プラグイン »商品詳細ページ
Viewing all articles
Browse latest Browse all 4

【重要】カートページ、メンバーページ等のカスタマイズについて

$
0
0

カートページやメンバーページなどをカスタマイズした方はカスタマイズしたファイルを退避させる事ができます。これによってWelcart をアップグレードしても上書きされることはなくなります。
下記のテンプレートファイルをカスタマイズしている方は別ディレクトリーへの退避を行ってください。今のところ、それ以外のファイルの退避はできません。

Welcart は不具合修正などアップグレードを頻繁に行います。アップグレードが可能な範囲でのカスタマイズをお勧めします。


[対象のファイル]

退避させる事ができるファイルはusc-e-shop/templates/ 内のファイル全てです。

  • usc-e-shop/templates/cart/cart.php(カートページ)
  • usc-e-shop/templates/cart/completion.php(完了ページ)
  • usc-e-shop/templates/cart/confirm.php(確認ページ)
  • usc-e-shop/templates/cart/customer_info.php(お客様情報ページ)
  • usc-e-shop/templates/cart/delivery_info.php(配送・支払方法ページ)
  • usc-e-shop/templates/cart/error.php(エラーページ)
  • usc-e-shop/templates/cart/maintenance.php(メンテナンスページ)
  • usc-e-shop/templates/member/changepassword.php(パスワード変更ページ)
  • usc-e-shop/templates/member/completion.php(完了ページ)
  • usc-e-shop/templates/member/login.php(ログインページ)
  • usc-e-shop/templates/member/lostpassword.php(パスワード要求ページ)
  • usc-e-shop/templates/member/member.php(会員情報ページ)
  • usc-e-shop/templates/member/member_form.php(新規入会ページ)
  • usc-e-shop/templates/search_item.php(商品検索ページ)
  • usc-e-shop/templates/single_item.php(商品詳細ページ)
  • usc-e-shop/templates/wp_search_item.php(その他のページ)


[退避先]

退避先は、plugins/usc-e-shop/ 以外であればどこでも構いませんが、ここではテーマフォルダ(uCart defaultテーマの場合)に退避させる方法を説明いたします。

wp-content/themes/ucart_default/ 内に退避(複写)する

デフォルトテーマにsingle_item.php を設置するには、ucart_default ディレクトリ内にtemplates ディレクトリを作成しその中に設置します。パスは次のようになります。

wp-content/themes/ucart_default/templates/single_item.php

cart.php の場合は次のようになります。

wp-content/themes/ucart_default/templates/cart/cart.php

この様に、テーマフォルダ内にプラグインのtemplates ディレクトリの構造のまま設置します。

注意!! カスタマイズしていないファイルは退避させないでください。


[パッチをあてる]

テーマ内のfunctions.php に次のコードを追加してください。

cart.php を設置した場合

add_action('init', 'my_welcart_template', 9);
function my_welcart_template(){
add_filter('usces_template_path_cart', 'my_welcart_cart_path');
}
function my_welcart_cart_path( $path ){
$path = get_stylesheet_directory() . '/templates/cart/cart.php';
return $path;
}

cart.php とsingle_item.php を設置した場合

add_action('init', 'my_welcart_template', 9);
function my_welcart_template(){
add_filter('usces_template_path_cart', 'my_welcart_cart_path');
add_filter('usces_template_path_single_item', 'my_welcart_single_item_path');
}
function my_welcart_cart_path( $path ){
$path = get_stylesheet_directory() . '/templates/cart/cart.php';
return $path;
}
function my_welcart_single_item_path( $path ){
$path = get_stylesheet_directory() . '/templates/single_item.php';
return $path;
}




[フィルター対応表]

templates/cart/cart.php usces_template_path_cart
templates/cart/completion.php usces_template_path_ordercompletion
templates/cart/confirm.php usces_template_path_confirm
templates/cart/customer_info.php usces_template_path_customer
templates/cart/delivery_info.php usces_template_path_delivery
templates/cart/error.php usces_template_path_carterror
templates/cart/maintenance.php usces_template_path_maintenance
templates/member/changepassword.php usces_template_path_changepassword
templates/member/completion.php usces_template_path_membercompletion
templates/member/login.php usces_template_path_login
templates/member/lostpassword.php usces_template_path_lostpassword
templates/member/member.php usces_template_path_member
templates/member/member_form.php usces_template_path_member_form
templates/single_item.php usces_template_path_single_item
templates/search_item.php usces_template_path_search_item
templates/wp_search_item.php usces_template_path_wp_search



この様に読み込むテンプレートを変更する事ができます。
これで安心してアップグレードができます


注意!!
・プラグイン内のテンプレートファイルは削除せずそのままにして置いてください。
・テーマ内に設置するテンプレートファイルは変更したものだけにします。
・パッチも変更したものだけをあてるようにしてください。
・テンプレートのカスタマイズは、その内容次第ではアップグレードの際不具合が出る可能性もあるので動作テストは十分に行ってください。


Viewing all articles
Browse latest Browse all 4

Latest Images

Trending Articles





Latest Images