質問 > フロント機能 > LC_Page_Admin_Products_Product.phpのfunctionをLC_Page_FrontParts_Bloc_New_Products.phpで起動することは可能でしょうか。 |
フロント機能
スレッド表示 | 古いものから | 前のトピック | 次のトピック | 下へ |
投稿者 | スレッド |
---|---|
aozora |
投稿日時: 2013/5/13 15:13
対応状況: −−−
|
常連 登録日: 2013/3/21 居住地: 投稿: 40 |
Re: LC_Page_Admin_Products_Product.phpのfunctionをLC_Page_FrontParts_Bloc_New_Products.phpで起動することは可能でしょうか。 yuh様
お世話になっております。 アドバイス頂きました様にSC_Product.phpのgetProductsClassByQueryでgetListByProductIdsを組み込みましたところセッションページにおきましても金額に変更箇所が反映されております。 微調整も含めまして、やっと終了したように思われます。 最初の段階ではここまで来るとは予想もつきませんでした。 全てyuh様のご教授そしてご尽力のおかげでございます。 そしてeccubeは本当に素晴らしいフォーラムであると感しております。 長い間懇切丁寧にご教授頂きまして心より感謝致します。 本当にありがとうございます。 |
yuh |
投稿日時: 2013/5/13 10:33
対応状況: −−−
|
神 登録日: 2013/1/9 居住地: 大阪 投稿: 1819 |
Re: LC_Page_Admin_Products_Product.phpのfunctionをLC_Page_FrontParts_Bloc_New_Products.phpで起動することは可能でしょうか。 そこらへんの部分はSESSION絡むので若干めんどくさい部分ですね。
とりあえず元の金額を読み出す部分をすべて適応させていった方がいいかもしれないです。 SC_Productsの金額絡む部分すべてを変更していったらいいかもしれないですね。 |
aozora |
投稿日時: 2013/5/7 0:28
対応状況: −−−
|
常連 登録日: 2013/3/21 居住地: 投稿: 40 |
Re: LC_Page_Admin_Products_Product.phpのfunctionをLC_Page_FrontParts_Bloc_New_Products.phpで起動することは可能でしょうか。 yuh様、
お世話になっております。申し訳ございません。 商品詳細ページの続きで、以下のページ(金額の項目)にても金額を表示している箇所があり、それらにも率変更を反映させる設定にしようと取り組んでおりますが、非常に難しいです。 ?cart/index.php(<!--{$item.price|sfCalcIncTax|number_format}-->)、 ?shopping/payment.php(<!--{$arrPrices.subtotal|number_format}-->)、 ?shopping/confirm.php(<!--{$item.price|sfCalcIncTax|number_format}-->)、 ?、?はSC_CartSession.phpのgetCartListに以下の記述があり、どのようにgetListByProductIdsを組み込むべきか思案しております。 $price = $this->cartSession[$productTypeId][$i]['productsClass']['price02']; $this->cartSession[$productTypeId][$i]['price'] = $price; ?に関しましてはSC_CartSession.phpのcalculateに以下の記述があり、どのようにgetListByProductIdsを組み込むべきか思案しております。 $results['subtotal'] = $this->getAllProductsTotal($productTypeId); 度々申し訳ございませんが何とかご教授頂けませんでしょうか。 |
aozora |
投稿日時: 2013/4/26 18:23
対応状況: −−−
|
常連 登録日: 2013/3/21 居住地: 投稿: 40 |
Re: LC_Page_Admin_Products_Product.phpのfunctionをLC_Page_FrontParts_Bloc_New_Products.phpで起動することは可能でしょうか。 yuh様
できました。getDetailにてgetListByProductIdsが機能しており、所定の箇所にて変更する数字がリアルタイムで金額に反映されております。大変良い勉強をさせて頂きました。また長い間ご対応、ご教授頂きまして感謝いたします。本当にありがとうございます。 |
yuh |
投稿日時: 2013/4/23 2:06
対応状況: −−−
|
神 登録日: 2013/1/9 居住地: 大阪 投稿: 1819 |
Re: LC_Page_Admin_Products_Product.phpのfunctionをLC_Page_FrontParts_Bloc_New_Products.phpで起動することは可能でしょうか。
ソースの一部間違えてました。 これで動くはずです。 |
aozora |
投稿日時: 2013/4/19 18:55
対応状況: −−−
|
常連 登録日: 2013/3/21 居住地: 投稿: 40 |
Re: LC_Page_Admin_Products_Product.phpのfunctionをLC_Page_FrontParts_Bloc_New_Products.phpで起動することは可能でしょうか。 Yuh様
お世話になっております。ご教授頂きましてありがとうございます。 長くなって申し訳ございませんが、頂きました記述を適応させましたところ、金額が同じままで、反映されていない模様でございます。いろいろと試しておりますと金額が0になったりもいたしますが、以下の記述(金額が同じまま)で何かお分かりになりますでしょうか。ご教授の程お願いします。 function getDetail($productId) { $objQuery =& SC_Query_Ex::getSingletonInstance(); $objProduct = new SC_Product_Ex(); $arrProduct = $objQuery->getRow('*', $this->alldtlSQL('product_id = ?'),'product_id = ?',array($productId, $productId)); $arrProduct = (array)$arrProduct; // 税込金額を設定する SC_Product_Ex::setIncTaxToProduct($arrProduct); $arrProductId = array(); foreach ($arrProductData as $productdetail) {$arrProductId[] = $productdetail['product_id'];} $arrProducts = $objProduct->getListByProductIds($objQuery, //$arrProductId); $arrProduct['price03_max'] = $arrProducts[0]['price03_max']; $arrProduct['price04_max'] = $arrProducts[0]['price04_max']; $arrProduct['price05_max'] = $arrProducts[0]['price05_max']; $arrProduct['price03_min'] = $arrProducts[0]['price03_min']; $arrProduct['price04_min'] = $arrProducts[0]['price04_min']; $arrProduct['price05_min'] = $arrProducts[0]['price05_min']; return $arrProduct; } |
yuh |
投稿日時: 2013/4/18 1:55
対応状況: −−−
|
神 登録日: 2013/1/9 居住地: 大阪 投稿: 1819 |
Re: LC_Page_Admin_Products_Product.phpのfunctionをLC_Page_FrontParts_Bloc_New_Products.phpで起動することは可能でしょうか。
こんな感じですか? |
aozora |
投稿日時: 2013/4/17 17:45
対応状況: −−−
|
常連 登録日: 2013/3/21 居住地: 投稿: 40 |
Re: LC_Page_Admin_Products_Product.phpのfunctionをLC_Page_FrontParts_Bloc_New_Products.phpで起動することは可能でしょうか。 Yuh様
お世話になっております。そしてご教授頂きましてありがとうございます。 新着商品の記述は反映されました。ありがとうございます。 現在、商品詳細ページおよび最近チェックした商品に取り組んでおります。両方ともSC_Product.phpのgetDetailを使用していると思われます。現在のところ以下の記述に行き着きましたが、エラーはでないものの金額が同じままです。(getListByProductIdsが反映されません。)何かお分かりになりますでしょうか。ご教授のほどお願い致します。 function getDetail($productId) { $objQuery =& SC_Query_Ex::getSingletonInstance(); $objProduct = new SC_Product_Ex(); $arrProduct = $objQuery->getRow('*', $this->alldtlSQL('product_id = ?'),'product_id = ?',array($productId, $productId)); $arrProduct = (array)$arrProduct; // 税込金額を設定する SC_Product_Ex::setIncTaxToProduct($arrProduct); ********************(getDetailの記述の変更はなく、*****内だけ追加) $arrProductId = array(); foreach ($arrProductData as $productdetail) {$arrProductId[] = $productdetail['product_id'];} $arrProducts = $objProduct->getListByProductIds($objQuery, $arrProductId); $arrProductdetail = array(); foreach ($arrProductData as $key => $arrRow) { $arrProductData[$key] = array_merge($arrRow, $arrProducts[$arrRow['product_id']]); } ******************** return $arrProduct; } |
yuh |
投稿日時: 2013/4/16 17:58
対応状況: −−−
|
神 登録日: 2013/1/9 居住地: 大阪 投稿: 1819 |
Re: LC_Page_Admin_Products_Product.phpのfunctionをLC_Page_FrontParts_Bloc_New_Products.phpで起動することは可能でしょうか。 ?の場合は$objQuery->selectではなく$objQuery->getColでproduct_idの配列を取って、そのデータをgetListByProductIdsに渡してデータを取るといいと思います。
テストはしていないので、動くかどうかわかりませんが。 |
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()) { ・・・・・・・・・・・・・・・・・・ |
(1) 2 » |
スレッド表示 | 古いものから | 前のトピック | 次のトピック | トップ |