WCFM frontend manager plugin edit

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!

Multi Vendor Marketplace Plugin | WCFM Marketplace Forums WCFM WCFM frontend manager plugin edit

Viewing 11 reply threads
  • Author
    Posts
    • #138638
      Avatarbrevalo
      Participant

      Hello,

      Is it possible to edit WCFM frontend manager plugin?
      I would like to add shortcode for custom field in Products => Add product window as it shown in the screenshot.

      Thank you in advance.

      Attachments:
      You must be logged in to view attached files.
    • #138717

      Hello,

      You do not need to edit the core plugin. In our plugin have many hooks/filter.

      Add this code to your child theme’s functions.php, to add your custom data –

      add_action('begin_wcfm_products_manage_form',function(){
       echo 'add your custom text';
      });

      Thanks.

    • #138729
      Avatarbrevalo
      Participant

      Oh, Thank you but it only shows plain text not functional custom field.

      Here is an image:

      Attachments:
      You must be logged in to view attached files.
    • #138739

      Hello,

      You have mentioned you have write the shortcode.
      To add a product custom field, our WCFM plugin has this feature in product tabs.
      Admin WCFM dashboard -> Settings -> Product custom fields

      Thanks.

      Attachments:
      You must be logged in to view attached files.
    • #138748
      Avatarbrevalo
      Participant

      Yes I know about Product custom field and this is really helpful, but I am trying to do little bit different thing.

      I want to add choice buttons above the “simple product” field as shown in screenshot:

      Big thanks for your help.

      Attachments:
      You must be logged in to view attached files.
    • #138915

      Hello,

      add_action('begin_wcfm_products_manage_form',function(){
      	global $wp, $WCFM;
      	$buysell_val = '';
      	$product_id = 0;
      	
      	if( isset( $wp->query_vars['wcfm-products-manage'] ) && !empty( $wp->query_vars['wcfm-products-manage'] ) ) {
      		
      		$product = wc_get_product( $wp->query_vars['wcfm-products-manage'] );
      		
      		if( !is_a( $product, 'WC_Product' ) ) {
      			wcfm_restriction_message_show( "Invalid Product" );
      			return;
      		}		
      		
      		// Fetching Product Data
      		if($product && !empty($product)) {
      			$product_id = $wp->query_vars['wcfm-products-manage'];
      			$buysell_val = get_post_meta($product_id,'_product_buysell',true);
      		}
      	}
      	 ?>
      	 <p>What do you want to do?</p>
      	  <input type="radio" id="buy" name="buysell" value="buy" <?php echo ($buysell_val == "buy") ? 'checked="checked"' : ''; ?>>
      	  <label for="buy">Buy</label>
      	  <input type="radio" id="sell" name="buysell" value="sell" <?php echo ($buysell_val == "sell") ? 'checked="checked"' : ''; ?>>
      	  <label for="sell">Sell</label><br>
       <?php		
       			
      });
      
      add_action( 'after_wcfm_products_manage_meta_save', 'fn_custom_product_data_save',10,2 );
      function fn_custom_product_data_save($new_product_id, $wcfm_products_manage_form_data) {
      	global $wpdb;
      	//print_r($wcfm_products_manage_form_data);die;
      
      	if(isset($wcfm_products_manage_form_data['buysell'])) {
      		update_post_meta($new_product_id,'_product_buysell',$wcfm_products_manage_form_data['buysell']);
      	}
      	
      }

      Add this code to your child theme’s functions.php

      In case you do not have child theme then add code using this plugin – https://wordpress.org/plugins/code-snippets/
      Thanks.

      • #139042
        Avatarbrevalo
        Participant

        Oops, something’s went wrong:

        I’ve added your code into the code snippets and got this message:
        There has been a critical error on your website. Please check your site admin email inbox for instructions.

        Learn more about debugging in WordPress.

    • #139045
      Avatarbrevalo
      Participant

      Ok, I’ve fixed the problem!

      Everything is working.

      Now, Can we do so that “buy” and “sell” choice make required and also when the vendor adds the product in the product listing mentioned “for sale” or “for buying”.

    • #139127

      Great!

      Can we do so that “buy” and “sell” choice make required
      >>Modify the HTML –

      <p>What do you want to do?</p>
      	  <input type="radio" id="buy" name="buysell" value="buy" <?php echo ($buysell_val == "buy") ? 'checked="checked"' : ''; ?> data-required="1" data-required_message="What do you want to do: This field is required.">
      	  <label for="buy">Buy</label>
      	  <input type="radio" id="sell" name="buysell" value="sell" <?php echo ($buysell_val == "sell") ? 'checked="checked"' : ''; ?> >
      	  <label for="sell">Sell</label><br>

      Display in product list –

      add_filter( 'wcfm_products_additonal_data_hidden', '__return_false' );
      add_filter('wcfm_products_additonal_data',function($product_data,$product_id){	
      	$product_data = get_post_meta($product_id,'_product_buysell',true);
      	return $product_data;
      },10,2);
      add_filter('wcfm_products_additional_info_column_label',function($lbl){
      	return 'What do you want to do';
      },10);

      Thanks.

    • #141276
      Avatarmeyou
      Participant
      This reply has been marked as private.
    • #142022

      Hello,

      how can I add a label to featured image? Something like “Upload Image” for the featured Image, and “Add more Image” label for more images?.
      >> Add this code in your theme’s functions.php –

      add_filter('wcfm_product_manage_fields_images',function($fields){
      	$fields['featured_img']['label'] = 'Upload Image';
      	$fields['gallery_img']['label'] = 'Add more Image';
      	return $fields;
      });

      where can I locate the html page for the toggle menu, would love to turn the 3 bars into a X when it is clicked
      >>For this you need to override “wcfm-view-header-panels.php” in your theme folder <your theme folder>/wcfm/wcfm-view-header-panels.php from \wp-content\plugins\wc-frontend-manager\views\wcfm-view-header-panels.php.
      And then you will find the Toggle menu section –
      <span class="wcfm_menu_toggler wcfmfa fa-bars text_tip" data-tip="<?php _e( 'Toggle Menu', 'wc-frontend-manager' ); ?>"></span>

      Thanks.

    • #142171
      Avatarmeyou
      Participant
      This reply has been marked as private.
    • #142805

      Hi,

      We can guide you, it will need some javascript and css knowledge.
      Please check this link – https://www.sanwebcorner.com/2016/12/onclick-change-mobile-menu-three-bar.html

      Thanks.

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