Vendor WhatsApp Number

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 6 reply threads
  • Author
    Posts
    • #106838
      productsexport
      Participant

      Can you add an option in Capabilities to show Vendors WhatsApp number in the Sold By Template?

      Also when a vendor registration section a field for the whatsApp number?

      Attachments:
      You must be logged in to view attached files.
    • #109047
      Molay Das
      Keymaster

      Hi,

      First navigate to store-manager->Settings->Vendor Registration and then create a custom field with “Whatsapp Number” name. After this please add the below code to your child theme’s functions.php file. If you don’t have a child theme then please use code snippet plugin to add this code.

      add_filter( 'wcfm_marketplace_settings_fields_address', 'vendor_store_custom_fields' );
      function vendor_store_custom_fields($settings_fields_general) {
      	global $WCFM, $WCFMmp, $wp;
      	if( current_user_can('administrator') ) {
      		$van_cur_url = add_query_arg( array(), $wp->request );
      		$van_vendorid = substr( $van_cur_url, strrpos( $van_cur_url, '/' ) + 1 );
      		$user_id = intval( $van_vendorid );
      	}
      	else {
      		$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );
      	}
      	$store_whatsapp_opt = array( 'yes' => __( 'Yes', 'wc-frontend-manager' ), 'no' => __( 'No', 'wc-frontend-manager' ) );
      	$vendor_data = get_user_meta( $user_id, 'wcfmmp_profile_settings', true );
      	$store_whatsapp = isset( $vendor_data['store_whatsapp_number'] ) ? $vendor_data['store_whatsapp_number'] : 'no';
      	$settings_fields_general["store_whatsapp_number"] = array('label' => __('Show / Hide Whatsapp Number', 'wc-frontend-manager') , 'type' => 'select', 'options' => $store_whatsapp_opt, 'class' => 'wcfm-select wcfm_ele wcfm-banner-uploads', 'label_class' => 'wcfm_title', 'value' => $store_whatsapp );
      	return $settings_fields_general;
      }
      
      add_action( 'after_wcfmmp_sold_by_info_product_page', 'cus_after_wcfmmp_sold_by_info_product_page' );
      function cus_after_wcfmmp_sold_by_info_product_page( $vendor_id ) {
      	$vendor_data = get_user_meta( $vendor_id, 'wcfmmp_profile_settings', true );
      	$whatsapp = get_user_meta( $vendor_id, 'whatsapp-number', true );
      	if( $vendor_data['store_whatsapp_number'] == 'yes' ) {
      		echo '<div class="wcfmmp_store_tab_info wcfmmp_store_info_address"><i class="wcfmfa fa-phone" aria-hidden="true"></i><span>' . $whatsapp . '</div>';
      	}
      }

      Thanks,

    • #109216
      productsexport
      Participant

      Ok, I followed your instructions.

      The WhatsApp number I entered for the vendor, is not appearing anywhere on the vendor store page or products.

    • #109676
      Molay Das
      Keymaster

      Hi,

      Didn’t find whatsapp number field under “Profile” setting in edit vendor mode?
      And under “Store Settings” below “Store Address” section didn’t you find the “Show / Hide Whatsapp Number” field?

      If you didn’t find these do’t worry just share us your website login details, we will check it.

      Please send your website login details as private reply here.

      Thanks,

    • #114729
      Molay Das
      Keymaster

      Hi,

      Please share me your website login credentials as private reply here. I need to check it.

      Thanks,

    • #115207
      hansa.tienda
      Participant

      Hi ,
      I followed the procedure in this post:
      – Added a custom field “whatsapp number”
      – Added the code snippet in child’s theme functions.php ( im using the child theme of course)
      – Back in to the store settings there was a “Enable yes/no whatsapp number” below store address fields , and i choosed “Yes”
      – None of the “hidding options” like “hide address or hide number” or anything are checked.

      But, the whatsapp number doesnt appear nowhere in the front store page of the vendor.
      (Im using WPML by the way with two languages)
      – There was no fatal errors or any other related errors on woocommerce > status > logs.

      Thanks,

      • #116064
        Molay Das
        Keymaster

        Hi,

        I can see that you have followed the instructions as explained, a field with “Show / Hide Whatsapp Number” will appear and if you select “yes” it will be displayed in the “Store” tab in product details page.
        Please see the attached screenshots.

        If it’s still didn’t work for you then please provide us your website login details.
        Do send your website login credentials as private reply here.

        Thanks,

        Attachments:
        You must be logged in to view attached files.
    • #155134
      dpasadam
      Participant

      all these steps happened but we are not in the business whatsapp icon

Viewing 6 reply threads
  • You must be logged in to reply to this topic.