X7ROOT File Manager
Current Path:
/home/notabjze/boatingnight.com/wp-content/themes/yachbat/inc
home
/
notabjze
/
boatingnight.com
/
wp-content
/
themes
/
yachbat
/
inc
/
ðŸ“
..
📄
class-customize.php
(41.74 KB)
📄
class-elementor.php
(7.39 KB)
📄
class-hook.php
(11.19 KB)
📄
class-main.php
(10.67 KB)
📄
class-widgets.php
(1.25 KB)
📄
class-woo-template-functions.php
(11.54 KB)
📄
class-woo-template-hooks.php
(4.8 KB)
📄
class-woo.php
(6.35 KB)
📄
functions.php
(8.64 KB)
Editing: class-woo.php
<?php if (!defined( 'ABSPATH' )) exit; if( !class_exists('Yachbat_Woo') ){ class Yachbat_Woo { public function __construct() { // Show title archive shop page add_filter( 'woocommerce_show_page_title', array( $this, 'yachbat_woocommerce_show_title_shop_page' ) ); // Insert category to loop product add_action( 'woocommerce_shop_loop_item_title', array( $this, 'yachbat_woocommerce_template_loop_product_cat' ), 5 ); remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10 ); // Remove breadcrumb woo remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20 ); add_action( 'woocommerce_before_main_content', array( $this, 'yachbat_woocommerce_before_main_content' ), 10 ); remove_action( 'woocommerce_sidebar', 'woocommerce_get_sidebar', 10 ); add_action( 'woocommerce_sidebar', array( $this, 'yachbat_woocommerce_sidebar' ), 10 ); /* * Pagination change next, pre text */ add_filter( 'woocommerce_pagination_args', array( $this, 'yachbat_woocommerce_pagination_args' ) ); /* Change number product related */ add_filter( 'woocommerce_output_related_products_args', array( $this, 'yachbat_change_number_product_related' ) ); /* add data prettyPhoto in gallery */ add_filter( 'woocommerce_single_product_image_thumbnail_html', array( $this, 'yachbat_single_product_image_thumbnail_html' ), 10, 3 ); add_action( 'woocommerce_before_customer_login_form', array( $this, 'yachbat_woocommerce_before_customer_login_form' ), 100 ); // Remove title in Product Detail if( get_theme_mod( 'woo_product_detail_show_title', 'yes' ) != 'yes' ){ remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_title', 5 ); } // Remove Heading in Content Description Tab Woo add_filter('woocommerce_product_description_heading', '__return_null'); add_action('wp_enqueue_scripts', array( $this, 'yachbat_enqueue_scripts_woo' ) ); } function yachbat_woocommerce_show_title_shop_page( $param ){ if( is_shop() && get_post_meta( yachbat_get_current_id(), "yachbat_meta_page_heading", true ) != 'no' ){ return true; }else if( ( is_product_category() || is_product_tag() ) && get_theme_mod( 'woo_archive_show_title', 'yes' ) == 'yes' ){ return true; } return false; } function yachbat_woocommerce_template_loop_product_cat(){ $id = get_the_id(); $cats = get_the_terms( $id, 'product_cat') ? get_the_terms( $id, 'product_cat') : '' ; $value_cats = array(); if ( $cats ) { foreach ( $cats as $value ) { $value_cats[] = is_object($value) && $value->term_id ? '<span class="cat_product">' . $value->name . '</span>' : ""; } } echo implode(' ', $value_cats); } function yachbat_woocommerce_before_main_content(){ ?> <div class="row_site"> <div class="container_site"> <div id="woo_main"> <?php wc_get_template( 'global/wrapper-start.php' ); } function yachbat_woocommerce_sidebar(){ ?> </div> <?php if( yachbat_woo_sidebar() != 'woo_layout_1c' && is_active_sidebar('woo-sidebar') ){ ?> <div id="woo_sidebar"> <?php wc_get_template( 'global/sidebar.php' ); ?> </div> <?php } ?> </div> </div> <?php } function yachbat_woocommerce_pagination_args( $array ) { $args = array( 'next_text' => '<i class="ovaicon-next"></i>', 'prev_text' => '<i class="ovaicon-back"></i>', ); $agrs = array_merge( $array, $args ); return $agrs; } function yachbat_change_number_product_related( $agrs ){ $agrs_setting = [ 'posts_per_page' => apply_filters( 'number_product_realated_posts_per_page', 3 ), 'columns' => apply_filters( 'number_product_realated_columns', 3 ), ]; $agrs = array_merge( $agrs, $agrs_setting ); return $agrs; } function yachbat_single_product_video_html( $id ) { $html = ''; $video_link = get_post_meta( $id, 'ovabrw_video_link', true ); if ( $video_link ) { $html .= '<div class="yacht-video" data-src="'.esc_attr( $video_link ).'">'; $html .= '<i aria-hidden="true" class="icomoon icomoon-caret-circle-right"></i>'; $html .= '<span class="text">'.esc_html__('View video','yachbat').'</span>'; $html .= '</div>'; } return $html; } function yachbat_single_product_image_thumbnail_html( $html, $attachment_id, $id ){ if ( $attachment_id ) { $img_url_thumbnail = wp_get_attachment_image_url ($attachment_id,'large' ); $img_url = wp_get_attachment_image_url ($attachment_id,'large' ); $image_title = esc_attr( get_the_title( $attachment_id ) ); $html = '<div class="woocommerce-product-gallery__image">'; $html .= '<a href="'.esc_url( $img_url ).'" data-fancybox="product_gallery">'; $html .= '<img src="'.esc_url( $img_url_thumbnail ).'" alt="'.esc_attr( $image_title ).'">'; $html .= '</a>'; #video $html .= $this->yachbat_single_product_video_html( $id ); $html .= '</div>'; } else { $html = '<div class="woocommerce-product-gallery__image woocommerce-product-gallery__image--placeholder">'; $html .= sprintf( '<img src="%s" alt="%s" class="wp-post-image" />', esc_url( wc_placeholder_img_src() ), esc_html__( 'Awaiting product image', 'yachbat' ) ); #video $html .= $this->yachbat_single_product_video_html( $id ); $html .= '</div>'; } return $html; } function yachbat_woocommerce_before_customer_login_form(){ ?> <ul class="ova-login-register-woo"> <li class="active"> <a href="javascript:void(0)" data-type="login"> <?php esc_html_e( 'Login', 'yachbat' ); ?> </a> </li> <?php if ( 'yes' === get_option( 'woocommerce_enable_myaccount_registration' ) ) : ?> <li> <a href="javascript:void(0)" data-type="register"> <?php esc_html_e( 'Register', 'yachbat' ); ?> </a> </li> <?php endif; ?> </ul> <?php } function yachbat_enqueue_scripts_woo() { if( is_product() ){ // Carousel wp_enqueue_script('fancybox', YACHBAT_URI.'/assets/libs/fancybox/fancybox.umd.js', array('jquery'),null,true); wp_enqueue_style('fancybox', YACHBAT_URI.'/assets/libs/fancybox/fancybox.css', array(), null); } wp_enqueue_script('yachbat-woo', YACHBAT_URI.'/assets/js/woo.js', array('jquery'),null,true); } } } new Yachbat_Woo();
Upload File
Create Folder