Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why doesn't the shipping method appear on the checkout page when running using npm run dev? #20

Open
ekakrisna opened this issue Mar 20, 2024 · 10 comments

Comments

@ekakrisna
Copy link

Hi, thanks for sharing this repository. I'm encountering an issue when running it on localhost with npm run dev as the shipping method does not appear on the checkout page. I've followed the provided instructions, but could you assist me in running it on my localhost?
image

@carmelc
Copy link
Collaborator

carmelc commented Mar 20, 2024

Hi, in order to see the custom shipping rate the commerce server has to invoke the SPI, and it cannot call a local machine (localhost:3000) address, so the code has to be deployed on a server and the shipping rate has to be switched on for the geo in order to see it in the cart page and checkout,

@ekakrisna ekakrisna reopened this Apr 26, 2024
@ekakrisna
Copy link
Author

Hi, do you know how to display shipping rates locally?

@carmelc
Copy link
Collaborator

carmelc commented Apr 30, 2024

You mean during the checkout process? For this, you would need a static IP (public) that points to your local machine and configure the SPI to call it, and you should configure your firewall to accept external HTTP requests on this port,
Some services provides public address to local machine and some ISPs also provide the ability to have a constant IP (your IP might change from time to time otherwise),

@ekakrisna
Copy link
Author

ekakrisna commented May 16, 2024

Yes, I have already deployed to production, but it still doesn't work. Could you perhaps provide instructions on how to set this up?

Screenshot 2024-05-16 092935
image

@carmelc
Copy link
Collaborator

carmelc commented May 30, 2024

Hi,

Could you please confirm if all the provided URLs are valid and accessible? Specifically, have you deployed them on a provider that supports Next.js 14, and are you able to invoke them successfully?

When you mention that they do not work, are you referring to the shipping rate SPI, the dashboard page, or both? If you are unable to see the new shipping rate, have you configured it as one of the shipping rates in your store? You can refer to this guide for assistance: Wix Stores: A Guide to Setting Up Shipping, Delivery, and Pickup.

Please note that the application you created does not add a new shipping rate to all new orders but rather provides a shipping rate option that you can associate with a region.

Thank you.

@ekakrisna
Copy link
Author

For now, the issue here is that the SPI shipping rate does not work when I create a new app. I have configured it according to the reference you provided, but it still doesn't work.
image
image

@carmelc
Copy link
Collaborator

carmelc commented Jul 30, 2024

Make sure that the currency you defined in your site is the same as the one returned by the SPI, you can also verify that the SPI is indeed invoked by adding a console message and checking the logs per the platform of your choice,
Note that shipping rates are cached so make some changes in your cart to force re-calculation of the shipping rate

@txemaquin
Copy link

@ekakrisna After days of trying to make this template work, I found out that deploymentUri should be {BASEURL}/api/shipping-rates/ in the service JSON file, hope this can help you.

@bizmate
Copy link

bizmate commented Dec 25, 2024

for a static url on your machines use Ngrok

@txemaquin
Copy link

txemaquin commented Dec 26, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants