display only certain attributes

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 display only certain attributes

Viewing 8 reply threads
  • Author
    Posts
    • #48620
      Joca
      Guest

      Hello, how can I edit my attribute. I’d like to show only certain attributes, not everything. I would like to have certain attributes based on the selected category, but I do not know how to modify this code

    • #48621
      Joca
      Guest

      <?php
      do_action( ‘wcfm_products_manage_attributes’, $product_id );

      $WCFM->wcfm_fields->wcfm_generate_form_field( apply_filters( ‘product_simple_fields_attributes’, array(
      “attributes” => array( ‘label’ => __( ‘Attributes’, ‘wc-frontend-manager’ ), ‘type’ => ‘multiinput’, ‘class’ => ‘wcfm-text wcfm_ele simple variable external grouped booking’, ‘has_dummy’ => true, ‘label_class’ => ‘wcfm_title’, ‘value’ => ‘vino’, ‘options’ => array(
      “term_name” => array(‘type’ => ‘checkbox’),
      “is_active” => array(‘label’ => __(‘Active?’, ‘wc-frontend-manager’), ‘type’ => ‘checkbox’, ‘value’ => ‘enable’, ‘class’ => ‘wcfm-checkbox wcfm_ele attribute_ele simple variable external grouped booking’, ‘label_class’ => ‘wcfm_title attribute_ele checkbox_title’),
      “name” => array(‘label’ => __(‘Name’, ‘wc-frontend-manager’), ‘type’ => ‘text’, ‘class’ => ‘wcfm-text wcfm_ele attribute_ele simple variable external grouped booking’, ‘label_class’ => ‘wcfm_title attribute_ele’),
      “value” => array(‘label’ => __(‘Value(s):’, ‘wc-frontend-manager’), ‘type’ => ‘textarea’, ‘class’ => ‘wcfm-textarea wcfm_ele simple variable external grouped booking’, ‘placeholder’ => sprintf( __(‘Enter some text, some attributes by “%s” separating values.’, ‘wc-frontend-manager’), WC_DELIMITER ), ‘label_class’ => ‘wcfm_title’),
      “is_visible” => array(‘label’ => __(‘Visible on the product page’, ‘wc-frontend-manager’), ‘type’ => ‘checkbox’, ‘value’ => ‘enable’, ‘class’ => ‘wcfm-checkbox wcfm_ele simple variable external grouped booking’, ‘label_class’ => ‘wcfm_title checkbox_title’),
      “is_variation” => array(‘label’ => __(‘Use as Variation’, ‘wc-frontend-manager’), ‘type’ => ‘checkbox’, ‘value’ => ‘enable’, ‘class’ => ‘wcfm-checkbox wcfm_ele variable variable-subscription’, ‘label_class’ => ‘wcfm_title checkbox_title wcfm_ele variable variable-subscription’),
      “tax_name” => array(‘type’ => ‘hidden’),
      “is_taxonomy” => array(‘type’ => ‘hidden’)
      ))
      )) );
      ?>

    • #48635
      Joca
      Guest

      I found the function wcfm_products_manage_select_attributes
      in the path core / class-wcfm-frontend.php and got a hundred I want but how to transfer all of that to the function of my you. What I want is that when a category is selected through wp_dropdown_categories of the bobbies, its terms are attributed.

    • #48717
      WCFM Forum
      Keymaster

      Hi,

      Do you want to allow certain attributes to your vendors?

      Then this is possible using WCFM Capability setting – https://ibb.co/ZMH8HjH

      Well, this capability option comes with WCFM Ultimate.

      But there is no category-attribute relation yet.

      Thank You

    • #48819
      Jovica
      Guest

      category-attribute relation би ја урадио тако што би у мета терм категорије додао аттрибуте.
      Приликом додавања производа и одабиром категорије мењају се атрибјти које сам ја додао.Вендор не додаје атрибуте.
      Термс мета би одредио бутем селектоване категорије путем ајаxа и wp_dropdown_чатегориес.Све то сам урадио само немогу како путем сопствене функције да листам atribute.Ако сам добро схватио овај код листа аттрибуте и само би wc_get_attribute_taxonomies() заменио са термс мета укоји су атрубути везани за ту kategoriju. /**
      * WCFMu Product Select Attributes using WC Taxonomy Attribute
      */
      function wcfm_products_manage_select_attributes( $product_id = 0 ) {
      global $WCFM, $WCFMu, $wc_product_attributes;

      $wcfm_attributes = array();
      if( $product_id ) {
      $wcfm_attributes = get_post_meta( $product_id, ‘_product_attributes’, true );
      }
      print_r($attribute_taxonomies);
      $attribute_taxonomies = wc_get_attribute_taxonomies();
      $attributes = array();
      $acnt = 0;
      if ( ! empty( $attribute_taxonomies ) ) {
      foreach ( $attribute_taxonomies as $attribute_taxonomy ) {
      if ( ( ‘text’ !== $attribute_taxonomy->attribute_type ) && $attribute_taxonomy->attribute_name ) {
      $att_taxonomy = wc_attribute_taxonomy_name( $attribute_taxonomy->attribute_name );
      $attributes[$acnt][‘term_name’] = $att_taxonomy;
      $attributes[$acnt][‘name’] = wc_attribute_label( $att_taxonomy );
      $attributes[$acnt][‘attribute_taxonomy’] = $attribute_taxonomy;
      $attributes[$acnt][‘tax_name’] = $att_taxonomy;
      $attributes[$acnt][‘is_taxonomy’] = 1;

    • #48885
      WCFM Forum
      Keymaster

      Hi,

      This code is for generating Attributes list.

      But you have to add your logic using JavaScript, as attributes has to be alter on depend upon category selection.

      Thank You

    • #48914
      Jovica
      Guest

      What is the hook for changing this code or how to insert it into my function of the topic. To get the id through JavaScript I know how to link to this code? Thanks

    • #48990
      WCFM Forum
      Keymaster

      Hi,

      Please check here – https://ibb.co/kHhy5C7

      It has many filters to alter this attributes list.

      Thank You

    • #49667
      Jovica
      Guest

      Thanks, I just do not know how to add it to my function. I did not do that, so if you help me do this. This is my function function cat_select_attributes ($ attribute_taxonomies) {?>
         <? php $ _POST [‘cat’];

      ?>

        <? php}

      add_action (‘wp_ajax_my_special_ajax_call’, ‘cat_select_attributes’);
      add_action (‘wp_ajax_nopriv_my_special_ajax_call’, ‘cat_select_attributes’);

Viewing 8 reply threads
  • The topic ‘display only certain attributes’ is closed to new replies.