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

Checkout button doesn't redirect to checkout page (pwacommerce pro) #57

Open
AsaraelNavarro opened this issue Sep 7, 2018 · 8 comments

Comments

@AsaraelNavarro
Copy link

Describe the bug
Checkout button doesn't redirect to checkout page

To Reproduce
Steps to reproduce the behavior:

  1. Select product
  2. Select variations
  3. Click in checkout button
  4. Redirect to homepage

Expected behavior
Redirect to ckeckout page

Screenshots
If applicable, add screenshots to help explain your problem.

Smartphone (please complete the following information):

  • Device: iPhone 6
  • OS: iOS11.4.1
  • Browser: Chrome / Safari
  • Version: / 69.0.3497.71

Wordpress: 4.9.8
woocommerce: 3.4.2 (Tested in 3.1 too)

Additional context
Jupiter Theme 6.1.5

@anghelalexandra
Copy link
Contributor

Hey @Asarael

Can you check if the CHECKOUT_URL variable is set up correctly in the index file (view source)? This checkout url should be set up from the WooCommerce settings and the app should submit the cart contents to the WordPress main theme.

@AsaraelNavarro
Copy link
Author

Tanks for the answer. The checkout url is set up correctly in WooCommerce.
This is the code in the file
$config = [
'API_CATEGORIES_URL' => $api_url . 'categories/',
'API_PRODUCTS_URL' => $api_url . 'products/',
'API_PRODUCT_URL' => $api_url . 'product/',
'API_REVIEWS_URL' => $api_url . 'reviews/',
'API_VARIATIONS_URL' => $api_url . 'product-variations/',
'API_CHECKOUT_URL' => $api_url . 'proceed-checkout/',
'CURRENCY' => get_woocommerce_currency_symbol(),
'SHOP_NAME' => $site_name,
'OFFLINE' => 'true',
];

@anghelalexandra
Copy link
Contributor

@Asarael

What is the value of API_CHECKOUT_URL if you view the source of the index file in the browser?
It should be something like "http://{your_wordpress_installation_url}/wp-json/pwacommercepro/proceed-checkout". Can you check if that url exists (if you open it in a browser)?

@AsaraelNavarro
Copy link
Author

AsaraelNavarro commented Sep 12, 2018

Hi, @anghelalexandra the url exist. There is the value.

"API_CHECKOUT_URL":"https://valdov.com.mx/wp-json/pwacommercepro/proceed-checkout/","CURRENCY":"$","SHOP_NAME":"Valdov","OFFLINE":"true"} }

@anghelalexandra
Copy link
Contributor

Hey @Asarael ,

It looks the route is not registered (404 not found status). From the output:

{"code":"rest_no_route","message":"No se encontr\u00f3 la ruta que coincida con la URL y el m\u00e9todo de la petici\u00f3n","data":{"status":404}}

Does the message change if you activate the plugin?

@AsaraelNavarro
Copy link
Author

Hey @anghelalexandra
The message doesn't change.

Checking with DevTools noticed that.
image

could be the problem?

@anghelalexandra
Copy link
Contributor

@Asarael

I'm not sure if this is the problem. Do other API routes work? Can you see products and categories in the app?

API routes are registered from the backend (WordPress plugin): https://github.com/appticles/wordpress-pwacommerce/blob/master/includes/class-pwacommerce-api.php. The path to the file is the same in the PRO version.

Can you check if the register_pwacommercepro_routes function is called? The routes will be registered only if you have entered a WooCommerce key and secret from the PWACommerce admin area, but it is weird if products and categories are working and checkout is not.

@AsaraelNavarro
Copy link
Author

@anghelalexandra
The function is called, i can see products and categories. I have changed the WooCommerce key but not work.

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

2 participants