WP e-commarce プラグインのカスタマイズ#1

タグ


wp-cartWordpress のショッピングカートプラグイン WordPress e-Commerce Plugin a WordPress Shopping Cart Plugin by Instinct | Instinct Entertainmentは、日本語ファイルも同梱されているので簡単にWordpressをECサイトとして構築することができますが、日本語で使用する場合は、テンプレートに少し手を加える必要があります。
最低限必要であろうカスタマイズは以下の通りです。

価格の小数点削除

wpsc-includes/processing.functions.php: line 50
wpsc-includes/cart.class.php: line1099
wpsc-includes/variations.class.php: line324
修正前

$price_out =  number_format($price_in, 2, '.', ',');

修正後

$price_out =  number_format($price_in);

wpsc-includes/variations.class.php: line261
修正前

$product_price = number_format($associated_variation_row['price'],2,'.', '');

修正後

$product_price = number_format($associated_variation_row['price']);

タグクラウドウィジェットのスタイル

最小・最大フォントサイズや表示数の変更
tagging_functions.php: line14, line36

'smallest' => 10, 'largest' => 14, 'unit' => 'px', 'number' => 45,
'format' => 'flat', 'orderby' => 'name', 'order' => 'ASC',

その他

テンプレートを直接和訳
user-log.php: line37
user-downloads.php: line30
edit-profile.php: line104

PHP:
  1. echo " <div class='user-profile-links'><a href='".get_option('user_account_url')."'>Purchase History</a> | <a href='".get_option('user_account_url').$seperator."edit_profile=true'>Your Details</a> | <a href='".get_option('user_account_url').$seperator."downloads=true'>Your Downloads</a></div><br />";

PHP:
  1. echo " <div class='user-profile-links'><a href='".get_option('user_account_url')."'>購入履歴</a> | <a href='".get_option('user_account_url').$seperator."edit_profile=true'>アカウント情報</a> | <a href='".get_option('user_account_url').$seperator."downloads=true'>ダウンロード</a></div><br />";

関連する投稿

コメントをどうぞ