yireo/Yireo_GoogleTagManager2

Problem with allowed pages for view_cart event

Closed this issue · 1 comments

I found a problem on the multi-language stores with pathname verification in view/frontend/web/js/push.js :
false === metaData.allowed_pages.includes(window.location.pathname)

With language prefix pathname is equal to "/languageCode/checkout/cart/" and not just "/checkout/cart/".
I fixed it by replacing with :
false === metaData.allowed_pages.some(page => window.location.pathname.includes(page))

I don't have much time to add it right now, that's why I'm leaving it here for you. Otherwise I could add it in a few weeks.

Indeed your solution is much more sensible when the page is a bit different. It is now ready for inclusion in the next release: 0002264 Thanks!