Archive for 9 月, 2009

zencart:商品項目追加その3

Posted on 月曜日, 9 月 7th, 2009 at 4:19 PM

にて ちょっと勢いに乗ってそのままその3。(つまりその1やその2の続きw

TOPページの新着にも~~w その他は 応用。

/includes/functions/functions_lookups.

/*********************************/
  function zen_get_products_new_up($products_id) {
    global $db;
    $products_id = zen_get_prid($products_id);
    $product_query = "select products_new_up
                    from " . TABLE_PRODUCTS . "
                    where products_id = '" . (int)$products_id . "'";

    $product =$db->Execute($product_query);

    return $product->fields['products_new_up'];
  }
/***************************************/

/includes/modules/テンプレート/new_products.
    $new_products->fields['products_new_up'] = zen_get_products_new_up($new_products->fields['products_id']);

$before3days = date("Y-m-d.h:i:s",strtotime("-72 hours",time()));
 if ($before3days < $new_products->fields['products_date_added'] ){
if($new_products->fields['products_new_up']== "1"){
        $display_products_new_up = '<img src="/includes/templates/テンプレート/images/new_74.gif">';
   
 } else {
        $display_products_new_up = '<img src="/includes/templates/テンプレート/images/up_54.gif">';
      }}else {
        $display_products_new_up ='';
}
-----

好きなとこに $display_products_new_up を

あ。忘れてた・・・。

画像の場合altを付けないといけないので

------

TOP新着

/includes/modules/テンプレート/new_products.

$display_products_new_up = '<img src="/includes/templates/テンプレート/images/new_74.gif" alt="' . TEXT_PRODUCTS_NEW .'">';

とかにする

includes/languages/テンプレート/japanese.(日本語)

-----

新着一覧

/includes/templates/テンプレート/templates/tpl_modules_products_new_listing.

       $display_products_new_up = '<img src="/includes/templates/テンプレート/images/up_54.gif" alt="' . TEXT_PRODUCTS_UP .'">';

とか altを付ける。(もちろんnewもupも両方。)その場合の日本語は次の場所

日本語

/includes/languages/japanese/テンプレート/products_new.

define('TEXT_PRODUCTS_NEW','新製品');
define('TEXT_PRODUCTS_UP','再入荷品');

------

商品詳細

/includes/languages/japanese/テンプレート/product_info. (日本語)

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

includes/templates/テンプレート/templates/tpl_product_info_display.

<?

$display_products_new = '<img src="/includes/templates/テンプレート/images/new_74.gif" alt="' . TEXT_PRODUCTS_NEW .'">';
$display_products_up = '<img src="/includes/templates/テンプレート/images/up_54.gif" alt="' . TEXT_PRODUCTS_UP .'">';

$before3days = date("Y-m-d.h:i:s",strtotime("-72 hours",time()));
  if ($products_new_up == 1 and ($before3days < $products_date_added )) {
echo $display_products_new;
}
elseif ($products_new_up == 0 and ($before3days < $products_date_added ) )
{
echo $display_products_up;
}else {
echo  '';
}

関連記事

zencart:商品項目追加その2

Posted on 月曜日, 9 月 7th, 2009 at 2:20 PM

商品項目追加・・・・詳細画面にて表示

その他の画面にて表示させる。例えば「新着一覧」。

DBの configuration  を見ると ・・・・こんな感じw

configuration_id  409~492
configuration_title 商品画像を表示 ~ 複数商品の数量欄の有無・表示位置
configuration_key  PRODUCT_NEW_LIST_IMAGE ~ PRODUCT_NEW_LISTING_MULTIPLE_ADD_TO_CART
configuration_value  1101 ~
configuration_description  商品画像を表示しますか? ~ 
configuration_group_id 21
sort_order  1 ~ 25
last_modified  ~ 2007-08-05 23:15:56
date_added  ~ 2007-07-30 23:55:02
use_function
set_function

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

追加してみるw 管理画面 「一般設定」「新着商品リストの設定」

configuration_id  未使用であれば、何番でもいいのでしょうw 「600」
configuration_title 表示タイトル
configuration_key 未使用ならば?何でも おk。「PRODUCT_NEW_LIST_●●●」
configuration_value  お好みで。「2101」
configuration_description 表示詳細
configuration_group_id 21 新着一覧は 21なので 「21」
sort_order   表示順番 「26」
その他テキトーw
(おすすめは「22」全商品は「23」)

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

INSERT INTO `zen_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 ('600', '●●●または●●●の表示', 'PRODUCT_NEW_LIST_●●●', '2101', '●●●を表示しますか?<br />
<br />
・0= off<br />
・1桁目:左か右か<br />
・2・3桁目:(他の表示項目との)ソート順<br />
・4桁目:表示後の改行(br)数<br />', '21', '26', NULL, '2009-09-07 14:39:32', NULL, NULL);

-----------

/modules/pages/products_new/header_php.

p.products_new_up,

----------
/includes/templates/テンプレート/templates/tpl_modules_products_new_listing.
に追加する。

テキトーに・・・・

if (PRODUCT_NEW_LIST_●●● != '0') {
}

if ($disp_sort_order->fields['configuration_key'] == 'PRODUCT_NEW_●●●' ) {
}

------

$before3days = date("Y-m-d.h:i:s",strtotime("-72 hours",time()));

      if (PRODUCT_NEW_LIST_●●●)!= '0'and ($before3days < $products_new->fields['products_date_added'] )){
if($products_new->fields['products_new_up']== "1"){
        $display_products_●●● = '<img src="/includes/templates/テンプレート/images/new_74.gif">';
      } else {
        $display_products_●●●= '<img src="/includes/templates/テンプレート/images/up_54.gif">';
      }
    } else {
        $display_products_●●●= '';
    }

-------------
                $disp_sort_order = $db->Execute("select configuration_key, configuration_value from " . TABLE_CONFIGURATION . " where configuration_group_id='" . $group_id . "' and (configuration_value >= 1000 and configuration_value <= 1999) order by LPAD(configuration_value,11,0)");

関連記事

zencart:UTF-8

Posted on 日曜日, 9 月 6th, 2009 at 5:33 PM

MySQL : 4.1.25
: 5.2.8
Apache : 1.3.41
:1.3.0.2

character set に ujis がなかった。(泣)
レンタルサーバーなのでmy.cnf などは無理そう。。をUTF-8にする。
ぐぐればいろいろ情報があるようで感謝。
インストールする前に
mb-emulator/以外 EUCを全てUTF-8へ変更。zc_install/も admin/も
/includes/classes/db/mysql/query_factory.
36行位に以下を追記
if (version_compare(mysql_get_server_info(), '4.1.0', '>=')) {
            mysql_query('SET NAMES "utf8"', $this->link);}

~~~インストール~~~
管理画面でエラー+ログイン不可(IDとパスは正しいが画面変化なし)

admin側エラー
Fatal error: Call to a member function Execute() on a non-object in /usr/local/www/htdocs/テンプレート/public_html/includes/functions/strict_sessions. on line 66
--対処--
/admin/includes/configure.
77行目辺り
  define('STORE_SESSIONS', 'db'); // leave empty '' for default handler or set to 'db'
を次のようにする。
  define('STORE_SESSIONS', ''); // leave empty '' for default handler or set to 'db'

--エラー非表示・ログイン可能---(同様に店舗側ログインも不可な可能性がある)
-------------------
商品登録時エラー

1062 Duplicate entry '230-1' for key 1
in:
[insert into products_description (products_name, products_description, products_url, products_id, language_id) values ('', '', '', '230', '1')]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.

型番 空白時エラー発生?
-----
MySQL

show character set;

CREATE DATABASE DEFAULT CHARACTER SET ujis;

----------

host--鯖

関連記事

IEハック

Posted on 金曜日, 9 月 4th, 2009 at 1:19 PM

ややこいのでメモに残す。

のバージョンにより表示が異なる。ので個々のバージョンのハックを。。

7を基準にしてみた。

/*****IE7************/
.topnew1{
 left:300px; top:215px;
}
/*****IE7************/

/*****IE6************/
* html .topnew1{
left:300px;
}
/*****IE6************/

/*****IE8************/
html>/**/body .topnew1{
 top/*\**/:195px\9;
}
/*****IE8************/

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

/*****IE5.5&6************/
.topnew1{
        _left:480px;
}
/*****IE5.5&6************/

関連記事