adsense

2011-05-27

[oscommerce] 紅利積點_步驟五程式碼片段供修改專用

紅利基點說明
適合版本 MS2
可能不適用免會員購物

原討論區:http://osc.kmd.com.tw/postlite1413-.html%E7%B4%85%E5%88%A9
修改來自原始檔案:
Customer Loyalty Discount Scheme
http://www.oscommerce.com/community/contributions,1286
參考外觀來自http://www.scuba.com.tw/bonus.php
只參考外觀與說明並沒有複製任何網頁與程式若有侵權請告知

若有任何問題請於http://osc.kmd.com.tw/  提出



功能說明

1.
本模組是可設定每樣商品的紅利,如果您購買某商品,即可用多少紅利與現金購買
某商品,例如某樣商品定價100元,紅利10點,表示你可用10點紅利加上90元購買
本商品。所以即使客戶累積的紅利超過商品的金額,但因為每樣商品可扣抵的紅利
有限,不可能有不需付費,完全用紅利換商品或付款為負數的情況發生。
2.
即使隨時安裝本模組,系統也會自動計算客戶之前所有訂單應得的紅利積點
3.
「紅利積點」在購物結帳時,系統將會自動為您扣抵現金,如果還有剩餘點數,
系統會自動計算,您下次購物時還可以使用。商品金額減去您本次消費可扣除
的紅利積點,系統會再依你實際付款的現金換算成點數,累積你的點數。
4.
紅利扣抵現金的程序:在購物車裡
當剩餘的紅利大於商品紅利時,  當次消費的扣點數就是商品紅利
當剩餘的紅利小於商品紅利時,  當次消費的扣點數就是剩餘的紅利
當啟動限制單次消費最大扣點數 ,則比較 限制單次最大扣點數與上述何者小,  做為當次消費的扣點數


一般說明:
後台:

1.可設定是否啟用紅利積點模組。
2.設定每消費幾元就換算紅利一點(為避免複雜目前一點只可扣抵一元)。
3.可設定是否啟用限制單次消費最大扣點數。
4.可設定紅利積點計算期間(不限 年 季 月)。
5.可設定鑑賞期過後才加入紅利。
6.可設定加入會員贈送的點數。
7.如特價商品可設定每樣商品的紅利與紅利的到期日期。

前台

1.每樣商品資料會顯示購買本商品可扣抵多少點或本商品不適用紅利積點。
2.有一個隨機顯示紅利商品的BOX。
3.顯示所有紅利商品。
4.購物車會顯示可用紅利,購買商品可扣抵點數,本次消費實際扣抵點數。
5.我的帳號有一紅利資訊,顯示累積紅利積點,已使用紅利積點,可用紅利積點與尚未累計的紅利。


操作說明

安裝完成後
進入後台
外掛模組 ==> 訂單總計 ==> 安裝紅利積點扣除
裡面有一些參數設定

由於本模組採訂單小計做為紅利的計算基礎,即
   商品價格 - 紅利 = 小計  即客戶實際付款金額做為下次增加紅利的憑據
故紅利積點的排列順序請在小計之前較為合理

另捨棄原程式運費的問題 因為個人認為運費的支出是額外的與紅利無關
有關稅的問題因為對於紅利與稅的關係不是很了解,因此也是捨棄。


************************************************************************************************
本功能修改分兩大步驟

PART I 顯示紅利商品程序

PART II 加入結帳程序



PART I  顯示紅利商品程序:

第一步 後台加入紅利商品部份

1.導入bonus.sql
2.增加檔案
   (A) catalog\admin\bonus.php
   (B) catalog\admin\includes\languages\tchinese\bonus.php
3.修改檔案
   (A) catalog\admin\includes\functions\general.php
   (B) catalog\admin\includes\filenames.php
   (C) catalog\admin\includes\database_tables.php
   (D) catalog\admin\includes\languages\tchinese.php
   (E) catalog\admin\includes\boxes\catalog.php
4.設定納入管理檔案(bonus.php)

第二步 前台顯示紅利商品部份

5. 增加檔案
   (A) catalog\includes\boxes\bonus.php
   (B) catalog\includes\functions\bonus.php
   (C) catalog\bonus.php
   (D) catalog\includes\languages\tchinese\bonus.php
 
6. 修改檔案
   (A) catalog\includes\functions\general.php
   (B) catalog\includes\filenames.php
   (C) catalog\includes\database_tables.php
   (D) catalog\includes\application_top.php
   (E) catalog\product_info.php
   (F) catalog\includes\column_right.php
   (G) catalog\includes\languages\thinese.php


PART II 加入結帳程序

7.增加檔案
   (A) catalog\includes\modules\order_total\ot_loyalty_discount.php
   (B) catalog\includes\languages\tchinese\modules\order_total\ot_loyalty_discount.php

8.修改檔案
   (A) catalog\shopping_cart.php
   (B) catalog\includes\classes\order.php
   (C) catalog\checkout_shipping.php
   (D) catalog\checkout_confirmation.php
   (E) catalog\account.php
 

***********************************************************************************************
安裝步驟

PART I  顯示紅利商品程序:

第一步 後台加入紅利商品部份

###############################################################

1.導入bonus.sql

   使用phpMyAdmin將bonus.sql導入資料庫

################################################################

2.增加下列檔案到正確位置

   (A) catalog\admin\bonus.php
   (B) catalog\admin\includes\languages\tchinese\bonus.php

################################################################

3.修改檔案
   (A) catalog\admin\includes\functions\general.php

###找到

   // Sets the status of a product on special
  function tep_set_specials_status($specials_id, $status) {
    if ($status == '1') {
      return tep_db_query("update " . TABLE_SPECIALS . " set status = '1', expires_date = NULL, date_status_change = NULL where specials_id = '" . (int)$specials_id . "'");
    } elseif ($status == '0') {
      return tep_db_query("update " . TABLE_SPECIALS . " set status = '0', date_status_change = now() where specials_id = '" . (int)$specials_id . "'");
    } else {
      return -1;
    }
  }

###在下面加入:

//設定紅利商品的顯示狀態
  function tep_set_bonus_status($bonus_id, $status) {
    if ($status == '1') {
      return tep_db_query("update " . TABLE_BONUS . " set status = '1', expires_date = NULL, date_status_change = NULL where bonus_id = '" . (int)$bonus_id . "'");
    } elseif ($status == '0') {
      return tep_db_query("update " . TABLE_BONUS . " set status = '0', date_status_change = now() where bonus_id = '" . (int)$bonus_id . "'");
    } else {
      return -1;
    }
  }

###找到
 
   tep_db_query("delete from " . TABLE_SPECIALS . " where products_id = '" . (int)$product_id . "'");

###在下面加入:

   tep_db_query("delete from " . TABLE_BONUS . " where products_id = '" . (int)$product_id . "'");

##############################################################################################

3.修改檔案
     (B) catalog\admin\includes\filenames.php

###找到

    define('FILENAME_SPECIALS', 'specials.php');

###在下面加入:

   define('FILENAME_BONUS', 'bonus.php');

#############################################################################################

3.修改檔案
     (C) catalog\admin\includes\database_tables.php

###找到

   define('TABLE_SPECIALS', 'specials');

###在下面加入:

   define('TABLE_BONUS', 'bonus');

###########################################################################################

3.修改檔案

   (D) catalog\admin\includes\languages\tchinese.php

###找到

   define('BOX_CATALOG_SPECIALS', '特價商品');

###在下面加入:

   define('BOX_CATALOG_BONUS', '紅利商品');

###找到

   define('TEXT_DISPLAY_NUMBER_OF_SPECIALS', '顯示 %d%d (共 %d 個特價商品)');

###在下面加入

   define('TEXT_DISPLAY_NUMBER_OF_BONUS', '顯示 %d%d (共 %d 個紅利商品)');

#################################################################################################

3.修改檔案

  (E) catalog\admin\includes\boxes\catalog.php

###找到

   tep_admin_files_boxes(FILENAME_SPECIALS, BOX_CATALOG_SPECIALS) .

###在下面加入

   tep_admin_files_boxes(FILENAME_BONUS, BOX_CATALOG_BONUS) .

################################################################################################

4.設定納入管理檔案(bonus.php)

   進入後台

==>   管理者

==>   設定納入管理檔案

==>   Administrator

==>   將bonus.php納入管理檔案


 
第二步 前台顯示紅利商品部份

######################################################################################
 5.增加下列檔案到正確位置

   (A) catalog\includes\boxes\bonus.php
   (B) catalog\includes\functions\bonus.php
   (C) catalog\bonus.php
   (D) catalog\includes\languages\tchinese\bonus.php
 
######################################################################################

 6. 修改檔案
        (A) catalog\includes\functions\general.php

###找到

    // Return a product's special price (returns nothing if there is no offer)
// TABLES: products
  function tep_get_products_special_price($product_id) {
    $product_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . (int)$product_id . "' and status");
    $product = tep_db_fetch_array($product_query);
   
    return $product['specials_new_products_price'];
  }

###在下面加入

  // 取得product的紅利
 function tep_get_products_bonus_price($product_id) {
    $product_query = tep_db_query("select bonus_new_products_price from " . TABLE_BONUS . " where products_id = '" . (int)$product_id . "' and status");
    $product = tep_db_fetch_array($product_query);
   
    return $product['bonus_new_products_price'];
  }

####################################################################################################################################################################

6. 修改檔案
       (B) catalog\includes\filenames.php

###找到
     
     define('FILENAME_SPECIALS', 'specials.php');

###在下面加入

     define('FILENAME_BONUS', 'bonus.php');

############################################################################################

6. 修改檔案
       (C)catalog\includes\database_tables.php

###找到

      define('TABLE_SPECIALS', 'specials');

###在下面加入

     define('TABLE_BONUS', 'bonus');

#############################################################################################

6. 修改檔案
        (D) catalog\includes\application_top.php

###找到

        // auto expire special products
  require(DIR_WS_FUNCTIONS . 'specials.php');
  tep_expire_specials();

###在下面加入

       //檢測紅利商品的日期
  require(DIR_WS_FUNCTIONS . 'bonus.php');
  tep_expire_bonus();

################################################################################################

6. 修改檔案
       (E) catalog\product_info.php

###找到

   

###在下面加入

   
    '."紅利 : ".($bonus ? $bonus." 點" : "本商品非紅利商品").''; ?>

####################################################################################################

6. 修改檔案
       (F) catalog\includes\column_right.php

###找到

      include(DIR_WS_BOXES . 'specials.php');

###在下面加入

      include(DIR_WS_BOXES . 'bonus.php');

##################################################################################################
6. 修改檔案
      (G) catalog\includes\languages\thinese.php

####找到

      define('BOX_HEADING_SPECIALS', '特價書籍');

###在下面加入

      define('BOX_CATALOG_BONUS', '紅利商品');

####找到

      define('TEXT_DISPLAY_NUMBER_OF_SPECIALS', '顯示 %d 到 第 %d (共 %d 項特價)');

###在下面加入

      define('TEXT_DISPLAY_NUMBER_OF_BONUS', '顯示 %d 到 第 %d (共 %d 項紅利)');
   
**************************************************************************************
  以上程序是仿特價商品的模式                                                         *
  如果完成上述程序                                                                   *
  在後台商品屬性裏會有紅利商品的選項                                                 *
  操作方式與特價商品雷同                                                             *
  前台商品說明頁會有紅利點數                                                         *
  紅利商品的BOX與頁面                                                                *
**************************************************************************************


PART II 加入結帳程序


######################################################################################

7.增加下列檔案到正確位置

    (A) catalog\includes\modules\order_total\ot_loyalty_discount.php
    (B) catalog\includes\languages\tchinese\modules\order_total\ot_loyalty_discount.php

######################################################################################

8.修改檔案
   (A) catalog\shopping_cart.php

在  for ($i=0, $n=sizeof($products); $i<$n; $i++) {

與 // Push all attributes information in an array

之間

### 加入

    // 取得商品的紅利積點    
    $products[$i]['bonus']=tep_get_products_bonus_price($products[$i]['id']);

###找到

if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) {
        reset($products[$i]['attributes']);
        while (list($option, $value) = each($products[$i]['attributes'])) {
          $products_name .= '
- ' . $products[$i][$option]['products_options_name'] . ' ' . $products[$i][$option]['products_options_values_name'] . '';
        }
      }

###在下面加入

     //顯示紅利積點
      if (isset($products[$i]['bonus'])){
      $products_name .= '
'."紅利 :".(int)($products[$i]['bonus'])."X".$products[$i]['quantity']."=".(int)($products[$i]['bonus'])*$products[$i]['quantity'].'';
      } else {
      $products_name .= '
'."本商品非紅利商品".'';
      }
      $total_product_bonus += (int)($products[$i]['bonus'])*$products[$i]['quantity'];
      //顯示紅利積點end

###找到

     
        format($cart->show_total()); ?>
     

###在下面加入

     
     
            $order_get_bouns = new ot_loyalty_discount;
           if (MODULE_LOYALTY_DISCOUNT_STATUS == 'true') {
      ?>
     
       
     
         
             
              $remain_bonus = $order_get_bouns->get_total_bonus() - $order_get_bouns->get_used_bonus();
             
              $bonus = $total_product_bonus;
              if ($total_product_bonus > $remain_bonus) $bonus = $remain_bonus;
              if((MODULE_LOYALTY_LIMIT_DISCOUNT == 'true') && ( $bonus > MODULE_LOYALTY_LIMIT_VALUE)) $bonus = MODULE_LOYALTY_LIMIT_VALUE;
             
          ?>
             
           
             

                 
     
                 

                 

                 

             

               
'."紅利積點扣除:".$currencies->display_price($bonus,0,1).'' ?>

             
     
     
       
     
     
        format($cart->show_total()-$bonus); ?>
     
     
        }
        if (!tep_session_is_registered('bonus')) tep_session_register('bonus');
      ?>    
     


################################################################################################

8.修改檔案
      (B) catalog\includes\classes\order.php

###找到
function cart() {
      global $customer_id, $sendto, $billto, $cart, $languages_id, $currency, $currencies, $shipping, $payment;


###改成

function cart() {
      global $customer_id, $sendto, $billto, $cart, $languages_id, $currency, $currencies, $shipping, $payment ,$bonus;

###找到(大約下面幾行)

    'shipping_cost' => $shipping['cost'],
    'subtotal' => 0,

###在下面加入

     'bonus' => $bonus,

################################################################################################
8.修改檔案
    (C) catalog\checkout_shipping.php

###找到

// if there is nothing in the customers cart, redirect them to the shopping cart page
  if ($cart->count_contents() < 1) {
    tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));
  }

###改成

// if there is nothing in the customers cart, redirect them to the shopping cart page
//增加紅利積點的修改
  if (($cart->count_contents() < 1) ||(!tep_session_is_registered('bonus'))){
    tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));
  }

#########################################################################################
8.修改檔案
   (D) catalog\checkout_confirmation.php

###找到


       
     
     
       
     

###在上面加入


     
       ?>
     
       
     
     
       

       

             

   

               

             

         
'."本次交易新增點數:" . $od_amount." 點".''; ?>

       

 
                 
     
               }
               ?>

################################################################################################

8.修改檔案
   (E) catalog\account.php

###找到




###在上面加入

           
         
             {
        ?>
     
         
         
     
       

         

           

         

       

       
     
       

         

           
           

         

       

             

               
               

             

             

               

             
             

           

               
                     $order_get_bouns = new ot_loyalty_discount;
               ?>      
                   

                     

                     

                     
 
                   

                   

                       

                   

                   

                   

                   

                 
get_total_bonus()." 點"; ?> get_used_bonus()." 點"; ?> get_total_bonus())-($order_get_bouns->get_used_bonus()))." 點"; ?>
'."當貨品寄出".((MODULE_LOYALTY_DISCOUNT_EXAMINE == 7) ? "七天之後(鑑賞期七天)" : "後").",系統會自動幫您加入尚未累計的點數".'' ?>
'."尚未累計的紅利點數:".'' ?>

                 
 
                   

                   

                   

                   

                   

                   

                   
 
                   

                   
                   
                  //選擇訂單狀態小於已出貨
                  $bonus_query_raw = "select o.orders_id, o.date_purchased, o.last_modified, ot.value as order_total, s.orders_status_name from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id) ," . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . $customer_id . "' and ot.class = 'ot_total' and o.orders_status < '" . $order_get_bouns->loyalty_order_status . "' and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' order by date_purchased DESC";
                    $bonus_query = tep_db_query($bonus_query_raw);
                     while ($bonus = tep_db_fetch_array($bonus_query)) {
                     $to_bonus += round(($bonus['order_total']/$order_get_bouns->od_pc),0);
                  ?>
                 

                   

                   

                   

                   

                   

                   

                 

                   
                        }
                   //選擇訂單狀態等於已出貨但未過鑑賞期    
                   $bonus_query_raw = "select o.orders_id, o.date_purchased, o.last_modified, ot.value as order_total, s.orders_status_name from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id) ," . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . $customer_id . "' and ot.class = 'ot_total' and o.orders_status = '" . $order_get_bouns->loyalty_order_status . "' and now() < DATE_ADD(o.last_modified, INTERVAL '" . $order_get_bouns->examine . "' DAY ) and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' order by date_purchased DESC";
                    $bonus_query = tep_db_query($bonus_query_raw);
                     while ($bonus = tep_db_fetch_array($bonus_query)) {
                     $to_bonus += round(($bonus['order_total']/$order_get_bouns->od_pc),0);
                  ?>
                 

                   

                   

                   

                   

                   

                   

                 

                 
                  }
                  if ($to_bonus==0) {
                  ?>
                 

                 

                 

                 

                 
                      } else {    
                     ?>
                 

                   

                   

                   
 
                   

                   
 
                 

                   
                      }
                    ?>
                       
               
od_pc),0)." 點"; ?>
'. $bonus['orders_status_name'].'
'.tep_date_short($bonus['last_modified']).''; ?>
od_pc),0)." 點"; ?>

           
         
          }
          ?>
         
       

############################################################################################

2011-05-25

如何以學生身分註冊 dreamspark



進入  https://www.dreamspark.com/Default.aspx  dreamspark
點選 change language
選擇繁體中文


點選登入


點選註冊



輸入學校 email 


輸入驗證碼
點選繼續

輸入基本資料



輸入設定申請帳號的email
以此例
a886886@std.must.edu.tw


點選繼續

傳送電子郵件



收件夾會出現兩封信
第一封是歡迎使用

開啟第二封



點選驗證您的帳號  的網址

會跳出  以驗證  
點選確定


點選
download  or get verified
都可以



問題二   點選student
問題三  點選 get verified through my school




 選擇您念的學校



輸入email 
就是往們剛剛註冊的那個
a886886@std.must.edu.tw 

告訴你說  他已經寄出了一封信


收到  打開



點選 access url的網址


貼上您的序號



大功告成

dreamspark 軟體清單

只要您是學生您就可以免費下載 以下軟體


visual studio 210
windows phone
certification exam
pluaralsight
smallbasic
kodu game lab
mathematics
game studio 4.0
windows server 2008 r2
visual studio 2008 professional edition
windows server 2008
expression studio4  uitmate
sql server 2008 developer
robotics developer studio 2008 r3
virtual pc
windows multipoint mouse sdk
windows embedded standard 7
windows embedded compact 7
windows embedded ce6.0
visual studio 2010 express
sql server express
visual basic 2008  express edition
visual c#2008 express edition
visual c++2008 express edition
visual web developer 2008 express edition
windows server 2003



有圖有真相

2011-05-17

5/16 A&Q商品問與答中文安裝說明

 前台部份:

   開啟/catalog/includes/
   filenames.php
   在最後?>之前置入:
 
//aq start
  define('FILENAME_PRODUCT_AQ', 'product_aq.php');
  define('FILENAME_PRODUCT_AQ_BOX', 'product_aq_box.php');
  define('FILENAME_ANSWERS_QUESTIONS', 'answers_questions.php');
  define('FILENAME_PRODUCT_AQ_INFO', 'product_aq_info.php');
  define('FILENAME_PRODUCT_AQ_WRITE', 'product_aq_write.php');
  define('FILENAME_LOGIN_AQ', 'login_aq.php');
//aq end
■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
1.
   開啟/catalog/includes/
   database_tables.php
   在最後?>之前置入:
 
//aq start
  define('TABLE_PRODUCT_QUESTIONS', 'product_questions');
  define('TABLE_PRODUCT_QUESTIONS_DESCRIPTION', 'product_questions_description');
  define('TABLE_PRODUCT_ANSWERS_DESCRIPTION', 'product_answers_description');
//aq end

■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
2. 開啟catalog\includes\languages\
tchinese.php
   在最後?>之前置入:
   
//aq start  
define('TEXT_DISPLAY_NUMBER_OF_AQ', '顯示 %d 到 第%d (共 %d 則 問與答)');
define('TEXT_AQ_BY', '%s 詢問:');
define('TEXT_AQ_WORD_COUNT', '%s   字');
define('TEXT_AQ_DATE_ADDED', '%s');
define('TEXT_NO_AQ', '目前沒有任何商品問答!');
define('JS_QUESTIONS_TEXT', '* 您的問題內容最少要' . (REVIEW_TEXT_MIN_LENGTH/2) . '個字!');
//aq end
■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
3. 開啟catalog\
product_info.php
   找到
         ' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . ''; ?>
   在這段前面置入:
         ' . tep_image_button('button_aq.gif', '') . ''; ?>                    
   
   以下這一個步驟是讓你的商品頁直接顯示問與答列表(如果不想如此,就省略此步驟):
 
   找到

    }

    if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) {
?>

   整段改為:

    }
?>

 


    if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) {
?>    
■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■

4. 後台部份:

   開啟/admin/includes/
   filenames.php
   在最後?>之前置入:

//aq start
  define('FILENAME_PRODUCT_AQ', 'product_aq.php');
  define('FILENAME_PRODUCT_AQ_INFO', 'product_aq_info.php');
  define('FILENAME_ANSWERS_QUESTIONS', 'answers_questions.php');
//aq end            
■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■                          
5. 開啟/admin/includes/
database_tables.php
   在最後?>之前置入:
 
//aq start
  define('TABLE_PRODUCT_QUESTIONS', 'product_questions');
  define('TABLE_PRODUCT_QUESTIONS_DESCRIPTION', 'product_questions_description');
  define('TABLE_PRODUCT_ANSWERS_DESCRIPTION', 'product_answers_description');
//aq end          
■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
6. 開啟/admin/includes/boxes/
catalog.php

  找到                
          '' . BOX_CATALOG_REVIEWS . '
' .
  在後面置入:        
          '' . BOX_CATALOG_QUESTIONS . '
' .    
 
■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
7. 開啟\admin\includes\languages\
tchinese.php

    找到
    define('BOX_CATALOG_REVIEWS', '商品評論');
    後面插入
    define('BOX_CATALOG_QUESTIONS', '商品問與答');
 
    找到
    define('TEXT_DISPLAY_NUMBER_OF_REVIEWS', '顯示 %d%d (共 %d 個商品評論)');
    後面插入
    define('TEXT_DISPLAY_NUMBER_OF_QUESTIONS', '顯示 %d%d (共 %d 個商品問與答)');

2011-05-06

[msql] 4/29 Commerce 前置設定

cmd
root 登入
輸入以下

set password for 'root'@'localhost'=password('123');
flush privileges;
create database kmdbamb_osc;
grant all privileges on kmdbamb_osc.* to 'kmdbamb_oscuser'@'localhost' identified by '123' with grant option;
flush privileges;

帳號: kmdbamb_oscuser
密碼: 123

2011-05-02

[java] 字元分割 擷取前面四個字串

/**
 * @(#)test.java
 *
 *
 * @author
 * @version 1.00 2011/4/29
 */


public class test {

    public static void main(String[] args){
     String vData = "1,2,3,4,5,6,7,8,9";

// 用哪個字元分割
String[] vElement = vData.split(",");
for( int i = 0; i < vElement.length; i++ )
   System.out.println( vElement[i] );

 //擷取前面四個字串
 int n=4;
 System.out.println("字串:"+vData);

    System.out.println(" 前方 "+n+" 個字第"+vData.substring(0,n));
     }

}


執行結果