2009年7月アーカイブ

zen cartはもともと英語で作られたので、日本語で「こうあってほしい」という部分が時々できていません。

例えば商品カテゴリが漢字の人物名で、それがあいうえお順に並んでほしいと思っても、セットアップしたままでは並びません。

なので、カテゴリを入力する際に、カテゴリ名をひらがなでも入力してもらって、それで並び替えることにしました。

修正ファイル備忘録

/public_html/admin/includes/languages/japanese/categories.php

/public_html/admin/includes/functions/general.php

/public_html/admin/includes/modules/category_product_listing.php

/public_html/admin/categories.php

サイトマップも
/public_html/includes/classes/site_map.php

メインカラムに展開されるカテゴリ名並び順は
/includes/modules/pages/index/main_template_vars.php

詳細検索の並び順は
/public_html/includes/functions/functions_categories.php

METAタグの文字切り出し

| コメント(0)
/public_html/includes/functions/functions_general.php
のzen_truncate_paragraphというファンクションでMETA descriptionの表示文字を設定しているのですが、zen cartはもともと英語で開発されているので、半角スペースで区切って文字数を数えているのです。

日本語はそういう区切りが無いので、文字を切り出して表示してくれません。なのでこのファンクションを修正しました。

「はい」をデフォルトに

| コメント(0)
「価格お問い合わせ商品」は「はい」をデフォルトに。

/public_html/admin/includes/modules/product_xxx/collect_info.php

default: $in_product_is_call = false; $out_product_is_call = true;

を以下に変更

default: $in_product_is_call = true; $out_product_is_call = false;


ところで扇風機買わなきゃ

気付いたら3周年

| コメント(0)
17日でwebartonは3周年でした。
ちょうど母の誕生日で、それは覚えてたのですが、
3周年は忘れてた。。。

とても嬉しいことに、毎日仕事しています。
皆様に本当に感謝しています。ありがとうございます。

今年後半は、自分でやってみたいと思ってきたことにも
着手して、もっとwebartonらしさを出していきたいと思っています。

これからもどうぞよろしくお願い致します。

久保明子

ここにモジュールがあります。
自分でやらなくてはいけなかったら大変だったと思います。。。

http://www.zen-cart.com/index.php?main_page=product_contrib_info&cPath=40_62&products_id=77

開発してくださった方に感謝!
/public_html/includes/templates/template/templates/tpl_index_default.php に書けばトップだけに表示されます。

以下はSQLサンプル。

<?php



$languages_id = $_SESSION['languages_id'];

$sql = "SELECT a.categories_name, a.categories_id FROM " . TABLE_CATEGORIES_DESCRIPTION
. " a, " . TABLE_CATEGORIES . " b WHERE a.categories_id = b.categories_id
and a.feature_flg = 1 and a.language_id =" . $languages_id . " and b.parent_id
= 18;";

$dbdata = $db->Execute($sql);

while (!$dbdata->EOF) {

echo "<p><a href=¥"http://www.sample.com/index.php?main_page=index&cPath=11_18_".$dbdata->fields['categories_id']
."¥">" . $dbdata->fields['categories_name'] . "</a></p>";

$dbdata->MoveNext();

}

?>

文字のエスケープ

| コメント(0)
文字列の中で「"」が入る場合は「¥」を手前につけてエスケープする。

echo "<a href=¥"http://www.webarton.com/¥">ウェバートンのサイト</a>";
/public_html/includes/templates/template/common/tpl_main_page.php

トップページだけにイメージを表示したい場合、パンくずリストの設定を真似るとカンタンです。

ただし、管理画面で、レイアウトの設定→パン屑リストの設定で「2」(トップのみパンくずリスト非表示)を選びます。

if (DEFINE_BREADCRUMB_STATUS == '1' || (DEFINE_BREADCRUMB_STATUS == '2' && !$this_is_home_page) ){
ここはトップ以外で表示
}
else {
ここはトップのみに表示される

}
zen cartデフォルトだと、なぜかお問合せへのリンクがSSLになっていません。

修正は
/public_html/includes/modules/sideboxes/information.phpの

if (DEFINE_CONTACT_US_STATUS <= 1) {

$information[] = '<a href="' . zen_href_link(FILENAME_CONTACT_US) . '">'
. BOX_INFORMATION_CONTACT . '</a>';

}

を以下に変更。

if (DEFINE_CONTACT_US_STATUS <= 1) {

$information[] = '<a href="' . zen_href_link(FILENAME_CONTACT_US, '',
'SSL') . '">' . BOX_INFORMATION_CONTACT . '</a>';

}

麻布十番の歯科医院

| コメント(0)


先日、麻布十番の歯科医院、白宝デンタルクリニック様のサイトが公開になりました。

いままでも何度もサイト制作をご依頼くださっていますが、
今回のはクリニックの総合案内サイトです。

通常の虫歯治療などが専門の歯医者さんと違って、
歯列矯正、ホワイトニング、入れ歯、いびき治療、インプラント、審美歯科など専門のクリニックです。

私も、こちらでマウスピース矯正に通ってます。
マウスピース矯正って、透明なマウスピースをはめて歯を動かす矯正で、
通常のワイヤー矯正と違って目立たず矯正ができる画期的な技術です。

歯列矯正に興味がある人は知っている人が多いみたいですが、
一般的にはまだまだ知られてないみたいですね。

せっかく私が今矯正中なので、もっと宣伝したいのですけれど、
「目立たない」というよさゆえ気付いてもらえない。。。
「実は矯正しててね、」と話してみると、「ほんとにわからないね!」と驚かれます。

歯列矯正って、金額の安いことではないけれど、歯ならびってやっぱり気になるし、
ちゃんと自分の歯でおいしく食事したいなと思うので、メンテナンスは大事ですよね。
そして信頼できる歯医者さんにお願いするのが大事だと思います。

それから、マウスピース矯正は就寝中にホワイトニングもできて、そこもおすすめです!
私もちょっとホワイトニング試してみたら、「歯が白くなってない?」って言われました♪

白宝デンタルクリニック
/public_html/includes/templates/template/common/tpl_main_page.php にtpl_header.phpの内容を移動させた。

商品詳細の画像

| コメント(0)
/public_html/includes/templates/template/templates/tpl_modules_main_product_image.phpを修正。
商品ページから「この商品についてお問い合わせ」を押してお問い合わせメールを送る場合があります。

デフォルトだと商品名などが掲載されないのでわかりにくいため、
追加しました。

/public_html/includes/functions/functions_general.php
/public_html/includes/templates/template/templates/tpl_contact_us_default.php
/public_html/includes/modules/pages/contact_us/header_php.php
/public_html/admin/includes/languages/japanese/email_extras.php
/public_html/includes/languages/japanese.php

小数点以下も扱う場合

| コメント(0)
decimal(6,2)みたいに桁数を指定できる。

商品情報の追加

| コメント(0)
1.テーブル新規
CREATE TABLE product_art_extra (
products_id int(11) NOT NULL default '0',
size varchar(32) default NULL,
frame_h int(11) default NULL,
frame_w int(11) default NULL,
frame_d int(11) default NULL,
window_h int(11) default NULL,
window_w int(11) default NULL,
window_d int(11) default NULL,
accessories varchar(96) default NULL,
PRIMARY KEY (products_id)
) TYPE=MyISAM;

2.追加SQL
INSERT INTO product_type_layout
(configuration_title, configuration_key, configuration_value,
configuration_description, product_type_id, sort_order,
set_function, date_added)
VALUES ('附帯品表示', 'SHOW_PRODUCT_ART_INFO_ACCESSORIES', '1',
'附帯品を表示する 0=表示しない 1=表示する', '6', '3',
'zen_cfg_select_drop_down(array(array(¥'id¥'=>¥'1¥', ¥'text¥'=>¥'True¥'), array(¥'id¥'=>¥'0¥', ¥'text¥'=>¥'False¥')), ', now());

3. admin/includes/extra_datafiles/art_type_database_names.phpを新規追加。

define('TABLE_PRODUCT_ART_EXTRA', DB_PREFIX . 'product_art_extra');

4.includes/extra_datafiles/art_type_database_names.phpを新規追加。

define('TABLE_PRODUCT_ART_EXTRA', DB_PREFIX . 'product_art_extra');

5.admin/includes/modules/product_artのcollect_info.php
データ取得
$art = $db->Execute("select size, frame_h, frame_w, frame_d, window_h, window_w, window_d, accessories
from " . TABLE_PRODUCT_ART_EXTRA .
" where products_id = '" . (int)$_GET['pID']. "'");

と、表示部分



fields['accessories']); ?>

以下省略

6.admin/includes/modules/update_product.phpをコピー。
admin/includes/modules/product_art/update_product.phpとする。

update_product.phpのこんな風に書いてある箇所に、
///////////////////////////////////////////////////////
//// INSERT PRODUCT-TYPE-SPECIFIC *INSERTS* HERE //////


//// *END OF PRODUCT-TYPE-SPECIFIC INSERTS* ////////
///////////////////////////////////////////////////////
$sql_data_array = array('products_id' => $products_id,
'accessories' => zen_db_prepare_input($_POST['accessories']),
'size' => zen_db_prepare_input($_POST['size']) );

zen_db_perform(TABLE_PRODUCT_ART_EXTRA, $sql_data_array);

を入れる。

次に、
///////////////////////////////////////////////////////
//// INSERT PRODUCT-TYPE-SPECIFIC *UPDATES* HERE //////


//// *END OF PRODUCT-TYPE-SPECIFIC UPDATES* ////////
///////////////////////////////////////////////////////

の間に、
$sql_data_array = array('accessories' => zen_db_prepare_input($_POST['accessories']),
'size' => zen_db_prepare_input($_POST['size']));
zen_db_perform(TABLE_PRODUCT_BOOK_EXTRA,
$sql_data_array,
'update',
"products_id = '" . (int)$products_id . "'");
を入れる。

7.admin/includes/modules/product_art/delete_product_confirm.php を
/public_html/admin/includes/modules/product_art配下にコピー。

PRODUCT_TYPE_SPECIFIC_INSTRUCTIONS_GO__BELOW_HEREの部分に以下を追加。

$db->Execute("delete from " . TABLE_PRODUCT_ART_EXTRA . "
where products_id = '" . (int)$product_id . "'");

8./public_html/admin/includes/modules/copy_to_confirm.phpを
/public_html/admin/includes/modules/product_art配下にコピー。

$dup_products_id = $db->Insert_ID();の下に
$book_extra = $db->Execute("select authers, size, publish_date from " .
TABLE_PRODUCT_BOOK_EXTRA .
" where products_id = '" .
(int)$products_id . "'");

$db->Execute("insert into " . TABLE_PRODUCT_BOOK_EXTRA . "
(products_id, authers, size, publish_date)
values (
'" . (int)$dup_products_id . "',
'" . zen_db_input($book_extra->fields['authers']) . "',
'" . zen_db_input($book_extra->fields['size']) . "',
'" . zen_db_input($book_extra->fields['publish_date']) . "')");
と追加。

9.admin/product_art.phpに追加

10. includes/modules/pages/product_art_info/main_template_vars.phpに

$sql = "select * from " . TABLE_PRODUCT_ART_EXTRA . "
where products_id = '" . (int)$_GET['products_id'] . "'";
$art_extras = $db->Execute($sql);
$art_accessories = $art_extras->fields['accessories'];
$art_size = $art_extras->fields['size'];
$art_frame_h = $art_extras->fields['frame_h'];
$art_frame_w = $art_extras->fields['frame_w'];
$art_frame_d = $art_extras->fields['frame_d'];
$art_window_h = $art_extras->fields['window_h'];
$art_window_w = $art_extras->fields['window_w'];
$art_window_d = $art_extras->fields['window_d'];
 を追加。

$flag_show_art_product_info_accessories =
zen_get_show_product_switch($_GET['products_id'], 'accessories');
$flag_show_art_product_info_size =
zen_get_show_product_switch($_GET['products_id'], 'size');
$flag_show_art_product_info_frame_h =
zen_get_show_product_switch($_GET['products_id'], 'frame_h');
$flag_show_art_product_info_frame_w =
zen_get_show_product_switch($_GET['products_id'], 'frame_w');
$flag_show_art_product_info_frame_d =
zen_get_show_product_switch($_GET['products_id'], 'frame_d');
$flag_show_art_product_info_window_h =
zen_get_show_product_switch($_GET['products_id'], 'window_h');
$flag_show_art_product_info_window_w =
zen_get_show_product_switch($_GET['products_id'], 'window_w');
$flag_show_art_product_info_window_d =
zen_get_show_product_switch($_GET['products_id'], 'window_d');
 を追加。

12.includes/languages/japanese/product_art_info.php
に追加。

define('TEXT_PRODUCT_ACCESSORIES', '附帯品: ');
define('TEXT_PRODUCT_SIZE', 'サイズ: ');
define('TEXT_PRODUCT_FRAME', '額寸(縦×横×厚み): ');
define('TEXT_PRODUCT_WINDOW', '窓寸(縦×横): ');

13./public_html/includes/templates/template/templates/tpl_product_art_info_display.phpに追加。

' . TEXT_PRODUCT_SIZE . $art_size . '' : '') . "¥n"; ?>
' . TEXT_PRODUCT_FRAME . $art_frame_h . '×'. $art_frame_w . '×'. $art_frame_d .'cm' : '') . "¥n"; ?>
' . TEXT_PRODUCT_WINDOW . $art_window_h . '×'. $art_window_w .'cm' : '') . "¥n"; ?>
' . TEXT_PRODUCT_MODEL . $products_model . '' : '') . "¥n"; ?>
' . TEXT_PRODUCT_ACCESSORIES . $art_accessories . '' : '') . "¥n"; ?>

ほわわ。。。大変。

商品タイプの追加

| コメント(0)
1.SQL
INSERT INTO product_types
VALUES (6, 'Product - Art', 'product_art', '1', 'Y', '', now(), now());

商品の管理→商品タイプの管理にProduct - Artが追加される。

2.追加情報SQL
INSERT INTO product_type_layout
(configuration_title, configuration_key, configuration_value,
configuration_description, product_type_id, sort_order,
set_function, date_added)
VALUES ('コンディション表示', 'SHOW_PRODUCT_ART_INFO_CONDITION', '1',
'コンディションを表示する 0=表示しない 1=表示する', '6', '2',
'zen_cfg_select_drop_down(array(array(¥'id¥'=>¥'1¥', ¥'text¥'=>¥'True¥'), array(¥'id¥'=>¥'0¥', ¥'text¥'=>¥'False¥')), ', now());

3.admin/product.phpをコピーしてproduct_art.phpを作る

4.admin/includes/modules/product/ディレクトリごとコピーして、admin/includes/modules/product_art/を作る

5.admin/includes/languages/japanese/product.phpをコピーしてproduct_art.phpを作って、内容を一部変更

define('TEXT_PRODUCTS_MODEL', '商品型番:');

define('TEXT_PRODUCTS_MODEL', 'コンディション:');
にする。

6.includes/modules/pages/product_info/をコピーし
/public_html/includes/modules/pages/product_art_info/を作る

7./public_html/includes/modules/pages/product_art_info/の
main_template_vars.phpを修正

$tpl_page_body = '/tpl_product_info_display.php';を

$tpl_page_body = '/tpl_product_art_info_display.php';

にする。

8.同ファイルの
$flag_show_product_info_model = zen_get_show_product_switch($_GET['products_id'], 'model');

$flag_show_product_info_model = zen_get_show_product_switch($_GET['products_id'], 'condition');

に修正。

9.includes/templates/template_default/templates/tpl_product_info_display.phpをコピーして

tpl_product_art_info_display.php に書き換えてUP

10./public_html/includes/languages/japanese/product_info.phpをコピーして

product_art_info.php に書き換え

11.product_art_info.phpの
define('TEXT_PRODUCT_MODEL', 'モデル: '); を
define('TEXT_PRODUCT_MODEL', 'コンディション: ');
に修正
去年も書いたのですが、zen cartは

safe_mode = Off
register_globals = Off

が推奨されています。

去年も使ったレンタルサーバで、またzen cartを使っているのですが、
去年はデフォルトでoffになっていたから今回はあんまり気にしてませんでした。

でもなんだか商品の画像が登録出来ない!
どうやらregister_globalsがonになっているとそうなるらしい!!!

ひえーっと思って調べたら、やはりonに。
PHPのバージョンも変わっているから、そういうこともあるんですね。

.htaccessに
php_flag register_globals off
を足すとLocal Valueをoffにできます。

画像もちゃんと登録されました。
はああ。。。でもよかった!

クーポン券、ギフト券

| コメント(0)
サイドボックスのinformationに表示されていたクーポン券、ギフト券のリンク。

/public_html/includes/modules/sideboxes/information.php

を直接修正して表示されないようにしました。
ほんとは管理画面にON/OFFの設定があるのかもしれないけど、
見つからない!
すぐ忘れちゃうのでメモしときます。

カテゴリ表示の中の、「新着商品」「全商品」リンクを外したいときは、

一般設定→レイアウトの設定で「カテゴリボックス - 全商品リストへのリンクを表示」などをfalseにする。

ところでワタクシ

こんにちは、久保明子です。フリーランスでweb制作の仕事をしています。印刷関係担当の相棒と二人でwebarton(ウェバートン)という名称で働いてます。
サイトはこちらです。http://www.webarton.com/

それから、フェアトレードのショッピングサイトも運営していて、オーガニック&ハンドメイドのソープやボディケア商品を扱っています。お取引くださるお店募集中です!
http://fairtradeshopping.jp/


このアーカイブについて

このページには、2009年7月に書かれたブログ記事が新しい順に公開されています。

前のアーカイブは2009年6月です。

次のアーカイブは2009年8月です。

最近のコンテンツはインデックスページで見られます。過去に書かれたものはアーカイブのページで見られます。