/** * Enable/disable the toggle-box component view when a Single-page layout is active * @param boolean $show_toggle * @param string $component_id * @param WC_Product_Composite $product * @return boolean */ function swc_cp_component_toggled($show_toggle, $component_id, $product) { $show_toggle = get_theme_mod('swc_cp_component_toggled', 'progressive'); $style = $product->get_composite_layout_style(); if ($style === $show_toggle || $show_toggle === 'both') { return true; } return false; }
/** * When selecting the final step in paged mode, the viewport will scroll to this div. * Adding the 'scroll_bottom' class to the element will scroll the bottom of the viewport to the target. * * @param string $component_id * @param WC_Product_Composite $product * @return void */ function wc_cp_final_step_scroll_target($components, $product) { $navigation_style = $product->get_composite_layout_style(); if ($navigation_style === 'paged') { ?> <div class="scroll_final_step"></div><?php } }
/** * Add-to-cart section in single-page mode -- added at the end of everything. * * @param string $component_id * @param WC_Product_Composite $product * @return void */ public function wc_cp_add_single_mode_cart($components, $product) { global $woocommerce_composite_products; $navigation_style = $product->get_composite_layout_style(); if ($navigation_style === 'single' || $navigation_style === 'progressive') { // Add to cart section wc_get_template('single-product/composite-add-to-cart.php', array('product' => $product, 'components' => $components, 'navigation_style' => $navigation_style, 'navigation_style_variation' => $product->get_composite_layout_style_variation(), 'selection_mode' => $product->get_composite_selections_style()), '', $woocommerce_composite_products->plugin_path() . '/templates/'); } }