Closed aloross closed 5 years ago
Hi,
The quote object is not passed to the carrier instance when shipping methods are requested. So we need to get it another way: we get quote from session data. https://github.com/owebia/magento2-module-advanced-setting-core/blob/master/Model/Wrapper/Quote.php
With a curl call, you doesn't specify the context so how can we get the quote without having a session id? It is not possible.
Best Regards,
Hi,
I totally get that, i just thought that you used some info in the request
object to get back the quote (like using the quote items that are available here).
We used the request global which have the necessary information to match our use case and it works fine.
If I may, could you indicate in the documentation that some of the globals are not accessible in a headless context ?
Feel free to close this issue and have a nice day.
Regards.
i just thought that you used some info in the request object to get back the quote (like using the quote items that are available here).
I never thought to get the id of the quote that way, thanks for the idea, I'll see if it's feasible that way.
Regards, A.L.
Hi, is it still planned? Has there been any advancement on this?
Hi @adrien-louis-r and @real34 , This is fixed in 2.2.0 version of the module. Best Regards, A.L.
Hi @owebia,
Thanks for that!
Have a nice day, Adrien.
Hello, we are using the Owebia Shipping extension in a Headless context and encountered an issue when fetching the available shipping methods using the rest API.
When we use an user token, if an Owebia method use a condition related to the quote information (like
base_grand_total
), it doesn't works properly.The Owebia configuration is the following :
Using a proper PHP session ID return the correct carrier method, like in the Magento original cart. You can see below two curl requests which demonstrate the difference between the calls :
In the first case, everything works properly and i get the free method when my cart has a total superior to 150€. In the second case, i only get the first method.
I dove a little into the code and it seems that the quote is not initialized with the correct data in the token case. In the capture bellow, we can see that the evaluation of quote->base_grand_total return null.
Have you any idea what can be causing this issue ? Regards.