From f5766cda99d80f46f55f776e4e0fec779946fa68 Mon Sep 17 00:00:00 2001 From: Nedim Uka Date: Mon, 29 Oct 2018 15:18:49 +0100 Subject: [PATCH] Fixed taxonomy search in simple product --- .../class-wiaas-admin-template-selection.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/backend/app/plugins/wiaas/includes/admin/template/class-wiaas-admin-template-selection.php b/backend/app/plugins/wiaas/includes/admin/template/class-wiaas-admin-template-selection.php index 3135d2d..7869972 100644 --- a/backend/app/plugins/wiaas/includes/admin/template/class-wiaas-admin-template-selection.php +++ b/backend/app/plugins/wiaas/includes/admin/template/class-wiaas-admin-template-selection.php @@ -57,13 +57,15 @@ class Wiaas_Admin_Template_Selection { $template_products_data = self::show_template_products($value); $product = wc_get_product( $post->ID ); - $bundled_items = $product->get_bundled_items('view'); - $categories_form_bundle = WC_Product_Template::extract_bundled_product_categories($bundled_items); + if ($product->get_type() == 'bundle') { + $bundled_items = $product->get_bundled_items('view'); + $categories_form_bundle = WC_Product_Template::extract_bundled_product_categories($bundled_items); - self::render_template_products($template_products_data['hardware'], $categories_form_bundle); - self::render_template_products($template_products_data['services'], $categories_form_bundle); - self::render_template_products($template_products_data['installation'], $categories_form_bundle); - self::render_template_products($template_products_data['software'], $categories_form_bundle); + self::render_template_products($template_products_data['hardware'], $categories_form_bundle); + self::render_template_products($template_products_data['services'], $categories_form_bundle); + self::render_template_products($template_products_data['installation'], $categories_form_bundle); + self::render_template_products($template_products_data['software'], $categories_form_bundle); + } ?>