$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>WooCommerce how to checkout a product without adding it to the cart|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

WooCommerce how to checkout a product without adding it to the cart

matteradmin11PV0评论

I am trying to implement this in my website:

Having a second button on a single product next to the"Add to cart" button, let that button be "Buy now".

When the add to cart button is clicked, the product will be added to the cart, when the Buy now button is clicked the client will be redirected to the checkout page where he will only checkout that single product, and that product will not be added to the cart.

For example, if the client was having products A and B in the cart, and clicks the Buy now o product C, he will only checkout for that product, and C will never be added to the cart.

I was thinking of a way to implement this, and I thought that having two different checkout pages might help,.. I don't know if it can, if you have a solution on how I can do this, I'd love to hear from you.

Thanks

I am trying to implement this in my website:

Having a second button on a single product next to the"Add to cart" button, let that button be "Buy now".

When the add to cart button is clicked, the product will be added to the cart, when the Buy now button is clicked the client will be redirected to the checkout page where he will only checkout that single product, and that product will not be added to the cart.

For example, if the client was having products A and B in the cart, and clicks the Buy now o product C, he will only checkout for that product, and C will never be added to the cart.

I was thinking of a way to implement this, and I thought that having two different checkout pages might help,.. I don't know if it can, if you have a solution on how I can do this, I'd love to hear from you.

Thanks

Share Improve this question edited Dec 18, 2018 at 3:48 fuxia 107k39 gold badges255 silver badges461 bronze badges asked Dec 18, 2018 at 0:18 Real MoiseReal Moise 14 bronze badges 18
  • You could use the YITH One Click Checkout: wordpress/plugins/yith-woocommerce-one-click-checkout – Nathaniel Flick Commented Dec 18, 2018 at 0:23
  • That one works only on the logged in users, is it possible to configure it so that non logged in users can access it too?? – Real Moise Commented Dec 18, 2018 at 0:26
  • You could if you wrote one that used LocalStorage instead of a user account, but then the user doesn't really benefit from that (has to enter her information anyway) – Nathaniel Flick Commented Dec 18, 2018 at 0:26
  • Just reauested by my client, and i failed to do this. Just want to make it work even on the non logged in users – Real Moise Commented Dec 18, 2018 at 0:29
  • Hi Nathan, do you have any other suggestions?? – Real Moise Commented Dec 18, 2018 at 0:33
 |  Show 13 more comments

1 Answer 1

Reset to default 2

You could code your own, and connect to a payment gateway's API, but plenty have tread this road before you so stand on their shoulders. Two possibilities:

Stripe One Click Checkout plugin by WooCommerce

PayPal One Click Checkout plugin by StoreApps

Post a comment

comment list (0)

  1. No comments so far