Opencart display Model Code in Search Page

非 Y 不嫁゛ 提交于 2019-12-11 16:12:29

问题


can anyone help?/Advise?

I need to display [echo] the model, product code in the search.tpl page in Opencart, can anybody help?

Has any one done this before?

Thanks,


回答1:


Follow below 4 steps.

Step 1

/catalog/controller/product/search.php

Find:

'name'        => $result['name'],

Add After:

'model'        => $result['model'],


Step 2

/catalog/view/theme/default/template/product/search.tpl

Find:

<div class="name"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></div>

Add After:

<b><?php echo $product['model']; ?></b>


Step 3

/catalog/view/theme/default/template/product/search.tpl

Find:

html += '<div class="name">' + $(element).find('.name').html() + '</div>';

Add After:

html += '<b>' + $(element).find('b').html() + '</b>';


Step 4

/catalog/view/theme/default/template/product/search.tpl

Find:

html += '  <div class="name">' + $(element).find('.name').html() + '</div>';

Add After:

html += '  <b>' + $(element).find('b').html() + '</b>';


& then check it in your search page.



来源:https://stackoverflow.com/questions/24039252/opencart-display-model-code-in-search-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!