Jump to content

Need help with search bar on product page

Recommended Posts

  • Replies 7
  • Views 1k
  • Created
  • Last Reply
Posted
6 hours ago, Blumango said:

Site URL: https://dilana-info.squarespace.com/new-products

On my product page,  i would like to add search bar here (top of the page not the header).

Is there any way to do that.

Thank you

Screen Shot 2021-07-28 at 1.12.55 PM.png

You can add search bar in footer, then share url again, we will give the code to move its position

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Posted
On 7/29/2021 at 7:46 AM, Blumango said:

Hi tuanphan, I have added the search bar to the footer, here is a link 
https://dilana-info.squarespace.com/new-products

First, remove this line. It is outdated jquery version

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

add new line

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>

next, add this to Last line in Code Injection > Footer

<script>
  $(document).ready(function() { 
		$('footer#footer .search-block').insertAfter('body#collection-590a47155016e10ca7f0929e header#header');
	});
</script>
<style>
  header#header + .search-block {
    width: 30%;
    margin-left: auto;
}
  </style>

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

  • 5 weeks later...
Posted

Where is the below line supposed to be placed?

 

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
Posted
2 hours ago, KimCLee said:

Where is the below line supposed to be placed?

 

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>

replace this code

Quote
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

with 3.5.1 code

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Posted

thank you...but where is this supposed to be placed? For example, does it go in the code injection page...the footer...or somewhere else?

Posted
On 8/30/2021 at 11:06 PM, KimCLee said:

thank you...but where is this supposed to be placed? For example, does it go in the code injection page...the footer...or somewhere else?

add it above this code

<script>
  $(document).ready(function() { 
		$('footer#footer .search-block').insertAfter('body#collection-590a47155016e10ca7f0929e header#header');
	});
</script>
<style>
  header#header + .search-block {
    width: 30%;
    margin-left: auto;
}
  </style>

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.