Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WooCommerce: Payment after confirming order

Tags:

I am creating a Woocommerce shop. The client wants to use the payment plugin "Mollie" to accept iDeal payments (Dutch).

When people order items from the webshop, they should be able to order everything they want without paying. After that, the shop owner should receive an email and check the order.

The shop owner reviews the order by checking the stock of the ordered products. From this point on there should be there scenario's:

  1. Everything is in stock. The package is weighed. Shippingcosts are added. The customer will receive a payment link.

  2. Nothing is in stock. A message should be sent to the customer with an out-of-stock message.

  3. Only part of the order is in stock. The order should be changed in the Woocommerce orders-panel. The remaining order is weighed and packed. The customer will receive a payment link.

When the order is accepted, the customer should receive a payment link with the normal payment methods (including "Mollie" payments).

Is there a way to make this happen? Thanks in advance!

like image 347
polonium Avatar asked Nov 03 '16 15:11

polonium


People also ask

Why are my WooCommerce payments on hold?

I understand you are your orders are set to ON HOLD and your order notes displays “Payment pending (unilateral)”. This message usually relates to an issue with the set up of your PayPal account. Please reach out to PayPal support and have them verify that everything is in order.

What does pending payment mean in WooCommerce?

When taking payments via WooCommerce (e.g. via PayPal), your “Orders” page will show the following status labels: Pending payment: This means the order has been created on your website, but the customer's payment hasn't been received yet.

How do I record a payment in WooCommerce?

Manually capture an authorized chargeGo to WooCommerce > Orders and find the order associated with the charge. Click Choose an action… Click Capture charge. Click Update.

How do I change my order status automatically in WooCommerce?

Setup. To setup Order Status Control, go to WooCommerce > Settings > General and update the Orders to Auto-Complete setting to determine which paid orders should skip the Processing status and go directly to Completed status: None: No orders will be automatically completed.


1 Answers

I know this is a year after, but that could help someone else :-).
My customer would like a similar process, shop customers would not be able to pay online until the shop owner confirm order.

Solution:

  1. We used Cash on Delivery for offline payment, renamed to "Register order".
  2. We used Stripe for credit card payment for online payment.
  3. We showed Cash on Delivery for checkout page(checkout endpoint) and Stripe for order-pay page(my-accounts endpoint), more on endpoints in woocommerce docs.
  4. And voila.

We used this filter to switch payment gateways between the 2 endpoints.

function my_switch_gateways_by_context($available_gateways) {
  global $woocommerce;

  $endpoint = $woocommerce->query->get_current_endpoint();

  if ($endpoint == 'order-pay') {
    unset($available_gateways['cod']);
  } else {
    unset($available_gateways['stripe']);
  }

  return $available_gateways;
}
add_filter( 'woocommerce_available_payment_gateways', 'my_switch_gateways_by_context');

I hope this helps.

like image 156
JBoulhous Avatar answered Sep 25 '22 16:09

JBoulhous