elgentos / LargeConfigProducts

Large Configurable Products workaround for Magento 2
91 stars 28 forks source link

fix for issue #20 (frontend fetch does not take store view into account) #21

Closed lfglopes closed 5 years ago

peterjaap commented 5 years ago

Where does BASE_URL come from? That is not a globally defined constant?

peterjaap commented 5 years ago

:+1:

lfglopes commented 5 years ago

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.

peterjaap commented 5 years ago

@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?

peterjaap commented 5 years ago

Ah wait, you still have to manually set the baseUrl on the url object.

lfglopes commented 5 years ago

Exactly

peterjaap commented 5 years ago

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.