2008年5月30日

注文データ削除時にステータス変更 oscommerce

osCommeceでは、管理画面(admin)の注文管理で注文を削除した場合、在庫数を元に戻すことは出来ても、売り切れになったステータスは元に戻りません。
 Koshoten.net2でもosCommerceの同じ機能を使用しているので同じことになります。

これは、admin/includes/functions/general.phpの974行目を次のように変更することで対応できます。

 tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = products_quantity + " . $order['products_quantity'] . ", products_ordered = products_ordered - " . $order['products_quantity'] . ", products_status = '1' where products_id = '" . $order['products_id'] . "'");

これで注文データを削除する際に「在庫数を元に戻す」チェックを入れていれば、同時にステータスが在庫ありとなります。

 

http://www.koshoten.net/k2/modules/icontent/index.php?page=13

2008年5月23日

form 文字化け utf-8 IE accept-charset

<form enctype="multipart/form-data" action="" method="POST" accept-charset="utf-8">
<input type="hidden" name="dummy" value="&#65533;"><!-- IEにaccept-charsetを理解させるおまじない -->

 

http://oshiete1.goo.ne.jp/kotaeru.php3?q=2048322

2008年5月19日

oscommerce アドミンエリア 商品一覧 表示制限

★SQL実行

INSERT INTO `configuration` ( `configuration_id` , `configuration_title` , `configuration_key` , `configuration_value` , `configuration_description` , `configuration_group_id` , `sort_order` , `last_modified` , `date_added` , `use_function` , `set_function` )
VALUES (
'', 'max products per page admin-side', 'MAX_PROD_ADMIN_SIDE', '30', 'Maximum numba of products per page in administration panel', '3', NULL , '2003-11-10 14:54:12', '2003-11-10 14:54:12', NULL , NULL
);

-----------------------------------
admin/categories.phpカスタマイズ


★781行目に挿入

<?php
    $categories_count = 0;


<?php
 #QUERY TO KNOW THE MAX_PROD_ADMIN_SIDE
 $max_prod_admin_side_q=tep_db_query("select configuration_value FROM configuration WHERE configuration_key='MAX_PROD_ADMIN_SIDE'");
 $max_prod_admin_side=(tep_db_fetch_array($max_prod_admin_side_q));
 #
 $lmt=$max_prod_admin_side['configuration_value'];
 #
    $categories_count = 0;


★818行目

    $products_count = 0;
    if ($HTTP_GET_VARS['search']) {


    $products_count = 0;
 if (! $limite_1){
 $limite_1=0;
 }
 if (! $limite_2){
 $limite_2=$lmt;
 }
    if ($HTTP_GET_VARS['search']) {


★824行目

    } else {
      $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 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 p2c.categories_id = '" . $current_category_id . "' order by pd.products_name");
    }


    } else {
 if (! $limite_1 & ! $limite_2)
  {
  $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 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 p2c.categories_id = '" . $current_category_id . "' order by pd.products_name");
     }
  else
  {
    $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 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 p2c.categories_id = '" . $current_category_id . "' order by pd.products_name LIMIT $limite_1, $limite_2 ");
     }
    }

 

★874行目

              <tr>
                <td colspan="3"><table border="0" width="100%" cellspacing="0" cellpadding="2">
                  <tr>


              <tr>
                <td colspan="3"><table border="0" width="100%" cellspacing="0" cellpadding="2">
    <tr><td colspan="3" class="smallText">
    <?
    if ( $cPath){
    $num_prod=tep_db_query("SELECT * from products_to_categories where categories_id=$cPath");
    $np=mysql_num_rows($num_prod);
    echo "<b><font=1>NUMERO TOTALE DI ARTICOLI PER QUESTA CATEGORIA</font></b>\n".$np;
    }
    ?></td>
    </tr>
    <tr>
    <td colspan="3" class="smallText">
    <?
    if ( $cPath){
    $records_per_page=$lmt;
    $page_num=round(($np/$records_per_page),0);
    echo "go to page: ";
    $lim_1=0;
    $lim_2=$lmt;
    for ($i=0; $i <= $page_num; $i++)
    {
    $a=$i+1;
    echo "<a href=categories.php?cPath=$cPath&limite_1=$lim_1&limite_2=$lim_2>".$a."</a>|";
    $lim_1=$lim_1+$lim_2;
    }
    }
    ?>
    
    </td>
    </tr>
                  <tr>

---------------------------------------------

 

2008年5月18日

離床センサー作成

離床センサー作成

http://www.min-iren.gr.jp/syuppan/shinbun/2002/021114_03.html

 

離床センサー

2008年5月17日

mysql ODBCドライバが表示されない

mysql ODBC driver 表示されない

対策

regeditにて

"HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers"

の既定値(regeditで「(既定)」とあるところ)に空文字列などが入っていないか(「(値の設定なし)」以外の状態になっているので、既定値を削除してやると、「(値の設定なし)」という状態になる。

 

http://d.hatena.ne.jp/hoshimin/20061121#1164122460

2008年5月 3日

Scuttle

MySQLのscuttleデータベース中のsc_tagsテーブルにある、
tagフィールドをvarchar(32)からvarchar(64)とかに変更する。

-------------------------------------------

config.inc.phpの
$nofollow           = false;

-------------------------------------------

.hpacssessファイルに追加

php_value mbstring.internal_encoding UTF-8
php_value mbstring.http_output pass
php_value mbstring.http_input pass
php_flag mbstring.encoding_translation Off

includes/db/mysql4.phpに以下を追加。
function sql_connect{}内の

------------------
45
46
47
48
49
50
if (@mysql_select_db($this->dbname))
 {
    mysql_query('SET NAMES utf8', $this->db_connect_id);//add
  return $this->db_connect_id;
 }
}

------------------------

templates/をカスタマイズ。
Scuttleの見栄えを変更する - にたまごほうれん草を参考

 

http://wp.foliz.net/archives/72

 

2008年5月 1日

productsテーブルにテキストフィールド追加 oscommerce

Add UPC numbers, SKUs, ISBN/ISSN, etc

http://www.oscommerce.com/community/contributions,126

 

This example uses prodct UPC. you can change it to use SKU, ISBN, or whatever you choose.
You can adjust the length of the number of characters in the varchar from 12 to whatever you choose.
If you use something other than UPC, you will also have to alter the "insert" statement and replace UPC with whatever.

 

Add_ISBN_UPC_SKU_v1.zip