Hashtag trims URL

Hello,

In my webpage I make use of # in the URL, for example: www.myshop.com/catalog.htm#/SOMETHING

When Snipcart is installed, if URL is called with added '#/SOMETHING ’ it seems Snipcart REMOVES the ‘/SOMETHING’.

This behavior of removing the URL part after the # brakes my website functionality.

Is there a way to fix this or a workaround?

Thanks

On further inspection I see this is caused by a function from snipcart.js
The function is located in the vue-class-component v7.2.5 and adds a ‘popstate’ event listener.
I assume this is used because snipcart uses #/cart and #/checkout in the URL for its functionality.

This however I believe is a problem for all website that use #/ in the URL for their own functionality and so make it incompatible with snipcart.

I would appreciate if someone kwows is there is some workaround on this?

Hi @genti,

Sorry for the wait on this one.

Unfortunately, if your website uses the same URL scheme as Snipcart there will be collisions.

This is something we’d like to address in the future (through the usage of in-memory routing), however we can’t commit to any ETAs at this stage.

1 Like