X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Search results page? (https://forum.x-cart.com/showthread.php?t=7634)

bluecat 05-18-2004 05:17 AM

Search results page?
 
Hi. I simply want to add a link like "Didn't find what you were looking for? Click here" when a user gets zero results from a search. Can anyone tell me that template? Thank you.

Mod King 05-18-2004 05:42 AM

I believe its products.tpl or products_t.tpl

jeremye 05-18-2004 06:40 AM

Look in /skin1/customer/main/search_result.tpl. Replace the third to the last line:

Code:

{include file="dialog.tpl" title=$lng.lbl_search_results content="No matching products found" extra="width=100%"}

with:
Code:

{include file="dialog.tpl" title=$lng.lbl_search_results content="Didn't find what you were looking for? Click <a href=here.php>here</a>" extra="width=100%"}

Don't put any quotes inside the a href tag. That'll do it.

bluecat 05-18-2004 07:44 AM

Thank you very much, greatly appreciated. :)

bluecat 05-18-2004 08:02 AM

Worked like a charm, thank you.

bluecat 05-18-2004 09:30 AM

I've learned to take the new knowledge and run with it because not everyone will respond, but if I could ask one more tiny question, is it possible some how to insert html in there? :roll:

jeremye 05-18-2004 09:32 AM

Yeah, you sure can, but just be careful to not include any double quotes. Tell me what you want to include and we can work on it, or at least I'll give you an example.

bluecat 05-18-2004 12:35 PM

This is what I'd like to add (I've edited the urls, so they're not correct, but will fix them of course).

Code:

<body>

<p style="margin-top: 0; margin-bottom: 0">
<font color="#0000FF" style="font-size: 9pt">
[img]http://mysite.com/anim_pic.gif[/img]
</font></p>
<p style="margin-top: 0; margin-bottom: 0"></p>
<p style="margin-top: 0; margin-bottom: 0"></p>
<p style="margin-top: 0; margin-bottom: 0">
<font face="Verdana" style="font-size: 9pt"><font color="#0000FF">Didn't
find what you were looking for?
</font> We probably have it and
it's just not yet listed in our store.
<script>

//Popup Window Script
//By JavaScript Kit (http://javascriptkit.com)
//JavaScript tutorials and over 400+ free scripts

function openpopup(){
var popurl="http://mysite.com/price_quote.htm"
winpops=window.open(popurl,"","width=620,height=450,scrollbars")
}

</script>

<font color="#FF0000"><u>Click here</u></font>
to see if we have it and for a free price quote!</font></p>

</body>


Thank you very much (also, for what it's worth, I tried playing around with this to add it myself all with errors :( ).

jeremye 05-19-2004 04:56 AM

I'm not sure if this will work, but try this out. I escaped all " and '.

Code:

{include file="dialog.tpl" title=$lng.lbl_search_results content="<body>

<p style=\"margin-top: 0; margin-bottom: 0\">
<font color=\"#0000FF\" style=\"font-size: 9pt\">
<img src=\"http://mysite.com/anim_pic.gif\" align=\"left\" width=\"150\" height=\"94\">
</font></p>
<p style=\"margin-top: 0; margin-bottom: 0\"></p>
<p style=\"margin-top: 0; margin-bottom: 0\"></p>
<p style=\"margin-top: 0; margin-bottom: 0\">
<font face=\"Verdana\" style=\"font-size: 9pt\"><font color=\"#0000FF\">Didn\'t
find what you were looking for?
</font> We probably have it and
it\'s just not yet listed in our store.
<script>

//Popup Window Script
//By JavaScript Kit (http://javascriptkit.com)
//JavaScript tutorials and over 400+ free scripts

function openpopup(){
var popurl=\"http://mysite.com/price_quote.htm\"
winpops=window.open(popurl,\"\",\"width=620,height=450,scrollbars\")
}

</script>

<a href=\"javascript:openpopup()\"><font color=\"#FF0000\"><u>Click here</u></font></a>
to see if we have it and for a free price quote!</font></p>

</body>" extra="width=100%"}


bluecat 05-19-2004 05:12 AM

dang, nope. Here's what it says:

Code:

Fatal error: Smarty: [in customer/main/search_result.tpl line 10]: syntax error: invalid attribute name: '/home/xxx/public_html/store/Smarty-2.5.0/Smarty_Compiler.class.php on line 1832

Do you think the pop up window script could be messing it up?

(the xxx was edited of course)

Mod King 05-19-2004 05:20 AM

If you put javascript in smarty template files you have to escape them with
{literal} {/literal} tags, or else the javascript { } gets intereted as smarty tags. :D


Your code should work like this :)

Code:

<body>

<p style="margin-top: 0; margin-bottom: 0">
<font color="#0000FF" style="font-size: 9pt">
[img]http://mysite.com/anim_pic.gif[/img]
</font></p>
<p style="margin-top: 0; margin-bottom: 0"></p>
<p style="margin-top: 0; margin-bottom: 0"></p>
<p style="margin-top: 0; margin-bottom: 0">
<font face="Verdana" style="font-size: 9pt"><font color="#0000FF">Didn't
find what you were looking for?
</font> We probably have it and
it's just not yet listed in our store.

{literal}
<script>
//Popup Window Script
//By JavaScript Kit (http://javascriptkit.com)
//JavaScript tutorials and over 400+ free scripts

function openpopup(){
var popurl="http://mysite.com/price_quote.htm"
winpops=window.open(popurl,"","width=620,height=450,scrollbars")
}

</script>
{/literal}
<font color="#FF0000"><u>Click here</u></font>
to see if we have it and for a free price quote!</font></p>

</body>


bluecat 05-19-2004 05:25 AM

That worked perfect! Thank you very much!! :)

jeremye 05-19-2004 05:57 AM

Sorry bluecat, I didn't think to add the {literal} tags for the javascript. Glad it worked out for you.


All times are GMT -8. The time now is 05:40 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.