/** * Composited product title template. * * @param WC_Product $product * @param string $component_id * @param WC_Product_Composite $composite * @return void */ function wc_cp_composited_product_title($product, $component_id, $composite) { $component_data = $composite->get_component_data($component_id); $hide_product_title = isset($component_data['hide_product_title']) ? $component_data['hide_product_title'] : 'no'; $show_selection_ui = true; if ($composite->is_component_static($component_id)) { $show_selection_ui = false; } // Current selection title. if ($hide_product_title !== 'yes') { if ($show_selection_ui) { wc_get_template('composited-product/selection.php', array('component_id' => $component_id, 'composite' => $composite), '', WC_CP()->plugin_path() . '/templates/'); } wc_get_template('composited-product/title.php', array('title' => $product->get_title(), 'product_id' => $product->id, 'component_id' => $component_id, 'composite' => $composite, 'quantity' => ''), '', WC_CP()->plugin_path() . '/templates/'); } // Clear current selection. if ($show_selection_ui) { ?> <p class="component_section_title clear_component_options_wrapper"> <a class="clear_component_options" href="#clear_component"><?php echo __('Clear selection', 'woocommerce-composite-products'); ?> </a> </p><?php } }