質問 > フロント機能 > Smartyのスマートフォンの商品一覧ページの画像サイズを修正したい |
フロント機能
スレッド表示 | 新しいものから | 前のトピック | 次のトピック | 下へ |
投稿者 | スレッド |
---|---|
sayaka5341 |
投稿日時: 2019/11/6 14:00
対応状況: −−−
|
新米 登録日: 2019/11/6 居住地: 投稿: 1 |
Smartyのスマートフォンの商品一覧ページの画像サイズを修正したい ▼テンプレート
---------------------------------------- [EC-CUBE] 2.12.3 [PHP] PHP 5.2.4 [データベース] MySQL 5.0.45 ---------------------------------------- Smartyのスマートフォンの商品一覧ページの画像サイズを修正したいです。 /data/Smarty/templates/sphone/products/list.tpl こちらのファイルの本文内と下部のscript内を修正しましたが、最初に表示されている商品の画像のみ修正されて、「もっと見る」で表示される商品の画像が変更されません。 タグも修正前のままです。 変更する場所が間違っているのか、他にも変更しなければならないのか不明です。 どのように変更したらよいか教えていただければ幸いです。 script内は以下の★の場所を変更しました。 <script> var pageNo = 2; var url = "<!--{$smarty.const.P_DETAIL_URLPATH}-->"; var imagePath = "<!--{$smarty.const.IMAGE_SAVE_URLPATH|sfTrimURL}-->/"; var statusImagePath = "<!--{$TPL_URLPATH}-->"; function getProducts(limit) { $.mobile.showPageLoadingMsg(); var i = limit; //送信データを準備 var postData = {}; $('#form1').find(':input').each(function(){ postData[$(this).attr('name')] = $(this).val(); }); postData["mode"] = "json"; postData["pageno"] = pageNo; $.ajax({ type: "POST", data: postData, url: "<!--{$smarty.const.ROOT_URLPATH}-->products/list.php", cache: false, dataType: "json", error: function(XMLHttpRequest, textStatus, errorThrown){ alert(textStatus); $.mobile.hidePageLoadingMsg(); }, success: function(result){ var productStatus = result.productStatus; for (var product_id in result) { if (isNaN(product_id)) continue; var product = result[product_id]; var productHtml = ""; var maxCnt = $(".list_area").length - 1; var productEl = $(".list_area").get(maxCnt); productEl = $(productEl).clone(true).insertAfter(productEl); maxCnt++; //商品写真をセット $($(".list_area .listphoto img").get(maxCnt)).attr({ src: "<!--{$smarty.const.ROOT_URLPATH}-->resize_image.php?image=" + product.main_large_image + '&width=400&height=400',(★ここのimgパスです。) alt: product.name }); // 商品ステータスをセット var statusAreaEl = $($(".list_area div.statusArea").get(maxCnt)); // 商品ステータスの削除 statusAreaEl.empty(); if (productStatus[product.product_id] != null) { var statusEl = '<ul class="status_icon">'; var statusCnt = productStatus[product.product_id].length; for (var k = 0; k < statusCnt; k++) { var status = productStatus[product.product_id][k]; var statusImgEl = '<li>' + status.status_name + '</li>' + "\n"; statusEl += statusImgEl; } statusEl += "</ul>"; statusAreaEl.append(statusEl); } //商品名をセット $($(".list_area a.productName").get(maxCnt)).text(product.name); $($(".list_area a.productName").get(maxCnt)).attr("href", url + product.product_id); //販売価格をセット var price = $($(".list_area span.price").get(maxCnt)); //販売価格をクリア price.empty(); var priceVale = ""; //販売価格が範囲か判定 <!--{if $arrProduct.plg_memberprice_price03_min > 0 && (($smarty.session.customer.status == 3 && $smarty.const.PLG_MEMBER_PRICE_LOGIN_DISP == 1) || $smarty.const.PLG_MEMBER_PRICE_LOGIN_DISP == 0)}--> if (product.plg_memberprice_price03_min == product.plg_memberprice_price03_max) { priceVale = product.plg_memberprice_price03_min_inctax + '円'; } else { priceVale = product.plg_memberprice_price03_min_inctax + '~' + product.plg_memberprice_price03_max_inctax + '円'; } <!--{else}--> if (product.price02_min == product.price02_max) { priceVale = product.price02_min_tax_format + '円'; } else { priceVale = product.price02_min_tax_format + '~' + product.price02_max_tax_format + '円'; } <!--{/if}--> price.append(priceVale); //コメントをセット $($(".list_area .listcomment").get(maxCnt)).text(product.main_list_comment); } pageNo++; //すべての商品を表示したか判定 if (parseInt($("#productscount").text()) <= $(".list_area").length) { $("#btn_more_product").hide(); } $.mobile.hidePageLoadingMsg(); } }); } </script> |
スレッド表示 | 新しいものから | 前のトピック | 次のトピック | トップ |