/home/suroeste/public_html/wp-content/themes/ewebot/woocommerce
Edit: /home/suroeste/public_html/wp-content/themes/ewebot/woocommerce/wooinit.php (50321B)
'.get_the_title().'';
}
function gt3_product_image_wrap_open () {
echo '
';
}
function gt3_product_image_wrap_close () {
echo '
';
}
function gt3_add_label_outofstock () {
global $product;
if (!($product->is_in_stock())) {
echo '
'.esc_html__('Out Of Stock', 'ewebot').'
';
}
}
add_action('woocommerce_before_shop_loop_item_title', 'gt3_add_label_outofstock', 6);
// Remove woocommerce breadcrumb
remove_action('woocommerce_before_main_content','woocommerce_breadcrumb', 20);
//add breadcrumb to single product
add_action('init', function() {
if ( (gt3_option('page_title_breadcrumbs_conditional') == '1' && gt3_option('page_title_conditional') == '1') || (gt3_option('page_title_breadcrumbs_conditional') === true && gt3_option('page_title_conditional') === true) ) {
add_action('woocommerce_single_product_summary','woocommerce_breadcrumb', 4);
}
});
add_action( 'yith_wcqv_product_image', 'gt3_product_image_wrap_open', 9 );
add_action( 'yith_wcqv_product_image', 'gt3_product_image_wrap_close', 21 );
function gt3_add_thumb_wcqv () {
add_action('woocommerce_product_thumbnails', 'woocommerce_show_product_thumbnails', 2);
}
add_action( 'wp_ajax_yith_load_product_quick_view', "gt3_add_thumb_wcqv", 1);
add_action( 'wp_ajax_nopriv_yith_load_product_quick_view', 'gt3_add_thumb_wcqv',1 );
remove_action( 'yith_wcqv_product_summary', 'woocommerce_template_single_excerpt', 20 );
function gt3_page_template () {
$id = gt3_get_queried_object_id();
switch (is_single()) {
case true:
$layout = gt3_option('product_sidebar_layout');
$sidebar = gt3_option('product_sidebar_def');
break;
case false:
$layout = gt3_option('products_sidebar_layout');
$sidebar = gt3_option('products_sidebar_def');
break;
default:
$layout = gt3_option('products_sidebar_layout');
$sidebar = gt3_option('products_sidebar_def');
}
if (class_exists( 'RWMB_Loader' ) && $id !== 0 && !(class_exists('WooCommerce') && is_product_category())) {
$mb_layout = rwmb_meta('mb_page_sidebar_layout', array(), $id);
if (!empty($mb_layout) && $mb_layout != 'default') {
$layout = $mb_layout;
$sidebar = rwmb_meta('mb_page_sidebar_def', array(), $id);
}
}
if ( ($layout == 'left' || $layout == 'right') && is_active_sidebar( $sidebar ) ) {
$column = 9;
}else{
$column = 12;
}
if ($sidebar == '') {
$layout = 'none';
}
$row_class = ' sidebar_'.esc_attr($layout);
$container_style = 'container';
if ( !is_single() && get_post_type() == 'product') {
$container_style = gt3_option('products_layout');
} elseif (class_exists( 'RWMB_Loader' ) && is_single() && get_post_type() == 'product') {
if (rwmb_meta('mb_single_product', array(), $id) === 'custom' ) {
$container_style = rwmb_meta('mb_product_container', array(), $id);
} else {
$container_style = gt3_option('product_container');
}
}
switch ($container_style) {
case 'container':
$container_class = 'container';
break;
case 'full_width':
$container_class = 'fullwidth-wrapper';
break;
default:
$container_class = 'container';
}
?>
';
if (is_active_sidebar( $sidebar )) {
echo "";
}
echo "
";
}
?>
ID, $viewed_products ) ) {
$viewed_products[] = $post->ID;
}
if ( sizeof( $viewed_products ) > 15 ) {
array_shift( $viewed_products );
}
// Store for session only
wc_setcookie( 'gt3_product_recently_viewed', implode( '|', $viewed_products ) );
}
add_action( 'template_redirect', 'gt3_track_product_view', 20 );
/* Products Page filter bar Top */
function gt3_woo_header_products_open () {
echo '';
}
function gt3_products_infinite_scroll_open() {
$products_infinite_scroll = gt3_option( 'products_infinite_scroll' );
echo '';
if (function_exists('gt3_get_woo_template')) {
gt3_get_woo_template( 'loop/default-pagination' );
}
echo '
';
}
//echo '';
woocommerce_wp_checkbox( array(
'id' => '_checkbox_hot',
'label' => esc_html__( 'Hot Product', 'ewebot' ),
'description' => esc_html__( 'Check for Hot Product', 'ewebot' )
) );
woocommerce_wp_checkbox( array(
'id' => '_checkbox_new',
'label' => esc_html__( 'New Product', 'ewebot' ),
'description' => esc_html__( 'Check for New Product', 'ewebot' )
) );
echo '
';
}
function woo_add_custom_general_fields_save( $post_id ){
$woocommerce_checkbox = isset( $_POST['_checkbox_hot'] ) ? 'yes' : 'no';
update_post_meta( $post_id, '_checkbox_hot', $woocommerce_checkbox );
$woocommerce_checkbox = isset( $_POST['_checkbox_new'] ) ? 'yes' : 'no';
update_post_meta( $post_id, '_checkbox_new', $woocommerce_checkbox );
}
add_action('woocommerce_product_thumbnails','gt3_hot_new_product', 30);
add_action('woocommerce_before_shop_loop_item_title','gt3_hot_new_product', 36);
function gt3_hot_new_product(){
global $product;
$is_new = get_post_meta( $product->get_id(), '_checkbox_new', true );
if ( 'yes' == $is_new ) {
echo '