motou / magento2-store-locator-stockists-extension

Stockists store locator extension for magento2 using google maps
MIT License
67 stars 44 forks source link

Stockists URL dependency removed from the ajax call. #46

Closed shahabhameed closed 2 years ago

shahabhameed commented 5 years ago

From the admin configuration, if you change the Stockists URL from default "stockists" to let's say "stores", the ajax call to fetch all stores breaks because it changes the route's name. The actual controller should be /stockists/ajax/stores The broken link is //ajax/stores.

This fix hardcodes the URL back to "stockists" because that is the frontend route name.

ClaudiuCreanga commented 5 years ago

Hi,

Thanks for this PR. But tbh I don't understand it. Shouldn't it change to stores? I'll check it later on.

NikkyLauwers commented 5 years ago

I have changend it from:

var url = window.location.protocol+"//"+window.location.hostname+window.location.pathname; url = (url.substr(-1) != '/' ? url+'/':url)+'ajax/stores';

to:

var url = window.location.protocol+"//"+window.location.hostname; url = (url.substr(-1) != '/' ? url+'/':url)+'stockists/ajax/stores';

johnekj commented 5 years ago

I fixed this exactly the same way.