[英]how to change order status to complete and redirect to download page in Woocommerce
[英]Woocommerce Redirect to custom page depending on order status
是否可以根據訂單狀態將用戶重定向到自定義訂單感謝頁面?
Order Complete -> /standard-order-received-page/
Order Processing -> /custom-redirect-page
希望幫助:
add_action( 'woocommerce_thankyou', 'func_redirectcustom');
function func_redirectcustom( $order_id ){
$order = wc_get_order( $order_id );
$url = 'https://yoursite.com/custom-url';
if ( $order->has_status( 'processing' ) ) {
wp_redirect( $url );
exit;
}
// etc
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.