Upperhouse Posted July 26, 2022 Share Posted July 26, 2022 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
Solution paul2009 Posted July 26, 2022 Solution Share Posted July 26, 2022 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. Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥. Work: Founder of SF.DIGITAL. We provide high quality original extensions to supercharge your Squarespace website. Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links. Forum advice is completely free. You can thank me by selecting a feedback emoji. Buying a coffee is generous but optional. Would you like your customers to be able to mark their favourite products in your Squarespace store? Link to comment
Upperhouse Posted July 26, 2022 Author Share Posted July 26, 2022 That is what I needed. Thank you for your help! Link to comment
creedon Posted July 27, 2022 Share Posted July 27, 2022 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 the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects. Link to comment
cabarnett13 Posted January 22, 2023 Share Posted January 22, 2023 (edited) 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 January 22, 2023 by cabarnett13 Link to comment
creedon Posted January 22, 2023 Share Posted January 22, 2023 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 the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects. Link to comment
paul2009 Posted January 22, 2023 Share Posted January 22, 2023 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 ⬇️ Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥. Work: Founder of SF.DIGITAL. We provide high quality original extensions to supercharge your Squarespace website. Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links. Forum advice is completely free. You can thank me by selecting a feedback emoji. Buying a coffee is generous but optional. Would you like your customers to be able to mark their favourite products in your Squarespace store? Link to comment
cabarnett13 Posted January 24, 2023 Share Posted January 24, 2023 (edited) 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 January 24, 2023 by cabarnett13 Link to comment
cabarnett13 Posted January 24, 2023 Share Posted January 24, 2023 https://www.christinaashley.net/paintings Link to comment
cabarnett13 Posted January 24, 2023 Share Posted January 24, 2023 Hi Creedon - I've sent a DM regarding my issues. Hoping that may be quicker and easier for me. Thank you! Link to comment
cabarnett13 Posted January 24, 2023 Share Posted January 24, 2023 (edited) Hi Creedon - please can you help me? Edited January 24, 2023 by cabarnett13 Link to comment
cabarnett13 Posted January 24, 2023 Share Posted January 24, 2023 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
JamesDesign Posted January 24, 2023 Share Posted January 24, 2023 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
jf-dp Posted October 26, 2023 Share Posted October 26, 2023 On 7/26/2022 at 8:05 PM, creedon said: 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. HI @creedon Thank you so much for posting this javascript code injection solution. I was able to use this to redirect from the 'cart' page/button, but i can't get this approach to work to redirect from the 'checkout'/purchase button on the product page . This is more important as for me, when you are on the product/service page and you click the button to purchase (which ordinarily takes you to the SSL checkout), because this is the main call to action on the page and most people wont actually be using the cart button. i did actually modify the code below where you had your if statement because i noticed that the url on the checkout pages always create a unique URL that always begins with 'checkout' but then allows for a specific instance of purchasing the product, so i figured the include() function would help here. i know that the syntax works because i tested this format with with '/cart' instead of '/checkout' and it was functional, but for some reason this doesnt actually work when it comes to redirecting the checkout pages. any ideas here why this code works with the cart page but not the checkout pages? snippet: if ( location.pathname.includes('/checkout') ) location.href = url; // bail if not cart page return; Link to comment
creedon Posted October 26, 2023 Share Posted October 26, 2023 17 minutes ago, jf-dp said: any ideas here why this code works with the cart page but not the checkout pages? Custom code is not loaded for the /checkout page. It is a SS security feature. Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment