Jump to content

PrismaVisual

Member
  • Posts

    14
  • Joined

  • Last visited

Reputation Activity

  1. Like
    PrismaVisual got a reaction from EarvinChong in I need some Javascript that will redirect product pages to blog pages   
    This worked perfectly!!! It works on all instance: store pages, the summaries, the maps...everywhere! I am beyond grateful. Thank you so much! Can I buy you a coffee?
  2. Like
    PrismaVisual got a reaction from EarvinChong in I need some Javascript that will redirect product pages to blog pages   
    @creedon Thanks so much for the reply!  I tried adding that where specified but the entire page content disappeared and showed as "/undefined" up in the address bar.  I'm way over my head here lol...it is my first time messing with javascript. Am I supposed to modify that somehow? 
    I am adding properties/neighborhoods as "products" in "store pages" so that I can use them in conjunction with advanced map blocks plugin and universal filter from squarewesbites. These both work beautifully but then I realized that every instance of a product automatically links to the built in pages. 🤦🏻‍♀️  And of course I had already created all custom 40 property pages and 28 neighborhood pages. 🤡😩
    I just need a way to change those links!! I figured javascript would be the quickest solution. I thought either having a script that would omit the "/rentals/p" part from the urls, placed in the sitewide header injection would be best. Or even a script to redirect the urls would be amazing. I got close but could only make it work for 1/40 of them. 🤣
  3. Like
    PrismaVisual reacted to creedon in I need some Javascript that will redirect product pages to blog pages   
    @PrismaVisual
    I've updated my code post. This is pretty simple code as far as Javascript goes. The trick is making it perfect! 🙂
    I'm wondering if the issue can be tackled earlier than after the user clicks on a link that takes them to a store page.
    Can you point us to a URL for a page that takes the user to the store page when they click on a link?
    Let us know how it goes.
  4. Love
    PrismaVisual reacted to creedon in I need some Javascript that will redirect product pages to blog pages   
    @PrismaVisual
    For a wholesale every product item page gets redirected add the following to Store Settings > Advanced > Page Header Code Injection for the store page.
    <script> ( ( ) => { /* begin redirect product pages SS Version : 7.1 */ // no user serviceable parts below if ( window.frameElement !== null ) return; let pathPart = location.pathname.split ( '/' ) [ 3 ]; if ( pathPart === undefined ) return; location.href = '/' + pathPart; } ) ( ); </script> This effect only works when you view the site as an outside user.
    Have you considered using the product items pages and just hiding the add to cart button with some CSS? Lots of folks do that.
    Let us know how it goes.
×
×
  • 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.