Home Forums WC Vendors Pro Support Customize Category Selection on Add new Product

NOTICE: We've Moved to a Ticket System for Support

As of August 31, 2017 (12am EST) our support forums will be retired (read-only), and we will be moving to a support ticket system.  This will allow us to better organize and answer support requests, and provide a more personalized experience as we assist our customers.

For the time being, we will leave our forums open for reading and learning while we work on creating a more robust Knowledge Base for everyone to use.

If you are a WC Vendors Pro customer please open a support ticket here. 

If you are a WC Vendors user please open a support ticket on the Wordpress.org forums.

The information on this forum is outdated and in most instances no longer relevant. Please be sure to check our documentation for the most up to date information.

https://docs.wcvendors.com/

Thank you to all of our customers!

 

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #66102
    George Patsias
    Participant

    Hello,

    I would like to change the way the Product Categories are show in the Add new product page of the Vendor Dashboard.

    I only found this code that shows the categories, and i dont know how to find the main script to modify how to be shown.

    <?php WCVendors_Pro_Product_Form::categories( $object_id, true ); ?>

    Any suggestions?

    Thanks for your time,
    George

    #66108
    Anna
    Member

    @georgepatsias
    What are you trying to change?
    The code for the category drop down or checkbox is in this file, but it is a core file- so alterations would need to be made using filters rather than directly editing the core files:
    wp content/plugins/wc-vendors-pro/public/forms/class-wcvendors-pro-product-form.php

    #66120
    George Patsias
    Participant

    I dont want them to be all messy inside that box, as show on the attached picture…

    I want to change the way they show and make them more easy and more clear to be seen.

    How can i edit them so i can show them one by one for example with their thumbnail pictures?

    Or display them as tabs… I mean i need the code that i can control each category request and present them as i want

    #66143
    Anna
    Member

    Hello,
    The code is in wp content/plugins/wc-vendors-pro/public/forms/class-wcvendors-pro-product-form.php
    starting at line 511 is the category output.

    We do also have the option available in Pro for the select2 multi-select for categories: wp amdin > woocommerce > wc vendors > product form: Category Display (multi select)

    #66164
    George Patsias
    Participant

    Ok Thank you!

    Is it possible to make the Category Display in the Product Form option to open up the list in a more bigger way?

    I have lots of categories and i want them to be easily seen.

    Actually the thing i want to do is the following:

    1) Click on the category input box
    2) Display only Main Categories, NOT subcategories
    3) If you Select a Main category save it
    4) And then show only the subcategories of that Main category

    #66727
    George Patsias
    Participant

    Any answer on how can i do that?

    the code i can find is this:

    /**
    	 * DEPRECATED This function has been replaced - Output a woocommerce attribute selects 
    	 *
    	 * @since      1.0.0
    	 * @param      array     $field      Array defining all field attributes 
    	 * @todo       add filters to allow the field to be hooked into this should not echo html but return it. 
    	 */
    	public static function attributes( $post_id, $multiple = false ) { 
    
    		if ( ! self::$basic_options[ 'attributes' ] ) { 
    
    			// Array of defined attribute taxonomies
    			$attribute_taxonomies = wc_get_attribute_taxonomies();
    
    			// If there are any defined attributes display them 
    			if ( !empty( $attribute_taxonomies ) ) { 
    
    				$i = 0; 
    				// Get any set attributes for the product 
    				$attributes  = maybe_unserialize( get_post_meta( $post_id, '_product_attributes', true ) );
    
    				foreach ( $attribute_taxonomies as $product_attribute ) {
    
    					if ( in_array( $product_attribute->attribute_id, explode( ',', self::$hide_attributes_list ) ) ) continue;  
    
    					$current_attribute = '';
    					$is_variation = 'no';
    					// $custom_attributes 	= ( $multiple ) ? array( 'multiple' => 'multiple' ) : array(); 
    
    					// If the attributes aren't empty, extract the attribute value for the current product 
    					if ( ! empty( $attributes ) && array_key_exists( wc_attribute_taxonomy_name( $product_attribute->attribute_name ), $attributes ) ) { 
    						// get all terms 
    						$current_attribute = wp_get_post_terms( $post_id, wc_attribute_taxonomy_name( $product_attribute->attribute_name ) );
    						$is_variation = $attributes[ wc_attribute_taxonomy_name($product_attribute->attribute_name) ]['is_variation'] ? 'yes' : 'no' ; 
    						$current_attribute = reset ( $current_attribute ); 
    						$current_attribute = $current_attribute->slug;
    					}
    
    					// Output attribute select 
    					WCVendors_Pro_Form_Helper::select( array( 
    						'id' 				=> 'attribute_values[' . $i . '][]', 
    						'post_id'			=> $post_id, 
    						'label' 			=> ucfirst( $product_attribute->attribute_label ),
    						'value' 			=> $current_attribute, 
    						'show_option_none'  => __( 'Select a ', 'wcvendors-pro' ) . ucfirst( $product_attribute->attribute_label ),
    						'taxonomy'			=> wc_attribute_taxonomy_name( $product_attribute->attribute_name ), 
    						'is_attribute'		=> true, 
    						'taxonomy_args'		=> array( 
    												'hide_empty'	=> 0, 
    												'orderby'		=> 'order' 
    											), 
    						// 'custom_attributes' => $custom_attributes, 
    						)
    					);
    
    					// Output attribute name hidden 
    					WCVendors_Pro_Form_Helper::input( array( 
    										'post_id'				=> $post_id, 
    										'id' 					=> 'attribute_names['.$i.']', 
    										'type' 					=> 'hidden', 
    										'show_label'			=> false, 
    										'value'					=> wc_attribute_taxonomy_name( $product_attribute->attribute_name ), 
    										)	
    					);
    					$i++; 
    				}
    			}
    
    			// Support other plugins hooking into attributes 
    			// Not sure if this will work ? 
    			do_action( 'wcv_product_options_attributes' );
    
    		} 
    
    	} //attribute()

    I cannot find any HTML code where i can change to show it differently.

    Any ideas?

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘WC Vendors Pro Support’ is closed to new topics and replies.