Banner Logo

Be a part of the family: Connect, Receive Support,
Contribute, and Reap Abundant Rewards!

Redirect Vendor Author Page

MultivendorX Pro

Resolved
Viewing 2 reply threads
  • Author
    Posts
    • #193557
      DragNfLy
      Participant

      Good day,

      Can you assist with code to redirect the Vendor Author Page to the Vendor Shop page.

      I was trying something like the below but do not know the correct function:

      [code]
      function redirect_vendor_author_url() {
      if ( is_author() && class_exists( ‘WCMp’ ) ) {
      $author_id = get_query_var( ‘author’ );
      $vendor_id = get_user_meta( $author_id, ‘_vendor_id’, true );

      if ( $vendor_id ) {
      $vendor_shop_url = get_wcmp_vendor_shop_page( $vendor_id );
      if ( $vendor_shop_url ) {
      wp_redirect( $vendor_shop_url );
      exit;
      }
      }
      }
      }
      add_action( ‘template_redirect’, ‘redirect_vendor_author_url’ );
      [/code]

      This code does not work. please assist.

      Kind regards,

    • #193576

      @DragNfLy Can you please explain first what you mean by vendor author page. It will be great if you kindly share a video explaining the flow you are looking for so that we can help you accordingly.
      Also the code you are using is for WCMP that is why it is not working. So kindly use the corresponding class name and hook name for MultiVendorX in your code and check.

    • #195325

      Its been while and we have not heard back from you. We presume your issue is solved now. We are closing this thread. If you need help or face issue in future please open a new thread.

Viewing 2 reply threads

The topic ‘Redirect Vendor Author Page’ is closed to new replies.