如何更改Magento小部件标题

时间:2017-04-29 12:53:48

标签: css magento magento-1.9

我已插入小部件以在我的主页上显示新产品,但它显示完美,但我想删除小部件标题"新产品"。

这个小魔鬼需要被删除

enter image description here

我无法在root中正确找到窗口小部件文件以删除标题。我在app / design / frontend / rwd / default / template / catalog / product / widget / new / column中找到了该文件但是它无法正常工作。我试图将描述注释或编辑为其他内容,但它没有改变。

找到正确的文件在哪里?帮助..我正在使用Magento 1.9

2 个答案:

答案 0 :(得分:0)

首先确保使用正确的软件包,例如RWD或默认软件包。然后你想在配置菜单中启用模板提示(你可能想谷歌如何做到这一点)。转到包含该窗口小部件的页面,并仔细查看正在使用的.phtml文件的位置。此时,您应该根据magento最佳实践覆盖该文件。永远不要编辑默认模板,始终创建自己的主题并将修改后的版本放在那里。所以无论如何,一旦你找到并覆盖该文件,除非你不熟悉php,否则应该删除相当多的东西。

答案 1 :(得分:0)

尝试更改单词组合的翻译&#34;新产品&#34;在此处的语言环境中:<?php include_once("dbconnect.php"); if(isset($_GET["search"])) { $condition = ''; $search_query = explode(" ", $_GET["search"]); foreach($search_query as $text) { $condition .= "search LIKE '%".mysqli_real_escape_string($dbconnect, $text)."%' OR "; } $sql = "SELECT COUNT(stockID) FROM stock WHERE search LIKE ". $condition ."GROUP BY stockID"; $query = mysqli_query($dbconnect, $sql); $row = mysqli_fetch_row($query); $rows = $row[0]; $page_rows = 12; $last = ceil($rows/$page_rows); if($last < 1){ $last = 1; } $pagenum = 1; if(isset($_GET['pn'])){ $pagenum = preg_replace('#[^0-9]#', '', $_GET['pn']); } if ($pagenum < 1) { $pagenum = 1; } else if ($pagenum > $last) { $pagenum = $last; } $limit = 'LIMIT ' .($pagenum - 1) * $page_rows .',' .$page_rows; $condition = ''; $search_query = explode(" ", $_GET["search"]); foreach($search_query as $text) { $condition .= "search LIKE '%".mysqli_real_escape_string($dbconnect, $text)."%' OR "; } $condition = substr($condition, 0, -4); $sql= "SELECT * FROM stock WHERE " . $condition." ORDER BY stockID ASC $limit"; $query = mysqli_query($dbconnect, $sql); $textline1 = "(<b>$rows</b>)"; $textline2 = "Page <b>$pagenum</b> of <b>$last</b>"; $paginationCtrls = ''; $search_query = $_GET['search']; if($last != 1){ if ($pagenum > 1) { $previous = $pagenum - 1; $paginationCtrls .= '<a href="'.$_SERVER['PHP_SELF'].'? pn='.$previous.'&search='.$search_query.'">Previous</a> &nbsp; &nbsp; '; for($i = $pagenum-4; $i < $pagenum; $i++){ if($i > 0){ $paginationCtrls .= '<a href="'.$_SERVER['PHP_SELF'].'? pn='.$i.'">'.$i.'</a> &nbsp; '; } } } $paginationCtrls .= ''.$pagenum.' &nbsp; '; for($i = $pagenum+1; $i <= $last; $i++){ $paginationCtrls .= '<a href="'.$_SERVER['PHP_SELF'].'? pn='.$i.'&search='.$search_query.'">'.$i.'</a> &nbsp; '; if($i >= $pagenum+4){ break; } } if ($pagenum != $last) { $next = $pagenum + 1; $paginationCtrls .= ' &nbsp; &nbsp; <a href="'.$_SERVER['PHP_SELF'].'? pn='.$next.'&search='.$search_query.'">Next</a> '; } } $list = ''; $lists = ''; while($row = mysqli_fetch_array($query)){ $id = $row["stockID"]; $name = $row["stockName"]; $image = $row["thumbnail"]; $description = $row["description"]; $topline = $row['topline']; $lists .= '<div class="col-md-3" style="margin-bottom:10px;"> <div class="panel panel-info"><a href="index.php? page=item&stockID='.$id.'&sub_category="> <div class="panel-body"> <img class="img-responsive" style="height:100px;" src="resources/stocks_images/'.$image.'" /> </div> <div class="panel-footer" style="height:100px;">'.$name.' </div></a> </div> </div>'; } } mysqli_close($dbconnect); ?>

如果您想为每个小部件指定一个唯一的名称。请访问以下网址,希望它对您有所帮助。

http://code.mytodayaz.com/magento/how-can-i-modify-or-clone-the-8220-new-products-8221-widget-so-title-is-8220-featured-products-63-8221--42915.html