create redirect link/post to woocommerce payment page with pending status - Hack The Tech - Latest News related to Computer and Technology

Hack The Tech - Latest News related to Computer and Technology

Get Daily Latest News related to Computer and Technology and hack the world.

Wednesday, June 9, 2021

create redirect link/post to woocommerce payment page with pending status

Halo everyone, hope you always health. how i can make every user who visit a link/post will redirect to woocommerce customer payment page for newest order with pending status.

here the code to call customer payment page url

$order = wc_get_order($order_id);
$pay_now_url = esc_url( $order->get_checkout_payment_url() );
echo $pay_now_url; //http://example.com/checkout/order-pay/{order_id}?pay_for_order=true&key={order_key}

i want www.myweb,com/lucky-buy redirect to every NEWEST wc order payment page with order status pending payment. so every time i create order on wc backend with status pending payment, user can pay that order by visiting www.myweb,com/lucky-buy.



source https://stackoverflow.com/questions/67892558/create-redirect-link-post-to-woocommerce-payment-page-with-pending-status

No comments:

Post a Comment