Redirect After Registration on Specific Link

Try this ode, dont forgot to change ex: http://test.com/custom_page custom_page => ( Change with your current registration page slug ) change this link ‘http://customlink.com/asdasda/‘ => (Change with where you want to redirect ) $registration_redirect=”http://customlink.com/asdasda/“ add_filter( ‘registration_redirect’, ‘my_redirect_home’ ); function my_redirect_home( $registration_redirect ) { global $post; $post_slug=$post->post_name; if( ‘custom_page’ === $post_slug ){ $registration_redirect=”http://customlink.com/asdasda/”; } return $registration_redirect; … Read more

How to make a custom redirect in WooCommerce?

add_action(‘template_redirect’, ‘woo_custom_redirect’); function woo_custom_redirect($redirect) { // HERE set your product category (can be term IDs, slugs or names) $category = ‘subscription’; $found = false; // CHECK CART ITEMS: search for items from our product category foreach(WC() – > cart – > get_cart() as $cart_item) { if (has_term($category, ‘product_cat’, $cart_item[‘product_id’])) { $found = true; break; } … Read more

Get user active posts randomly

But i can’t pass an array to it.I have a solution for getting the post randomly if am able to remove array elements form $user_ids by checking with product ids. Yes, the wc_customer_bought_product() function only accepts a single user/product ID. But you can loop through the $user_ids array, and for each user (ID), loop through … Read more

Add button linked to single product page on order detail page

The woocommerce_order_details_after_order_table hook receives the WC_Order object as the $order argument. This means you can get the items from the order with $order->get_items(). That will return an Array of WC_Order_Items. From this you can get the associated product of the first item, which you can use to get its permalink, to which you can append … Read more