Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search


  • Posts

  • Joined

  • Last visited

  1. i figured it out myself!!! i dont know javascript so im patting myself on the back right now haha. <script> window.customCartDrawer = { onUpdateFunction: function(drawer, data) { $(document).ready(function(){ $('a').each(function(){ this.href = this.href.replace('/saved/p/', '/labels/'); }); }); } } </script> this is what i used and it worked 🙂
  2. @creedon so sorry to be a bother again, you have been so much help, so i was thinking because i need to do this to multiple links it would be fastest if i could replace the middle part of a link because the end parts of will be the same, that way i dont have to manually do this for every link. (i dont want anyone ever going to the product pages) for example: https://idmdiscovery.com/saved/p/analogical-force ---> https://idmdiscovery.com/labels/analogical-force would there be a way to replace saved/p with labels (for every single instance a link with saved/p appears on my site?) i hope this makes sense, thanks again you are a life saver.
  3. Site URL: https://idmdiscovery.com password idm. Hey! so i need some script that can redirect links to another link, for instance i want to change all the links in my cart so that they link to blog posts. I was using this code: <script> $( ( ) => { /* map cart item title urls */ const urlMappings = { '/saved/p/analogical-force' : '/labels/analogical-force' /* last or only item doesn't get a comma */ } const urlError = '/x'; /* page to go to in case a url mapping isn't found */ // do not change anything below, there be the borg here if ( location.pathname != '/cart' ) return; $( '.CartTableRow-itemTitle-1MDgZ' ).each ( function ( ) { let $this = $( this ); let href = $this.attr ( 'href' ); if ( href in urlMappings ) { href = urlMappings [ href ]; } else { href = urlError; } $this.attr ( 'href', href ); } ); } ); </script> and it worked until i installed the customcartdrawer plugin from squarewebsites.org, now the link redirect doesnt work with the cart drawer, i think i need to change the location pathname in the above script so its sitewide but i cant figure that out, i dont want anyone seeing the product pages, they are supposed to just hold data for the cart. If i can change the links sitewide instead of just the cart that might make it work again, can anyone help me out please? thanks so much.
  4. Im using the add to cart button as a way for people to save my blog posts, here is a blog post where i have set the button up https://www.idmdiscovery.com/labels/analogical-force password: idm i changed the add to cart text to save "favourite". when you click on the button it then says "added" but then it goes back to the original text with no indication to the user that its been clicked, i would like for it to stay saying "added" once someone clicks on it (adds to cart) or turn a different colour once its been clicked on, how would i go about doing this? thanks so much.
  5. I'm having issues too, I thought it was just me, but the search is basically useless. i have hundreds of blogs and pages so i need a working search.
  • Create New...