Jump to content

Redirect from "/cart"

Go to solution Solved by paul2009,

Recommended Posts

Hello.

Client is not using this function so would like this url to redirect to home, however it's not working.

I have this in URL mappings:

https://www.opsishealth.com/cart -> https://www.opsishealth.com/ 301

 

Also have tried relative urls, but they aren't doing anything either.

Maybe this page can't be redirected? I don't see it listed within my list of pages.

I think I am missing something simple.

Thanks for any advice.

Link to comment
  • Replies 12
  • Created
  • Last Reply

Top Posters In This Topic

  • Solution
1 hour ago, Upperhouse said:

Client is not using [the cart] function so would like this url to redirect to home

Redirections will not work for the cart page because they only work when the redirected URL does not exist. The /cart page will always exist because it cannot be removed. The same is true for all reserved url slugs

Improve your online store with our extensions.
About: Squarespace Circle Leader since 2017. I value honesty, transparency, appreciation and great design ♥.
Work: Squarespace Developer and founder of SF Digital, building the features Squarespace didn't include™.
Content: Links in my posts may refer to SF Digital products or may be affiliate links.

Buy me a coffee

Link to comment

As @paul2009 mentions the cart page can't be removed. However with JavaScript it is possible to redirect the cart to another URL. You have to be on a plan that allows JavaScript to run on your site.

Add the following to Settings > Advanced > Code Injection > HEADER.

<script>

  ( ( ) => {
  
    /*
    
      cart page redirect to url
      
      Version     : 0.1.0
      
      SS Versions : 7.1, 7.0
      
      By          : Thomas Creedon < http://www.tomsWeb.consulting/ >
      
      */
      
    const url = '[enter url here between single quotes replacing square brackets]';
    
    // do not change anything below, there be the borg here
    
    if ( location.pathname != '/cart' ) return; // bail if not cart page
    
    location.href = url;
    
    } ) ( );
    
  </script>

Let us know how it goes.

Find my contributions useful? Please like, upvote, mark my answer as best , and see my profile. Thanks for your support!

Link to comment
  • 5 months later...

Hi guys.. I have a Commerce site for my artwork, but I do not want the shopping bag icon or checkout page AT ALL. I would prefer for customers to send me a form inquiring about artwork purchases instead of checking out via my page. How do I redirect my Shopping Bag icon (that I can't seem to fully remove no matter what code I use) to redirect to a contact/form page on Squarespace?

Edited by cabarnett13
Link to comment
6 minutes ago, cabarnett13 said:

I have a Commerce site for my artwork, but I do not want the shopping bag icon or checkout page AT ALL.

Please post the URL for a page on your site where we can see your issue.

A link to the backend of the your site won’t work for us, i.e. a url that contains /config/.

Please set up a site-wide password, if your site is not public and you've not already done so.

Post the password here.

Adding a site-wide password does not allow anyone to alter your site. It only allows those with the password to see your site.

Please read the site-wide password and how to share a link documentation to understand how they work.

We can then take a look at your issue.

You may find How to post a forum question post useful.

Find my contributions useful? Please like, upvote, mark my answer as best , and see my profile. Thanks for your support!

Link to comment
12 minutes ago, cabarnett13 said:

I have a Commerce site for my artwork, but I do not want the shopping bag icon or checkout page AT ALL. I would prefer for customers to send me a form inquiring about artwork purchases

Please see my post here:

Did this help? Please give feedback by clicking an icon below  ⬇️

Improve your online store with our extensions.
About: Squarespace Circle Leader since 2017. I value honesty, transparency, appreciation and great design ♥.
Work: Squarespace Developer and founder of SF Digital, building the features Squarespace didn't include™.
Content: Links in my posts may refer to SF Digital products or may be affiliate links.

Buy me a coffee

Link to comment

As much as the extension would be helpful.. I am broke. I need to sell some artwork before purchasing more from Squarespace... thanks. A code would be more helpful. I really need a code to redirect my 'add to cart' button to my contact page. I really need my 'add to cart' button' to go elsewhere but the checkout page 

 

Edited by cabarnett13
Link to comment

Please, if anyone can you help me... this is my business to help me with a financial crisis from the pandemic. Squarespace agents will not help me. This one redirect is preventing my website from being functional. please help me. I am frustrated and overwhelmed... all i want is a redirect code. please 

Link to comment
16 hours ago, cabarnett13 said:

As much as the extension would be helpful.. I am broke. A code would be more helpful.

Just as you charge for your paintings, I think it is fair to expect the developers to charge for the complicated code they write.  They need to earn a living from their work too, right?

If you need a free suggestion....why not create a contact form on a new page and then link to it from each product description? People can then contact you with ease.

 

 

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.