Closed lfglopes closed 5 years ago
:+1:
Sorry to say, but url.build
turned out to not work as I expected either... I'll try to find another solution.
Probably will have to pass the base url on the phtml as it seems to be no Javascript-native way of doing this.
@lfglopes hmm I tried url.build
in a sandbox and it gave me the results I expected. What didn't exactly work as you thought it would?
Ah wait, you still have to manually set the baseUrl on the url object.
Exactly
Including the base url (fetched through $block->getBaseUrl()
) in the phtml would be the only way to go as far as I can see. That's also how Magento core does it in for example vendor/magento/module-checkout/view/frontend/templates/cart/shipping.phtml
.
Where does
BASE_URL
come from? That is not a globally defined constant?