View Single Post
  #121  
Old 04-04-2011, 04:51 AM
 
donavichi donavichi is offline
 

X-Adept
  
Join Date: Apr 2004
Location: United Kingdom
Posts: 697
 

Default Re: common if/then modifications I make to x-cart...

X-Cart 4.4.x currently, but probably all previous versions are compatible also - I can't remember. Let me know if any problems...

Better Search Box:
If you want a custom search box on your X-Cart store that has an initial value of 'Search for products..." displayed, that when clicked turns blank so the user can type their search term without having to remove the text by hand & then when the search results are displayed, retains the term they just entered until they click back inside the box again, do this:

in customer/search.tpl find the following code (around line 20):

Code:
<input type="text" name="posted_data[substring]" class="text" value="{$search_prefilled.substring|escape}" />

and replace it with this:
Code:
<input type="text" name="posted_data[substring]" class="text" {if $main ne "search"}value="Search for products..." onfocus="if(this.value==this.defaultValue) this.value='';"{else}value="{$search_prefilled.substring|escape}" onfocus="if(this.value==this.defaultValue) this.value='';"{/if} />

Just done this for the nth time and thought it might help, in case anyone missed it.
__________________
Best regards,

Donavichi.
- - -

Website Copywriting || Web Design || FAQs || Home & Garden Blog
Reply With Quote