質問 > フロント機能 > LC_Page_Admin_Products_Product.phpのfunctionをLC_Page_FrontParts_Bloc_New_Products.phpで起動することは可能でしょうか。 |
フロント機能
フラット表示 | 前のトピック | 次のトピック |
投稿者 | スレッド |
---|---|
aozora |
投稿日時: 2013/4/15 18:37
対応状況: −−−
|
常連 登録日: 2013/3/21 居住地: 投稿: 40 |
Re: LC_Page_Admin_Products_Product.phpのfunctionをLC_Page_FrontParts_Bloc_New_Products.phpで起動することは可能でしょうか。 yuh様、
お世話になっております。ご教授頂きまして感謝致します。長くて大変申し訳ございませんが何とかご教授頂けませんでしょうか。 商品詳細ページ上部の金額に関しましてはSC_Product.phpのfunction getDetail($productId)にどのようにgetListByProductIdsを組み込みましたら宜しいのでしょうか。プラグインの最近チェックした商品に関しましてもどのように組み込んだら宜しいか基本的な考え方をご教授頂けませんでしょうか。 また現在新着商品に関する2パターンを試しております。?プラグインの新着商品のphpファイルにgetListByProductIdsの箇所を追加する方法と、?LC_Page_Products_List.phpの相当箇所を使い新着商品用のphpファイルを作り、whereで絞込みをかける方法です。 まず、どちらを選択すべきでしょうか。あるいは他の方法にすべきなのでしょうか。 ? の場合、既存の下記の様なphpファイルのどこにgetListByProductIds関するどの箇所を付け加えればよろしいでしょうか。 function getNewProducts($limit, $period){ $objQuery =& SC_Query_Ex::getSingletonInstance(); $col = <<< __EOS__ p.product_id, p.name, ・・・・・・・・・・・・・・・・・・・・ $from = <<< __EOS__ dtb_products as p ・・・・・・・・・・・・・・・・・・・・・・ $where = "ct.category_id = 9 AND p.del_flg = 0 AND p.status = 1 AND p.create_date >= ?"; ・・・・・・・・・・・・・・・・・・・・・・ return $objQuery->select($col, $from, $where, $arrval); ? の場合tplは変更することなくして、割引額変更が機能していますが、全商品が表示されます。以下の記述をどう変更すれば良いと思われますでしょうか。 function lfGetNewProducts($searchCondition, $objProduct, $where, $limit, &$period) { $arrOrderVal = array(); $objQuery =& SC_Query_Ex::getSingletonInstance(); // 表示順序 switch ($this->orderby) { default: $dtb_product_categories = 'dtb_product_categories'; $where = "dtb_product_categories.category_id = 9 AND dtb_products.del_flg = 0 AND status = 1 AND create_date >= ?"; } // 取得範囲の指定(開始行番号、行数のセット) // 表示すべきIDとそのIDの並び順を一気に取得 $arrProductId = $objProduct->findProductIdsOrder($objQuery, array_merge($searchCondition['arrval'], $arrOrderVal)); $objQuery =& SC_Query_Ex::getSingletonInstance(); $arrProducts = $objProduct->getListByProductIds($objQuery, $arrProductId); // 規格を設定 $objProduct->setProductsClassByProductIds($arrProductId); $arrProducts['productStatus'] = $objProduct->getProductStatus($arrProductId); return $arrProducts; } function findProductIdsOrder(&$objQuery, $arrVal = array()) { ・・・・・・・・・・・・・・・・・・ |
フラット表示 | 前のトピック | 次のトピック |