Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // zobrazení děkovné stránky z detailu objednávky
- add_filter( 'woocommerce_order_actions', 'vandaal_show_thank_you_page_order_admin_actions', 9999, 2 );
- function vandaal_show_thank_you_page_order_admin_actions( $actions, $order ) {
- if ( $order->has_status( wc_get_is_paid_statuses() ) ) {
- $actions['view_thankyou'] = 'Zobrazit děkovnou stránku';
- }
- return $actions;
- }
- add_action( 'woocommerce_order_action_view_thankyou', 'vandaal_redirect_thank_you_page_order_admin_actions' );
- function vandaal_redirect_thank_you_page_order_admin_actions( $order ) {
- $url = add_query_arg( 'adm', $order->get_customer_id(), $order->get_checkout_order_received_url() );
- add_filter( 'redirect_post_location', function() use ( $url ) {
- return $url;
- });
- }
- add_filter( 'determine_current_user', 'vandaal_admin_becomes_user_if_viewing_thank_you_page' );
- function vandaal_admin_becomes_user_if_viewing_thank_you_page( $user_id ) {
- if ( ! empty( $_GET['adm'] ) ) {
- $user_id = wc_clean( wp_unslash( $_GET['adm'] ) );
- }
- return $user_id;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement