PHP_CGI: 2008年5月アーカイブ

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

<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

★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>

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

 

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

 

このアーカイブについて

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

前のアーカイブはPHP_CGI: 2008年2月です。

次のアーカイブはPHP_CGI: 2008年6月です。

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