/**
	Theme Name: Goya Child Theme
	Description: This is a child theme of Goya.
	Template: goya
	Version: 1.0
	Author: Everthemes
	Author URI: http://themeforest.net/user/luisvelaz
	Tags: responsive-layout, flexible-header, custom-colors, mega-menu, woocommerce, shop, ajax, page-builder, translation-ready, gutenberg
	License: GNU General Public License v2 or later
	License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/

<?php
/**
* Show products only of the selected category.
*/
function get_subcategory_terms( $terms, $taxonomies, $args ) {
$new_terms = array();
$hide_category = array( 17 ); // Ids of the category you don't want to display on the shop page
// if a product category and on the shop page
if ( in_array( 'product_cat', $taxonomies ) && !is_admin() && is_shop() )
foreach ( $terms as $key => $term ) {
if ( ! in_array( $term->term_id, $hide_category ) ) {
$new_terms[] = $term;
}
}
$terms = $new_terms;
}
return $terms;
}
add_filter( 'get_terms', 'get_subcategory_terms', 10, 3 );

// USER MORE THEN ONE SKU
add_filter( 'wc_product_has_unique_sku', '__return_false', PHP_INT_MAX );