Hello all, I'm trying to do the same thing but it's not quite working for me. Any advice? I used the above code and plugged in my own urls, but it doesn't work properly.
<!-- Change Shopping Cart Service Product Links -->
<script>
$( ( ) => {
/* map cart item title urls */
const urlMappings = {
'/mini-expert-review-services/purchase' : '/mini-expert-review',
'/mini-expert-review-services/spreadsheet' : '/mini-expert-review-spreadsheet'
/* last or only item doesn't get a comma */
}
const urlError = '/mini-expert-review-services/purchase'; /* page to go to in case a url mapping isn't found */
// do not change anything below
if ( window.location.pathname != '/cart' ) return;
$( '.CartTableRow-itemTitle-1MDgZ a' ).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>
<!-- Change Shopping Cart Service Product Links -->