Post by iplocker » Wed Oct 14, 2020 5:00 am

Hello.
Is it possible please after I made a search to have an empty the search field and not keeps the text I have search about in the search results ?? http://prntscr.com/uyr2yr
Using Opencart 3.0.3.6
Thanks
Last edited by iplocker on Wed Oct 14, 2020 5:35 am, edited 1 time in total.

Active Member

Posts

Joined
Sun May 26, 2013 6:39 pm


Post by sw!tch » Wed Oct 14, 2020 5:12 am

Just remove the default value {{search}} from your twig.

https://github.com/opencart/opencart/bl ... ch.twig#L2
Last edited by sw!tch on Wed Oct 14, 2020 5:19 am, edited 1 time in total.

Backup and learn how to recover before you make any changes!


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm

Post by iplocker » Wed Oct 14, 2020 5:18 am

Thanks for the reply.
But the search.php is already with this code !
Thanks

Active Member

Posts

Joined
Sun May 26, 2013 6:39 pm


Post by sw!tch » Wed Oct 14, 2020 5:20 am

See my revised post. That way you don't have to touch the controller.

Backup and learn how to recover before you make any changes!


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm

Post by iplocker » Wed Oct 14, 2020 5:29 am

Change search.twig to

Code: Select all

<div id="search" class="input-group">
  <input type="text" name="search" value="" placeholder="{{ text_search }}" class="form-control input-lg" />
  <span class="input-group-btn">
    <button type="button" class="btn btn-default btn-lg"><i class="fa fa-search"></i></button>
  </span>
</div>
But nothing happend (I have clear cache too )

Thanks

Active Member

Posts

Joined
Sun May 26, 2013 6:39 pm


Post by sw!tch » Wed Oct 14, 2020 5:30 am

Clear theme cache

Admin ->Dashboard -> Cog Icon on top right ...

Backup and learn how to recover before you make any changes!


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm

Post by iplocker » Wed Oct 14, 2020 5:34 am

Ohh it was Journal3 theme !
So I made your magic to /catalog/view/theme/journal3/template/common/search.twig and guess what ?
Its working!!
You re awesome and so FAST ! :)
Thank you !!!!!!!

Active Member

Posts

Joined
Sun May 26, 2013 6:39 pm


Post by buypowerbg » Tue Jan 12, 2021 3:54 pm

what about the version 2.3.0.2 ?
how to solve this problem?

Newbie

Posts

Joined
Fri Dec 04, 2020 12:00 am

Post by fegdeed » Thu Jan 14, 2021 6:30 am

buypowerbg wrote:
Tue Jan 12, 2021 3:54 pm
what about the version 2.3.0.2 ?
how to solve this problem?
Assuming you are using default theme....Find catalog/view/theme/default/template/common/search.tpl
And change to

Code: Select all

<div id="search" class="input-group">
  <input type="text" name="search" value="" placeholder="<?php echo $text_search;?>" class="form-control input-lg" />
  <span class="input-group-btn">
    <button type="button" class="btn btn-default btn-lg"><i class="fa fa-search"></i></button>
  </span>
</div>

Image
Get a secure, fast, and reliable web hosting service from https://turnuphosting.com/opencart-hosting/.


Active Member

Posts

Joined
Fri Sep 21, 2018 12:01 am
Who is online

Users browsing this forum: No registered users and 31 guests