PHP_CGI: 2007年7月アーカイブ

OSCommerceインデックス

|

●Index化 の例
*遅いと感じたときだけやること
*index化しても変わらない時は、削除すること
削除例 :
ALTER TABLE products DROP INDEX idx_products_status;
・新着商品が遅い
ALTER TABLE products ADD INDEX idx_products_status (products_status);
・特価商品が遅い
ALTER TABLE specials ADD INDEX idx_products_id (products_id);
・カテゴリーが遅い
alter table categories add index idx_parent_id(parent_id);
alter table categories add index idx_sort_order(sort_order);
alter table categories add index idx_categories_id(categories_id);
・ログインが遅い
alter table customers add index idx_customers_email_address(customers_email_address);
・申込み処理が遅い(オーダーが一杯溜まった)
alter table orders add index idx_customers_id(customers_id);
・商品表示が遅い(categories_description周辺)
alter table categories_description add index idx_categories_id(categories_id);
・個別商品の表示が遅い
alter table products add index idx_products_model(products_model);
alter table products add index idx_products_price(products_price);
alter table products add index idx_products_date_available(products_date_available);
alter table products add index idx_manufacturers_id(manufacturers_id);


・個別商品の商品表示が遅い(オプションが一杯あって)
alter table products_options add index idx_products_options_name(products_options_name);
alter table products_attributes add index idx_products_id(products_id);
alter table products_attributes add index idx_options_id(options_id);

admin/orders.php
line319

<td class="main"><b><?php echo ENTRY_NOTIFY_CUSTOMER; ?></b> <?php echo tep_draw_checkbox_field('notify', '', true); ?></td>

変更後

<td class="main"><b><?php echo ENTRY_NOTIFY_CUSTOMER; ?></b> <?php echo tep_draw_checkbox_field('notify', '', false); ?></td>

checkout_process.phpのline272

tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, nl2br($email_order), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, '');

変更後

tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, nl2br($email_order), tep_get_fullname($order->customer['firstname'],$order->customer['lastname']), $order->customer['email_address'], '');

OSCommerce 型番モデルで検索

|

/admin/categories.php

line 740

$products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p2c.categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and p.products_id = p2c.products_id and pd.products_name like '%" . tep_db_input($search) . "%' order by pd.products_name");


変更後
$products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p2c.categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and p.products_id = p2c.products_id and ( pd.products_name like '%" . tep_db_input($search) . "%' or p.products_model like '%" . $HTTP_GET_VARS['search'] . "%' ) order by pd.products_name");

/catalog/includes/functions/general.php
以外のファイルをコピーする

general.php を変更する必要はない

/catalog/includes/modules/featured.php
/catalog/includes/modules/featured_products.php
は、日本語版のv1.3_Jではなく、v1.3のオリジナルをインストールする。
tep_get_tax_rate()が削除されていないモノ

OSCommerce 404 Not Found

|

product_info.phpの

require('includes/application_top.php');

の後に

$product_info_query = tep_db_query("select products_id, products_last_modified from " . TABLE_PRODUCTS . " where products_status = '1' and products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' limit 1");
if (!tep_db_num_rows($product_info_query)) {
header("HTTP/1.0 404 Not Found");
exit;
}

スパイダーのみは、

$product_info_query = tep_db_query("select products_id, products_last_modified from " . TABLE_PRODUCTS . " where products_status = '1' and products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' limit 1");

if (!tep_db_num_rows($product_info_query) && $spider_kill_sid) {

header("HTTP/1.0 404 Not Found");
exit;

}

Yahooの新クローラー対応

spider_configure.phpを修正

$spider_agent = array(
'bot',
'crawler',
'empas',
'google',
'ia_archiver',
'slurp',
'spider',
'teoma',
'yahoo',
);

application_top.phpを変更

// add the products model to the breadcrumb trail
if (isset($HTTP_GET_VARS['products_id'])) {
// $model_query = tep_db_query("select products_model from " . TABLE_PRODUCTS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
$model_query = tep_db_query("select products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . $HTTP_GET_VARS['products_id'] . "' and language_id = '" . $languages_id . "'");
$model = tep_db_fetch_array($model_query);
// $breadcrumb->add($model['products_model'], tep_href_link(FILENAME_PRODUCT_INFO, 'cPath=' . $cPath . '&products_id=' . $HTTP_GET_VARS['products_id']));
$breadcrumb->add($model['products_name'], tep_href_link(FILENAME_PRODUCT_INFO, 'cPath=' . $cPath . '&products_id=' . $HTTP_GET_VARS['products_id']));

このアーカイブについて

このページには、2007年7月以降に書かれたブログ記事のうちPHP_CGIカテゴリに属しているものが含まれています。

前のアーカイブはPHP_CGI: 2006年12月です。

次のアーカイブはPHP_CGI: 2007年9月です。

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