How to remove view elements in the manage product file
-
Hello, I am having difficulty understanding how to remove product types from the dropdown menu when creating a new product in WCFM.
I would ideally like the dropdown to display nothing (or with simple product as 2nd array item).
I am using another plugin called ‘WC simple auctions’ and iBid theme.
So currently, Auction currently appears at the bottom of the product type list following (Simple product, Variable product, Grouped product, and External/Affiliate Product, Auction). I would like it to be array(Auction,Simple-Product).
In wcfm-view-products-manage.php on line 415 and I believe this is the view logic but nothing I am doing can change the view. I tried going about this through a child-theme function.php to alter the global product types but it only affected the product dropdown menu in WC and not in WCFM:
(within function.php) add_filter( 'product_type_selector', 'remove_product_types' ); function remove_product_types( $types ){ unset( $types['grouped'] ); unset( $types['external'] ); unset( $types['variable'] ); return $types; }
For your convenience this is the code from wcfm folder within iBid theme starting at line 415 of wcfm-view-products-manage.php
$product_types = apply_filters( 'wcfm_product_types', array('simple' => __('Simple Product', 'ibid'), 'variable' => __('Variable Product', 'ibid'), 'grouped' => __('Grouped Product', 'ibid'), 'external' => __('External/Affiliate Product', 'ibid'), 'auction' => __('Auction', 'ibid') ) ); $product_categories = get_terms( 'product_cat', 'orderby=name&hide_empty=0&parent=0' ); $product_defined_tags = get_terms( 'product_tag', 'orderby=name&hide_empty=0&parent=0' ); $catlimit = apply_filters( 'wcfm_catlimit', -1 ); $product_type_class = ''; if( count( $product_types ) == 0 ) { $product_types = array('simple' => __('Simple Product', 'ibid') ); $product_type_class = 'wcfm_custom_hide'; } elseif( count( $product_types ) == 1 ) { $product_type_class = 'wcfm_custom_hide'; }
I am still trying to teach myself PHP for this project and I appreciate insight anyone may have.
- The topic ‘How to remove view elements in the manage product file’ is closed to new replies.