How to change url link of become a vendor on login page?

We're shifting our Forum based support to a more dedicated support system!

We'll be closing our Forum support from 10th June, 2020 and move to Email Support assistance.

  • If you are a WCFM premium add-ons user, contact us- here
  • Want to know more before buying our add-ons? Send Pre sale queries- here
  • If you are a WCFM free user, please open a support ticket at WordPress.org
  • For WCFM App related queries, reach us- here
From now the forum will be read-only!

Viewing 1 reply thread
  • Author
    Posts
    • #136409
      ultimatewebmaker
      Participant

      Hi
      I need to know How to change url link of The button of become a vendor on login page?

    • #136449

      Hello,

      Add this code in your theme’s functions.php, and modify the “href” of a tag as per your requirement.

      add_action('init',function(){
      	global $WCFM, $WCFMmp;
      	remove_action('woocommerce_register_form_end', array( $WCFMmp->frontend, 'wcfmmp_become_vendor_link' ) );
      	remove_action('woocommerce_after_my_account', array( $WCFMmp->frontend, 'wcfmmp_become_vendor_link' ) );
      	add_action( 'woocommerce_after_my_account', 'custom_wcfmmp_become_vendor_link' );
      	add_action( 'woocommerce_register_form_end', 'custom_wcfmmp_become_vendor_link' );
      });
      
      function custom_wcfmmp_become_vendor_link() {
      	global $WCFM, $WCFMmp;		
      		$hide_become_vendor = wcfm_get_option( 'wcfmvm_hide_become_vendor', 'no' );		
      		if( apply_filters( 'wcfm_is_allow_my_account_become_vendor', true ) && ( $hide_become_vendor !== 'yes' ) && WCFMmp_Dependencies::wcfmvm_plugin_active_check() ) {
      			if( wcfm_is_allowed_membership() && !wcfm_has_membership() && !wcfm_is_vendor() ) {
      				echo '<div class="wcfmmp_become_vendor_link">';
      				$wcfm_memberships = get_wcfm_memberships();
      				if( apply_filters( 'wcfm_is_pref_membership', true ) && !empty( $wcfm_memberships ) && apply_filters( 'wcfm_is_allow_my_account_membership_subscribe', true ) ) {
      					echo '<a href="' . apply_filters( 'wcfm_change_membership_url', get_wcfm_membership_url() ) . '">' . apply_filters( 'wcfm_become_vendor_label', __( 'Become a Vendor', 'wc-multivendor-marketplace' ) ) . '</a>';
                                          //change href
      				} else {
      					echo '<a href="' . get_wcfm_registration_page() . '">' . apply_filters( 'wcfm_become_vendor_label', __( 'Become a Vendor', 'wc-multivendor-marketplace' ) ) . '</a>'; //change href
      				}
      				echo '</div>';
      			}
      		}
      }

      Thanks.

Viewing 1 reply thread
  • You must be logged in to reply to this topic.