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' );
}
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 );
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_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_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" ); ?>
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 '
';
}