Jump to content

Need help with search bar on product page

Recommended Posts

  • Replies 7
  • Created
  • Last Reply

Top Posters In This Topic

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

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment
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>

 

Edited by tuanphan

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

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment
  • 5 weeks later...
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

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment
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>

 

Edited by tuanphan

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

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • 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.