get_title() ) . '" class="woocommerce-LoopProduct-link woocommerce-loop-product__link">'; } /** * Default shop archive card elements. */ function botiga_get_default_shop_archive_card_elements() { $elements = array( 'botiga_shop_loop_product_title', 'woocommerce_template_loop_price' ); /** * Hook 'botiga_default_shop_archive_card_elements' * Filters the default shop archive card elements from customizer settings. * * @param array $elements Default elements. * * @since 2.2.2 */ return apply_filters( 'botiga_default_shop_archive_card_elements', $elements ); } /** * Default single product components */ function botiga_get_default_single_product_components() { $components = array( 'woocommerce_template_single_title', 'woocommerce_template_single_rating', 'woocommerce_template_single_price', 'woocommerce_template_single_excerpt', 'woocommerce_template_single_add_to_cart', 'botiga_divider_output', 'woocommerce_template_single_meta', ); $wishlist_enable = Botiga_Modules::is_module_active( 'wishlist' ); $wishlist_layout = get_theme_mod( 'shop_product_wishlist_layout', 'layout1' ); if( $wishlist_enable && 'layout1' !== $wishlist_layout ) { $components[] = 'botiga_single_wishlist_button'; } /** * Hook 'botiga_default_single_product_components' * * @since 1.0.0 */ return apply_filters( 'botiga_default_single_product_components', $components ); } /** * Single product elements */ function botiga_single_product_elements() { $elements = array( 'woocommerce_template_single_title' => esc_html__( 'Product Title', 'botiga' ), 'woocommerce_template_single_rating' => esc_html__( 'Rating', 'botiga' ), 'woocommerce_template_single_price' => esc_html__( 'Price', 'botiga' ), 'woocommerce_template_single_excerpt' => esc_html__( 'Short Description', 'botiga' ), 'woocommerce_template_single_add_to_cart' => esc_html__( 'Add to Cart', 'botiga' ), 'botiga_divider_output' => esc_Html__( 'Divider', 'botiga' ), 'woocommerce_template_single_meta' => esc_html__( 'Meta', 'botiga' ), ); $wishlist_enable = Botiga_Modules::is_module_active( 'wishlist' ); $wishlist_layout = get_theme_mod( 'shop_product_wishlist_layout', 'layout1' ); if( $wishlist_enable && 'layout1' !== $wishlist_layout ) { $elements[ 'botiga_single_wishlist_button' ] = esc_html__( 'Wishlist Button', 'botiga' ); } /** * Hook 'botiga_single_product_elements' * * @since 1.0.0 */ return apply_filters( 'botiga_single_product_elements', $elements ); } /** * Map and replace default woo template functions with quick view functions */ function botiga_get_quick_view_summary_components( $components = array() ) { $components = array_map( function( $component ){ $suffix = str_replace( 'woocommerce_template_single_', '', $component ); if( $component === "woocommerce_template_single_$suffix" ) { return "botiga_quick_view_summary_$suffix"; } return $component; }, $components ); /** * Hook 'botiga_quick_view_product_components' * * @since 1.0.0 */ return apply_filters( 'botiga_quick_view_product_components', $components ); } /** * Divider output */ function botiga_divider_output() { echo '
'; } /** * Botiga output for simple product add to cart area. * The purpose is avoid third party plugins hooking here */ function botiga_simple_add_to_cart( $product, $prefix = '', $remove_botiga_prefix = false ) { // @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.PrefixAllGlobals.DynamicHooknameFound if ( ! $product->is_purchasable() ) { return; } $hook_prefix = botiga_get_hook_prefix( $prefix, $remove_botiga_prefix ); echo wc_get_stock_html( $product ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped do_action( "{$hook_prefix}before_add_to_cart", $product ); if ( $product->is_in_stock() ) : ?>
get_permalink() ) ); ?>" method="post" enctype='multipart/form-data'> apply_filters( "{$hook_prefix}quantity_input_min", $product->get_min_purchase_quantity(), $product ), 'max_value' => apply_filters( "{$hook_prefix}quantity_input_max", $product->get_max_purchase_quantity(), $product ), 'input_value' => isset( $_POST['quantity'] ) ? wc_stock_amount( absint( $_POST['quantity'] ) ) : $product->get_min_purchase_quantity() ) ); do_action( "{$hook_prefix}after_add_to_cart_quantity" ); ?>
get_children() ), 'wc_products_array_filter_visible_grouped' ); if ( $products ) : $post = get_post( $product->get_id() ); $grouped_product = $product; $grouped_products = $products; $quantites_required = false; do_action( "{$hook_prefix}before_add_to_cart_form" ); ?>
get_permalink() ) ); ?>" method="post" enctype='multipart/form-data'> get_id() ); $quantites_required = $quantites_required || ( $grouped_product_child->is_purchasable() && ! $grouped_product_child->has_options() ); $post = $post_object; setup_postdata( $post ); if ( $grouped_product_child->is_in_stock() ) { $show_add_to_cart_button = true; } echo ''; // Output columns for each product. foreach ( $grouped_product_columns as $column_id ) { do_action( "{$hook_prefix}grouped_product_list_before_" . $column_id, $grouped_product_child ); switch ( $column_id ) { case 'quantity': ob_start(); if ( ! $grouped_product_child->is_purchasable() || $grouped_product_child->has_options() || ! $grouped_product_child->is_in_stock() ) { woocommerce_template_loop_add_to_cart(); } elseif ( $grouped_product_child->is_sold_individually() ) { echo ''; } else { do_action( "{$hook_prefix}before_add_to_cart_quantity" ); woocommerce_quantity_input( array( 'input_name' => 'quantity[' . $grouped_product_child->get_id() . ']', 'input_value' => isset( $_POST['quantity'][ $grouped_product_child->get_id() ] ) ? wc_stock_amount( wc_clean( wp_unslash( $_POST['quantity'][ $grouped_product_child->get_id() ] ) ) ) : '', // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized 'min_value' => apply_filters( "{$hook_prefix}quantity_input_min", 0, $grouped_product_child ), 'max_value' => apply_filters( "{$hook_prefix}quantity_input_max", $grouped_product_child->get_max_purchase_quantity(), $grouped_product_child ), 'placeholder' => '0', ) ); do_action( "{$hook_prefix}after_add_to_cart_quantity" ); } $value = ob_get_clean(); break; case 'label': $value = ''; break; case 'price': $value = $grouped_product_child->get_price_html() . wc_get_stock_html( $grouped_product_child ); break; default: $value = ''; break; } echo ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped do_action( "{$hook_prefix}grouped_product_list_after_" . $column_id, $grouped_product_child ); } echo ''; } $post = $previous_post; setup_postdata( $post ); do_action( "{$hook_prefix}grouped_product_list_after", $grouped_product_columns, $quantites_required, $product ); ?>
' . apply_filters( "{$hook_prefix}grouped_product_list_column_" . $column_id, $value, $grouped_product_child ) . '
get_children() ) <= apply_filters( "{$hook_prefix}ajax_variation_threshold", 30, $product ); $available_variations = $get_variations ? $product->get_available_variations() : false; $attributes = $product->get_variation_attributes(); $selected_attributes = $product->get_default_attributes(); $attribute_keys = array_keys( $attributes ); $variations_json = wp_json_encode( $available_variations ); $variations_attr = function_exists( 'wc_esc_json' ) ? wc_esc_json( $variations_json ) : _wp_specialchars( $variations_json, ENT_QUOTES, 'UTF-8', true ); do_action( "{$hook_prefix}before_add_to_cart_form" ); ?>
get_permalink() ) ); ?>" method="post" enctype='multipart/form-data' data-product_id="get_id() ); ?>" data-product_variations="">

$options ) : ?>
$options, 'attribute' => $attribute_name, 'product' => $product, ) ); echo end( $attribute_keys ) === $attribute_name ? wp_kses_post( apply_filters( "{$hook_prefix}reset_variations_link", '' . esc_html__( 'Clear', 'botiga' ) . '' ) ) : ''; ?>
apply_filters( "{$hook_prefix}quantity_input_min", $product->get_min_purchase_quantity(), $product ), 'max_value' => apply_filters( "{$hook_prefix}quantity_input_max", $product->get_max_purchase_quantity(), $product ), 'input_value' => isset( $_POST['quantity'] ) ? wc_stock_amount( wp_unslash( $_POST['quantity'] ) ) : $product->get_min_purchase_quantity(), // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized ) ); do_action( "{$hook_prefix}after_add_to_cart_quantity" ); ?>
add_to_cart_url() ) { return; } $product_url = $product->add_to_cart_url(); $button_text = $product->single_add_to_cart_text(); $hook_prefix = botiga_get_hook_prefix( $prefix, $remove_botiga_prefix ); do_action( "{$hook_prefix}before_add_to_cart_form" ); ?>

">get_price_html(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>

'; echo wp_kses_post( $html ); echo ''; } /** * Single product elements 'Shortcode' output */ function botiga_single_product_shortcode() { $shortcode = get_theme_mod( 'botiga_single_product_shortcode_content', '' ); echo '
'; echo do_shortcode( $shortcode ); echo '
'; } /** * Render woocommerce breadcrumbs removing the trailing slash. */ function botiga_woocommerce_breadcrumbs() { ob_start(); woocommerce_breadcrumb(); $breadcrumbs = ob_get_clean(); echo wp_kses_post( str_replace( array( ' / ', ' / ' ), array( '', '' ), $breadcrumbs ) ); } /** * Render the product archive description. * For some reason the default WooCommerce 'woocommerce_product_archive_description' function do not * display the description whether the page has the 'paged' query_var. This function is a workaround * to display the description in this case. * * @since 2.2.6 * * @return void */ function botiga_woocommerce_product_archive_description() { if ( is_search() ) { return; } if ( is_post_type_archive( 'product' ) ) { $shop_page = get_post( wc_get_page_id( 'shop' ) ); if ( $shop_page ) { $allowed_html = wp_kses_allowed_html( 'post' ); // This is needed for the search product block to work. $allowed_html = array_merge( $allowed_html, array( 'form' => array( 'action' => true, 'accept' => true, 'accept-charset' => true, 'enctype' => true, 'method' => true, 'name' => true, 'target' => true, ), 'input' => array( 'type' => true, 'id' => true, 'class' => true, 'placeholder' => true, 'name' => true, 'value' => true, ), 'button' => array( 'type' => true, 'class' => true, 'label' => true, ), 'svg' => array( 'hidden' => true, 'role' => true, 'focusable' => true, 'xmlns' => true, 'width' => true, 'height' => true, 'viewbox' => true, ), 'path' => array( 'd' => true, ), ) ); $description = wc_format_content( wp_kses( $shop_page->post_content, $allowed_html ) ); if ( $description ) { echo '
' . $description . '
'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } } } } /** * Render the taxonomy archive description. * For some reason the default WooCommerce 'woocommerce_taxonomy_archive_description' function do not * display the description whether the page has the 'paged' query_var. This function is a workaround * to display the description in this case. * * @since 2.2.6 * * @return void */ function botiga_woocommerce_taxonomy_archive_description() { if ( is_product_taxonomy() ) { $term = get_queried_object(); if ( $term ) { /** * Filters the archive's raw description on taxonomy archives. * * @since WooCommerce 6.7.0 * * @param string $term_description Raw description text. * @param WP_Term $term Term object for this taxonomy archive. */ $term_description = apply_filters( 'woocommerce_taxonomy_archive_description_raw', $term->description, $term ); if ( ! empty( $term_description ) ) { echo '
' . wc_format_content( wp_kses_post( $term_description ) ) . '
'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } } } }