Файловый менеджер - Редактировать - /home/infrafs/INFRABIKEIT/wp-content/plugins/framework.tar
Назад
modules/woocommerce/admin/meta-boxes/woocommerce-meta-boxes.php 0000644 00000006041 15132740277 0020772 0 ustar 00 <?php if(!function_exists('trackstore_elated_map_woocommerce_meta')) { function trackstore_elated_map_woocommerce_meta() { $woocommerce_meta_box = trackstore_elated_create_meta_box( array( 'scope' => array('product'), 'title' => esc_html__('Product Meta', 'trackstore'), 'name' => 'woo_product_meta' ) ); trackstore_elated_create_meta_box_field(array( 'name' => 'eltd_single_product_layout_meta', 'type' => 'select', 'label' => esc_html__('Single Product Layout', 'trackstore'), 'description' => esc_html__('Select single product page layout', 'trackstore'), 'parent' => $woocommerce_meta_box, 'default_value' => 'default', 'options' => array( '' => esc_html__('Default', 'trackstore'), 'standard' => esc_html__('Standard', 'trackstore'), 'wide-gallery' => esc_html__('Wide Gallery', 'trackstore') ), )); trackstore_elated_create_meta_box_field(array( 'name' => 'eltd_product_featured_image_size', 'type' => 'select', 'label' => esc_html__('Dimensions for Product List Shortcode', 'trackstore'), 'description' => esc_html__('Choose image layout when it appears in Elated Product List - Masonry layout shortcode', 'trackstore'), 'parent' => $woocommerce_meta_box, 'options' => array( 'eltd-woo-image-normal-width' => esc_html__('Default', 'trackstore'), 'eltd-woo-image-large-width' => esc_html__('Large width', 'trackstore'), ) )); trackstore_elated_create_meta_box_field( array( 'name' => 'eltd_show_title_area_woo_meta', 'type' => 'select', 'default_value' => '', 'label' => esc_html__('Show Title Area', 'trackstore'), 'description' => esc_html__('Disabling this option will turn off page title area', 'trackstore'), 'parent' => $woocommerce_meta_box, 'options' => trackstore_elated_get_yes_no_select_array() ) ); trackstore_elated_create_meta_box_field(array( 'name' => 'eltd_single_product_new_meta', 'type' => 'select', 'label' => esc_html__('Enable New Product Mark', 'trackstore'), 'description' => esc_html__('Enabling this option will show new product mark on your product lists and product single', 'trackstore'), 'parent' => $woocommerce_meta_box, 'options' => array( 'no' => esc_html__('No', 'trackstore'), 'yes' => esc_html__('Yes', 'trackstore') ) )); } add_action('trackstore_elated_meta_boxes_map', 'trackstore_elated_map_woocommerce_meta', 99); } modules/woocommerce/admin/options-map/woocommerce-map.php 0000644 00000021561 15132740277 0017711 0 ustar 00 <?php if ( ! function_exists( 'trackstore_elated_woocommerce_options_map' ) ) { /** * Add Woocommerce options page */ function trackstore_elated_woocommerce_options_map() { trackstore_elated_add_admin_page( array( 'slug' => '_woocommerce_page', 'title' => esc_html__( 'Woocommerce', 'trackstore' ), 'icon' => 'fa fa-shopping-cart' ) ); /** * Product List Settings */ $panel_product_list = trackstore_elated_add_admin_panel( array( 'page' => '_woocommerce_page', 'name' => 'panel_product_list', 'title' => esc_html__( 'Product List', 'trackstore' ) ) ); trackstore_elated_add_admin_field( array( 'type' => 'select', 'name' => 'eltd_woo_product_list_columns', 'label' => esc_html__( 'Product List Columns', 'trackstore' ), 'default_value' => 'eltd-woocommerce-columns-4', 'description' => esc_html__( 'Choose number of columns for product listing and related products on single product', 'trackstore' ), 'options' => array( 'eltd-woocommerce-columns-3' => esc_html__( '3 Columns', 'trackstore' ), 'eltd-woocommerce-columns-4' => esc_html__( '4 Columns', 'trackstore' ) ), 'parent' => $panel_product_list, ) ); trackstore_elated_add_admin_field( array( 'type' => 'select', 'name' => 'eltd_woo_product_list_columns_space', 'label' => esc_html__( 'Space Between Items', 'trackstore' ), 'description' => esc_html__( 'Select space between items for product listing and related products on single product', 'trackstore' ), 'default_value' => 'normal', 'options' => trackstore_elated_get_space_between_items_array(), 'parent' => $panel_product_list, ) ); trackstore_elated_add_admin_field( array( 'type' => 'select', 'name' => 'eltd_woo_product_list_info_position', 'label' => esc_html__( 'Product Info Position', 'trackstore' ), 'default_value' => 'info_below_image', 'description' => esc_html__( 'Select product info position for product listing and related products on single product', 'trackstore' ), 'options' => array( 'info_below_image' => esc_html__( 'Info Below Image', 'trackstore' ), 'info_on_image_hover_left' => esc_html__( 'Info On Image Hover Left', 'trackstore' ), 'info_on_image_hover_centered' => esc_html__( 'Info On Image Hover Centered', 'trackstore' ) ), 'parent' => $panel_product_list, ) ); trackstore_elated_add_admin_field( array( 'type' => 'text', 'name' => 'eltd_woo_products_per_page', 'label' => esc_html__( 'Number of products per page', 'trackstore' ), 'description' => esc_html__( 'Set number of products on shop page', 'trackstore' ), 'parent' => $panel_product_list, 'args' => array( 'col_width' => 3 ) ) ); trackstore_elated_add_admin_field( array( 'type' => 'select', 'name' => 'eltd_products_list_title_tag', 'label' => esc_html__( 'Products Title Tag', 'trackstore' ), 'default_value' => 'h4', 'options' => trackstore_elated_get_title_tag(), 'parent' => $panel_product_list, ) ); /** * Single Product Settings */ $panel_single_product = trackstore_elated_add_admin_panel( array( 'page' => '_woocommerce_page', 'name' => 'panel_single_product', 'title' => esc_html__( 'Single Product', 'trackstore' ) ) ); trackstore_elated_add_admin_field(array( 'name' => 'single_product_layout', 'type' => 'select', 'label' => esc_html__('Single Product Layout', 'trackstore'), 'default_value' => 'standard', 'description' => esc_html__('Select single product page layout', 'trackstore'), 'options' => array( 'standard' => esc_html__('Standard', 'trackstore'), 'wide-gallery' => esc_html__('Wide Gallery', 'trackstore') ), 'parent' => $panel_single_product, 'args' => array( 'dependence' => true, 'show' => array( 'standard' => '#eltd_panel_single_product_standard', 'wide-gallery' => '#eltd_panel_single_product_wide_gallery', ), 'hide' => array( 'standard' => '#eltd_panel_single_product_wide_gallery', 'wide-gallery' => '#eltd_panel_single_product_standard', ) ) )); trackstore_elated_add_admin_field( array( 'type' => 'select', 'name' => 'show_title_area_woo', 'default_value' => '', 'label' => esc_html__( 'Show Title Area', 'trackstore' ), 'description' => esc_html__( 'Enabling this option will show title area on single post pages', 'trackstore' ), 'parent' => $panel_single_product, 'options' => trackstore_elated_get_yes_no_select_array(), 'args' => array( 'col_width' => 3 ) ) ); trackstore_elated_add_admin_field( array( 'type' => 'select', 'name' => 'eltd_single_product_title_tag', 'default_value' => 'h2', 'label' => esc_html__( 'Single Product Title Tag', 'trackstore' ), 'options' => trackstore_elated_get_title_tag(), 'parent' => $panel_single_product, ) ); $panel_single_product_standard = trackstore_elated_add_admin_container(array( 'name' => 'panel_single_product_standard', 'parent' => $panel_single_product, 'hidden_property' => 'single_product_layout', 'hidden_values' => array( 'wide-gallery' ) )); trackstore_elated_add_admin_field( array( 'type' => 'select', 'name' => 'woo_number_of_thumb_images', 'default_value' => '4', 'label' => esc_html__( 'Number of Thumbnail Images per Row', 'trackstore' ), 'options' => array( '4' => esc_html__( 'Four', 'trackstore' ), '3' => esc_html__( 'Three', 'trackstore' ), '2' => esc_html__( 'Two', 'trackstore' ) ), 'parent' => $panel_single_product_standard ) ); trackstore_elated_add_admin_field( array( 'type' => 'select', 'name' => 'woo_set_thumb_images_position', 'default_value' => 'on-left-side', 'label' => esc_html__( 'Set Thumbnail Images Position', 'trackstore' ), 'options' => array( 'below-image' => esc_html__( 'Below Featured Image', 'trackstore' ), 'on-left-side' => esc_html__( 'On The Left Side Of Featured Image', 'trackstore' ) ), 'parent' => $panel_single_product_standard ) ); trackstore_elated_add_admin_field( array( 'type' => 'select', 'name' => 'woo_enable_single_product_zoom_image', 'default_value' => 'no', 'label' => esc_html__( 'Enable Zoom Maginfier', 'trackstore' ), 'description' => esc_html__( 'Enabling this option will show magnifier image on featured image hover', 'trackstore' ), 'parent' => $panel_single_product_standard, 'options' => trackstore_elated_get_yes_no_select_array( false ), 'args' => array( 'col_width' => 3 ) ) ); trackstore_elated_add_admin_field( array( 'type' => 'select', 'name' => 'woo_set_single_images_behavior', 'default_value' => 'pretty-photo', 'label' => esc_html__( 'Set Images Behavior', 'trackstore' ), 'options' => array( 'pretty-photo' => esc_html__( 'Pretty Photo Lightbox', 'trackstore' ), 'photo-swipe' => esc_html__( 'Photo Swipe Lightbox', 'trackstore' ) ), 'parent' => $panel_single_product_standard ) ); /** * DropDown Cart Widget Settings */ $panel_dropdown_cart = trackstore_elated_add_admin_panel( array( 'page' => '_woocommerce_page', 'name' => 'panel_dropdown_cart', 'title' => esc_html__('Dropdown Cart Widget', 'trackstore') ) ); trackstore_elated_add_admin_field(array( 'name' => 'eltd_woo_dropdown_cart_description', 'type' => 'text', 'label' => esc_html__('Cart Description', 'trackstore'), 'default_value' => '', 'description' => esc_html__('Enter dropdown cart description', 'trackstore'), 'parent' => $panel_dropdown_cart )); /** * Empty Cart upload image option */ $panel_empty_cart = trackstore_elated_add_admin_panel( array( 'page' => '_woocommerce_page', 'name' => 'panel_empty_cart', 'title' => esc_html__('Empty Cart Page', 'trackstore') ) ); trackstore_elated_add_admin_field(array( 'name' => 'eltd_woo_empty_cart_image', 'type' => 'image', 'label' => esc_html__('Empty Cart Page Image', 'trackstore'), 'default_value' => '', 'description' => esc_html__('Upload image which will be displayed on empty cart page.', 'trackstore'), 'parent' => $panel_empty_cart )); } add_action( 'trackstore_elated_options_map', 'trackstore_elated_woocommerce_options_map', 17 ); } modules/woocommerce/woocommerce-template-hooks.php 0000644 00000067546 15132740277 0016547 0 ustar 00 <?php if ( ! function_exists( 'trackstore_elated_woocommerce_body_class' ) ) { function trackstore_elated_woocommerce_body_class( $classes ) { if ( trackstore_elated_is_woocommerce_page() ) { $classes[] = 'eltd-woocommerce-page'; if ( function_exists( 'is_shop' ) && is_shop() ) { $classes[] = 'eltd-woo-main-page'; } if ( is_singular( 'product' ) ) { $classes[] = 'eltd-woo-single-page'; } } return $classes; } add_filter( 'body_class', 'trackstore_elated_woocommerce_body_class' ); } if ( ! function_exists( 'trackstore_elated_woocommerce_columns_class' ) ) { function trackstore_elated_woocommerce_columns_class( $classes ) { $classes[] = trackstore_elated_options()->getOptionValue( 'eltd_woo_product_list_columns' ); return $classes; } add_filter( 'body_class', 'trackstore_elated_woocommerce_columns_class' ); } if ( ! function_exists( 'trackstore_elated_woocommerce_columns_space_class' ) ) { function trackstore_elated_woocommerce_columns_space_class( $classes ) { $woo_space_between_items = trackstore_elated_options()->getOptionValue( 'eltd_woo_product_list_columns_space' ); if ( ! empty( $woo_space_between_items ) ) { $classes[] = 'eltd-woo-' . $woo_space_between_items . '-space'; } return $classes; } add_filter( 'body_class', 'trackstore_elated_woocommerce_columns_space_class' ); } if ( ! function_exists( 'trackstore_elated_woocommerce_pl_info_position_class' ) ) { function trackstore_elated_woocommerce_pl_info_position_class( $classes ) { $info_position = trackstore_elated_options()->getOptionValue( 'eltd_woo_product_list_info_position' ); $info_position_class = ''; if ( $info_position === 'info_below_image' ) { $info_position_class = 'eltd-woo-pl-info-below-image'; } else if ( $info_position === 'info_on_image_hover_left' ) { $info_position_class = 'eltd-woo-pl-info-on-image-hover-left'; } else if ( $info_position === 'info_on_image_hover_centered' ) { $info_position_class = 'eltd-woo-pl-info-on-image-hover-centered'; } $classes[] = $info_position_class; return $classes; } add_filter( 'body_class', 'trackstore_elated_woocommerce_pl_info_position_class' ); } if ( ! function_exists( 'trackstore_elated_add_woocommerce_shortcode_class' ) ) { /** * Function that checks if current page has at least one of WooCommerce shortcodes added * @return string */ function trackstore_elated_add_woocommerce_shortcode_class( $classes ) { $woocommerce_shortcodes = array( 'woocommerce_order_tracking' ); foreach ( $woocommerce_shortcodes as $woocommerce_shortcode ) { $has_shortcode = trackstore_elated_has_shortcode( $woocommerce_shortcode ); if ( $has_shortcode ) { $classes[] = 'eltd-woocommerce-page woocommerce-account eltd-' . str_replace( '_', '-', $woocommerce_shortcode ); } } return $classes; } add_filter( 'body_class', 'trackstore_elated_add_woocommerce_shortcode_class' ); } if ( ! function_exists( 'trackstore_elated_woo_single_product_layout_class' ) ) { function trackstore_elated_woo_single_product_layout_class( $classes ) { $product_layout = get_post_meta( get_the_id(), 'eltd_single_product_layout_meta', true ); if (empty($product_layout)) { $product_layout = trackstore_elated_options()->getOptionValue( 'single_product_layout' ); } if (!empty($product_layout)) { $classes[] = 'eltd-woo-single-' . $product_layout; } return $classes; } add_filter( 'body_class', 'trackstore_elated_woo_single_product_layout_class' ); } if ( ! function_exists( 'trackstore_elated_woo_single_product_thumb_position_class' ) ) { function trackstore_elated_woo_single_product_thumb_position_class( $classes ) { $product_thumbnail_position = trackstore_elated_get_meta_field_intersect( 'woo_set_thumb_images_position' ); if ( ! empty( $product_thumbnail_position ) ) { $classes[] = 'eltd-woo-single-thumb-' . $product_thumbnail_position; } return $classes; } add_filter( 'body_class', 'trackstore_elated_woo_single_product_thumb_position_class' ); } if ( ! function_exists( 'trackstore_elated_woo_single_product_has_zoom_class' ) ) { function trackstore_elated_woo_single_product_has_zoom_class( $classes ) { $zoom_maginifier = trackstore_elated_get_meta_field_intersect( 'woo_enable_single_product_zoom_image' ); if ( $zoom_maginifier === 'yes' ) { $classes[] = 'eltd-woo-single-has-zoom'; } return $classes; } add_filter( 'body_class', 'trackstore_elated_woo_single_product_has_zoom_class' ); } if ( ! function_exists( 'trackstore_elated_woo_single_product_has_zoom_support' ) ) { function trackstore_elated_woo_single_product_has_zoom_support() { $zoom_maginifier = trackstore_elated_get_meta_field_intersect( 'woo_enable_single_product_zoom_image' ); if ( $zoom_maginifier === 'yes' ) { add_theme_support( 'wc-product-gallery-zoom' ); } } add_action( 'init', 'trackstore_elated_woo_single_product_has_zoom_support' ); } if ( ! function_exists( 'trackstore_elated_woo_single_product_image_behavior_class' ) ) { function trackstore_elated_woo_single_product_image_behavior_class( $classes ) { $image_behavior = trackstore_elated_get_meta_field_intersect( 'woo_set_single_images_behavior' ); if ( ! empty( $image_behavior ) ) { $classes[] = 'eltd-woo-single-has-' . $image_behavior; } return $classes; } add_filter( 'body_class', 'trackstore_elated_woo_single_product_image_behavior_class' ); } if ( ! function_exists( 'trackstore_elated_woo_single_product_photo_swipe_support' ) ) { function trackstore_elated_woo_single_product_photo_swipe_support() { $image_behavior = trackstore_elated_get_meta_field_intersect( 'woo_set_single_images_behavior' ); if ( $image_behavior === 'photo-swipe' ) { add_theme_support( 'wc-product-gallery-lightbox' ); } } add_action( 'init', 'trackstore_elated_woo_single_product_photo_swipe_support' ); } if ( ! function_exists( 'trackstore_elated_woocommerce_products_per_page' ) ) { /** * Function that sets number of products per page. Default is 9 * @return int number of products to be shown per page */ function trackstore_elated_woocommerce_products_per_page() { $products_per_page_meta = trackstore_elated_options()->getOptionValue( 'eltd_woo_products_per_page' ); $products_per_page = ! empty( $products_per_page_meta ) ? intval( $products_per_page_meta ) : 12; if ( isset( $_GET['woo-products-count'] ) && $_GET['woo-products-count'] === 'view-all' ) { $products_per_page = 9999; } return $products_per_page; } add_filter('loop_shop_per_page', 'trackstore_elated_woocommerce_products_per_page', 20); } if ( ! function_exists( 'trackstore_elated_woocommerce_related_products_args' ) ) { /** * Function that sets number of displayed related products. Hooks to woocommerce_output_related_products_args filter * * @param $args array array of args for the query * * @return mixed array of changed args */ function trackstore_elated_woocommerce_related_products_args( $args ) { $args['posts_per_page'] = 4; return $args; } add_filter('woocommerce_output_related_products_args', 'trackstore_elated_woocommerce_related_products_args'); } if ( ! function_exists( 'trackstore_elated_woocommerce_product_thumbnail_column_size' ) ) { /** * Function that sets number of thumbnails on single product page per row. Default is 4 * @return int number of thumbnails to be shown on single product page per row */ function trackstore_elated_woocommerce_product_thumbnail_column_size() { $product_layout = get_post_meta( get_the_id(), 'eltd_single_product_layout_meta', true ); if (empty($product_layout)) { $product_layout = trackstore_elated_options()->getOptionValue( 'single_product_layout' ); } if ($product_layout === 'wide-gallery') { $thumbs_number = 2; } else { $thumbs_number_meta = trackstore_elated_options()->getOptionValue( 'woo_number_of_thumb_images' ); $thumbs_number = ! empty ( $thumbs_number_meta ) ? intval( $thumbs_number_meta ) : 4; } return apply_filters( 'trackstore_elated_number_of_thumbnails_per_row_single_product', $thumbs_number ); } add_filter( 'woocommerce_product_thumbnails_columns', 'trackstore_elated_woocommerce_product_thumbnail_column_size', 10 ); } if ( ! function_exists( 'trackstore_elated_single_product_show_product_thumbnails' ) ) { function trackstore_elated_single_product_show_product_thumbnails() { global $product; $attachment_ids = $product->get_gallery_image_ids(); if ( $attachment_ids && has_post_thumbnail() ) { foreach ( $attachment_ids as $attachment_id ) { $full_size_image = wp_get_attachment_image_src( $attachment_id, 'full' ); $thumbnail = wp_get_attachment_image_src( $attachment_id, 'woocommerce_thumbnail' ); $attributes = array( 'title' => get_post_field( 'post_title', $attachment_id ), 'data-caption' => get_post_field( 'post_excerpt', $attachment_id ), 'data-src' => $full_size_image[0], 'data-large_image' => $full_size_image[0], 'data-large_image_width' => $full_size_image[1], 'data-large_image_height' => $full_size_image[2], ); $product_layout = get_post_meta( get_the_id(), 'eltd_single_product_layout_meta', true ); if (empty($product_layout)) { $product_layout = trackstore_elated_options()->getOptionValue( 'single_product_layout' ); } if ($product_layout === 'wide-gallery') { $html = '<div class="woocommerce-product-gallery__image"><a href="' . esc_url( $full_size_image[0] ) . '">'; $html .= wp_get_attachment_image( $attachment_id, 'woocommerce_single', false, $attributes ); $html .= '</a></div>'; } else { $html = '<div data-thumb="' . esc_url( $thumbnail[0] ) . '" class="woocommerce-product-gallery__image"><a href="' . esc_url( $full_size_image[0] ) . '">'; $html .= wp_get_attachment_image( $attachment_id, 'woocommerce_thumbnail', false, $attributes ); $html .= '</a></div>'; } echo apply_filters( 'woocommerce_single_product_image_thumbnail_html', $html, $attachment_id ); } } } } if ( ! function_exists( 'trackstore_elated_woocommerce_template_loop_product_title' ) ) { /** * Function for overriding product title template in Product List Loop */ function trackstore_elated_woocommerce_template_loop_product_title() { $tag = trackstore_elated_options()->getOptionValue( 'eltd_products_list_title_tag' ); if ( $tag === '' ) { $tag = 'h4'; } the_title( '<' . $tag . ' class="eltd-product-list-title"><a href="' . get_the_permalink() . '">', '</a></' . $tag . '>' ); } } if ( ! function_exists( 'trackstore_elated_woocommerce_template_single_title' ) ) { /** * Function for overriding product title template in Single Product template */ function trackstore_elated_woocommerce_template_single_title() { $tag = trackstore_elated_options()->getOptionValue( 'eltd_single_product_title_tag' ); if ( $tag === '' ) { $tag = 'h1'; } the_title( '<' . $tag . ' itemprop="name" class="eltd-single-product-title">', '</' . $tag . '>' ); } } if ( ! function_exists( 'trackstore_elated_woocommerce_sale_flash' ) ) { /** * Function for overriding Sale Flash Template * * @return string */ function trackstore_elated_woocommerce_sale_flash() { return '<span class="eltd-onsale">' . esc_html__( 'SALE', 'trackstore' ) . '</span>'; } add_filter('woocommerce_sale_flash', 'trackstore_elated_woocommerce_sale_flash'); } if ( ! function_exists( 'trackstore_elated_woocommerce_product_out_of_stock' ) ) { /** * Function for adding Out Of Stock Template * * @return string */ function trackstore_elated_woocommerce_product_out_of_stock() { global $product; if ( ! $product->is_in_stock() ) { print '<span class="eltd-out-of-stock">' . esc_html__( 'OUT OF STOCK', 'trackstore' ) . '</span>'; } } add_filter('woocommerce_product_thumbnails', 'trackstore_elated_woocommerce_product_out_of_stock', 20); add_action('woocommerce_before_shop_loop_item_title', 'trackstore_elated_woocommerce_product_out_of_stock', 10); } if ( ! function_exists( 'trackstore_elated_woocommerce_view_all_pagination' ) ) { /** * Function for adding New WooCommerce Pagination Template * * @return string */ function trackstore_elated_woocommerce_view_all_pagination() { global $wp_query; if ( $wp_query->max_num_pages <= 1 ) { return; } $html = ''; $shop_id = trackstore_elated_get_woo_shop_page_id(); if ( ! empty( $shop_id ) && $shop_id !== -1 ) { $html .= '<div class="eltd-woo-view-all-pagination">'; $html .= '<a href="' . get_permalink( $shop_id ) . '?woo-products-count=view-all">' . esc_html__( 'View All', 'trackstore' ) . '</a>'; $html .= '</div>'; } echo wp_kses_post( $html ); } add_action('woocommerce_after_shop_loop', 'trackstore_elated_woocommerce_view_all_pagination', 11); } if ( ! function_exists( 'trackstore_elated_woo_view_all_pagination_additional_tag_before' ) ) { function trackstore_elated_woo_view_all_pagination_additional_tag_before() { print '<div class="eltd-woo-pagination-holder"><div class="eltd-woo-pagination-inner">'; } } if ( ! function_exists( 'trackstore_elated_woo_view_all_pagination_additional_tag_after' ) ) { function trackstore_elated_woo_view_all_pagination_additional_tag_after() { print '</div></div>'; } } if ( ! function_exists( 'trackstore_elated_single_product_content_additional_tag_before' ) ) { function trackstore_elated_single_product_content_additional_tag_before() { print '<div class="eltd-single-product-content">'; } } if ( ! function_exists( 'trackstore_elated_single_product_content_additional_tag_after' ) ) { function trackstore_elated_single_product_content_additional_tag_after() { print '</div>'; } } if ( ! function_exists( 'trackstore_elated_single_product_summary_additional_tag_before' ) ) { function trackstore_elated_single_product_summary_additional_tag_before() { print '<div class="eltd-single-product-summary">'; } } if ( ! function_exists( 'trackstore_elated_single_product_summary_additional_tag_after' ) ) { function trackstore_elated_single_product_summary_additional_tag_after() { print '</div>'; } } if ( ! function_exists( 'trackstore_elated_pl_holder_additional_tag_before' ) ) { function trackstore_elated_pl_holder_additional_tag_before() { print '<div class="eltd-pl-main-holder">'; } } if ( ! function_exists( 'trackstore_elated_pl_holder_additional_tag_after' ) ) { function trackstore_elated_pl_holder_additional_tag_after() { print '</div>'; } } if ( ! function_exists( 'trackstore_elated_pl_inner_additional_tag_before' ) ) { function trackstore_elated_pl_inner_additional_tag_before() { print '<div class="eltd-pl-inner">'; } } if ( ! function_exists( 'trackstore_elated_pl_inner_additional_tag_after' ) ) { function trackstore_elated_pl_inner_additional_tag_after() { print '</div>'; } } if ( ! function_exists( 'trackstore_elated_pl_image_additional_tag_before' ) ) { function trackstore_elated_pl_image_additional_tag_before() { print '<div class="eltd-pl-image">'; } } if ( ! function_exists( 'trackstore_elated_pl_image_additional_tag_after' ) ) { function trackstore_elated_pl_image_additional_tag_after() { print '</div>'; } } if ( ! function_exists( 'trackstore_elated_pl_inner_text_additional_tag_before' ) ) { function trackstore_elated_pl_inner_text_additional_tag_before() { print '<div class="eltd-pl-text"><div class="eltd-pl-text-outer"><div class="eltd-pl-text-inner">'; } } if ( ! function_exists( 'trackstore_elated_pl_inner_text_additional_tag_after' ) ) { function trackstore_elated_pl_inner_text_additional_tag_after() { print '</div></div></div>'; } } if ( ! function_exists( 'trackstore_elated_pl_text_wrapper_additional_tag_before' ) ) { function trackstore_elated_pl_text_wrapper_additional_tag_before() { print '<div class="eltd-pl-text-wrapper">'; } } if ( ! function_exists( 'trackstore_elated_pl_text_wrapper_additional_tag_after' ) ) { function trackstore_elated_pl_text_wrapper_additional_tag_after() { print '</div>'; } } if ( ! function_exists( 'trackstore_elated_pl_text_wrapper_info_bottom_additional_tag_before' ) ) { function trackstore_elated_pl_text_wrapper_info_bottom_additional_tag_before() { print '<div class="eltd-pl-text-wrapper-info-bottom-holder clearfix">'; } } if ( ! function_exists( 'trackstore_elated_pl_text_wrapper_info_bottom_additional_tag_after' ) ) { function trackstore_elated_pl_text_wrapper_info_bottom_additional_tag_after() { print '</div>'; } } if ( ! function_exists( 'trackstore_elated_pl_text_wrapper_info_top_additional_tag_before' ) ) { function trackstore_elated_pl_text_wrapper_info_top_additional_tag_before() { print '<div class="eltd-pl-text-wrapper-info-top-holder clearfix">'; } } if ( ! function_exists( 'trackstore_elated_pl_text_wrapper_info_top_additional_tag_after' ) ) { function trackstore_elated_pl_text_wrapper_info_top_additional_tag_after() { print '</div>'; } } if ( ! function_exists( 'trackstore_elated_pl_rating_additional_tag_before' ) ) { function trackstore_elated_pl_rating_additional_tag_before() { global $product; if ( get_option( 'woocommerce_enable_review_rating' ) !== 'no' ) { $rating_html = wc_get_rating_html( $product->get_average_rating() ); if ( $rating_html !== '' ) { print '<div class="eltd-pl-rating-holder">'; } } } } if ( ! function_exists( 'trackstore_elated_pl_rating_additional_tag_after' ) ) { function trackstore_elated_pl_rating_additional_tag_after() { global $product; if ( get_option( 'woocommerce_enable_review_rating' ) !== 'no' ) { $rating_html = wc_get_rating_html( $product->get_average_rating() ); if ( $rating_html !== '' ) { print '</div>'; } } } } if (!function_exists('trackstore_elated_single_product_wide_tabs')) { function trackstore_elated_single_product_wide_tabs() { $product_layout = get_post_meta( get_the_id(), 'eltd_single_product_layout_meta', true ); if (empty($product_layout)) { $product_layout = trackstore_elated_options()->getOptionValue( 'single_product_layout' ); } if ($product_layout === 'wide-gallery') { //Change tabs position remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 10 ); return woocommerce_output_product_data_tabs(); } return ''; } } if (!function_exists('trackstore_elated_single_product_wide_additional_tag_before')) { function trackstore_elated_single_product_wide_additional_tag_before() { $product_layout = get_post_meta( get_the_id(), 'eltd_single_product_layout_meta', true ); if (empty($product_layout)) { $product_layout = trackstore_elated_options()->getOptionValue( 'single_product_layout' ); } if ($product_layout === 'wide-gallery') { print '<div class="eltd-grid">'; } } } if (!function_exists('trackstore_elated_single_product_wide_additional_tag_after')) { function trackstore_elated_single_product_wide_additional_tag_after() { $product_layout = get_post_meta( get_the_id(), 'eltd_single_product_layout_meta', true ); if (empty($product_layout)) { $product_layout = trackstore_elated_options()->getOptionValue( 'single_product_layout' ); } if ($product_layout === 'wide-gallery') { print '</div>'; } } } if ( ! function_exists( 'trackstore_elated_woocommerce_share' ) ) { /** * Function that social share for product page * Return array array of WooCommerce pages */ function trackstore_elated_woocommerce_share() { if ( trackstore_elated_options()->getOptionValue( 'enable_social_share' ) == 'yes' && trackstore_elated_options()->getOptionValue( 'enable_social_share_on_product' ) == 'yes' ) : print '<div class="eltd-woo-social-share-holder">'; print '<span>' . esc_html__( 'Share:', 'trackstore' ) . '</span>'; echo trackstore_elated_get_social_share_html(); print '</div>'; endif; } } if ( ! function_exists( 'trackstore_elated_woocommerce_single_product_title' ) ) { /** * Function that checks option for single product title and overrides it with filter */ function trackstore_elated_woocommerce_single_product_title( $show_title_area ) { if ( is_singular( 'product' ) ) { $woo_title_meta = get_post_meta( get_the_ID(), 'eltd_show_title_area_woo_meta', true ); if ( empty( $woo_title_meta ) ) { $woo_title_main = trackstore_elated_options()->getOptionValue( 'show_title_area_woo' ); if ( ! empty( $woo_title_main ) ) { $show_title_area = $woo_title_main == 'yes' ? true : false; } } else { $show_title_area = $woo_title_meta == 'yes' ? true : false; } } return $show_title_area; } add_filter( 'trackstore_elated_show_title_area', 'trackstore_elated_woocommerce_single_product_title' ); } if ( ! function_exists( 'trackstore_elated_set_title_text_output_for_woocommerce' ) ) { function trackstore_elated_set_title_text_output_for_woocommerce( $title ) { if ( is_product_category() || is_product_tag() ) { global $wp_query; $tax = $wp_query->get_queried_object(); $category_title = $tax->name; $title = $category_title; } elseif ( trackstore_elated_is_woocommerce_shop() || is_singular( 'product' ) ) { $shop_id = trackstore_elated_get_woo_shop_page_id(); $title = $shop_id !== -1 ? get_the_title( $shop_id ) : esc_html__( 'Shop', 'trackstore' ); } return $title; } add_filter( 'trackstore_elated_title_text', 'trackstore_elated_set_title_text_output_for_woocommerce' ); } if ( ! function_exists( 'trackstore_elated_set_breadcrumbs_output_for_woocommerce' ) ) { function trackstore_elated_set_breadcrumbs_output_for_woocommerce( $childContent, $delimiter, $before, $after ) { $shop_id = trackstore_elated_get_woo_shop_page_id(); if ( trackstore_elated_is_product_category() ) { $childContent = ''; if ( ! empty( $shop_id ) && $shop_id !== -1 ) { $childContent .= '<a itemprop="url" href="' . get_permalink( $shop_id ) . '">' . get_the_title( $shop_id ) . '</a>' . $delimiter; } $thisCat = get_category( get_query_var( 'cat' ), false ); if ( isset( $thisCat->parent ) && $thisCat->parent != 0 ) { $childContent .= get_category_parents( $thisCat->parent, true, ' ' . $delimiter ); } $childContent .= $before . single_cat_title( '', false ) . $after; } elseif ( is_singular( 'product' ) ) { $childContent = ''; $product = wc_get_product( get_the_ID() ); $categories = ! empty( $product ) ? wc_get_product_category_list( $product->get_id(), ', ' ) : ''; if ( ! empty( $shop_id ) && $shop_id !== -1 ) { $childContent .= '<a itemprop="url" href="' . get_permalink( $shop_id ) . '">' . get_the_title( $shop_id ) . '</a>' . $delimiter; } if ( ! empty( $categories ) ) { $childContent .= $categories . $delimiter; } $childContent .= $before . get_the_title() . $after; } elseif ( trackstore_elated_is_woocommerce_shop() ) { $childContent = $before . get_the_title( $shop_id ) . $after; } return $childContent; } add_filter( 'trackstore_elated_breadcrumbs_title_child_output', 'trackstore_elated_set_breadcrumbs_output_for_woocommerce', 10, 4 ); } if ( ! function_exists( 'trackstore_elated_set_sidebar_layout_for_woocommerce' ) ) { function trackstore_elated_set_sidebar_layout_for_woocommerce( $sidebar_layout ) { if ( is_archive() && ( is_product_category() || is_product_tag() ) ) { $sidebar_layout = trackstore_elated_get_meta_field_intersect( 'sidebar_layout', trackstore_elated_get_woo_shop_page_id() ); } return $sidebar_layout; } add_filter( 'trackstore_elated_sidebar_layout', 'trackstore_elated_set_sidebar_layout_for_woocommerce' ); } if ( ! function_exists( 'trackstore_elated_set_sidebar_name_for_woocommerce' ) ) { function trackstore_elated_set_sidebar_name_for_woocommerce( $sidebar_name ) { if ( is_archive() && ( is_product_category() || is_product_tag() ) ) { $sidebar_name = trackstore_elated_get_meta_field_intersect( 'custom_sidebar_area', trackstore_elated_get_woo_shop_page_id() ); } return $sidebar_name; } add_filter( 'trackstore_elated_sidebar_name', 'trackstore_elated_set_sidebar_name_for_woocommerce' ); } if (!function_exists('trackstore_elated_woocommerce_new_product_mark')) { /** * Function for adding New Product Template * * @return string */ function trackstore_elated_woocommerce_new_product_mark() { global $product; $product_id = $product->get_id(); if (get_post_meta($product_id, 'eltd_single_product_new_meta', true) === 'yes') { print '<span class="eltd-new-product">' . esc_html__('New', 'trackstore') . '</span>'; } } } if (!function_exists('trackstore_elated_woocommerce_cart_title')) { function trackstore_elated_woocommerce_cart_title(){ print '<h3>'.esc_html__('Added to bag','trackstore').'</h3>'; } } if (!function_exists('trackstore_elated_woocommerce_cart_back_to_home')) { function trackstore_elated_woocommerce_cart_back_to_home(){ echo trackstore_elated_get_button_html( array( 'type' => 'solid', 'size' => 'small', 'link' => get_permalink( wc_get_page_id( 'shop' ) ), 'text' => esc_html__('Back To Shop', 'trackstore'), 'icon_pack' => 'font_awesome', 'fa_icon' => 'fa fa-chevron-left', 'icon_position'=> 'left', 'icon_size' => '12', 'custom_class' => 'eltd-cart-go-back' ) ); } } if (!function_exists('trackstore_elated_woocommerce_empty_cart_text')) { function trackstore_elated_woocommerce_empty_cart_text(){ print '<div class="eltd-empty-cart-image-holder">'; if ( trackstore_elated_options()->getOptionValue( 'eltd_woo_empty_cart_image' ) !== "" ) { echo '<img src="' . trackstore_elated_options()->getOptionValue( 'eltd_woo_empty_cart_image' ) .'"/>'; } else { echo '<img src="' . ELATED_ASSETS_ROOT . '/img/empty-cart.png' .'"/>'; } print '</div>'; print '<p class="cart-empty">' . apply_filters( 'wc_empty_cart_message', __( 'Your cart is empty', 'trackstore' ) ) . '</p>'; print '<p>'.esc_html__('Why not return to our amazing shop and start filling it with products. Just click on the button below to instantly get back to the shop page. Oh, and while you are there, check out all of our mind-blowing discounts.','trackstore').'</p>'; } } if (!function_exists('trackstore_elated_woocommerce_template_loop_add_to_cart')) { /** * Function for adding woo button to list * * @return string */ function trackstore_elated_woocommerce_template_loop_add_to_cart() { global $product; $product_id = $product->get_id(); $product_type = $product->get_type(); if (!$product->is_in_stock()) { $button_classes = 'button ajax_add_to_cart eltd-button read_more_button'; } else if ($product->get_type() === 'variable') { $button_classes = 'button product_type_variable add_to_cart_button eltd-button'; } else if ($product->get_type() === 'external') { $button_classes = 'button product_type_external eltd-button'; } else { $button_classes = 'button add_to_cart_button ajax_add_to_cart eltd-button'; } ?> <div class="eltd-pl-add-to-cart"> <?php echo apply_filters( 'woocommerce_loop_add_to_cart_link', sprintf( '<a rel="nofollow" href="%s" data-quantity="%s" data-product_id="%s" data-product_sku="%s" class="%s"><span class="eltd-add-to-cart-button-icon ion-ios-cart"></span>%s</a>', esc_url( $product->add_to_cart_url() ), esc_attr( isset( $quantity ) ? $quantity : 1 ), esc_attr( $product->get_id() ), esc_attr( $product->get_sku() ), esc_attr( $button_classes ), esc_html( $product->add_to_cart_text() ) ), $product ); ?> </div> <?php } } if (!function_exists('trackstore_elated_woocommerce_shop_loop_categories')) { /** * Function that prints html with product categories */ function trackstore_elated_woocommerce_shop_loop_categories(){ global $product; $html = '<div class="eltd-pl-categories">'; $html .= wc_get_product_category_list($product->get_id(), ', '); $html .= '</div>'; echo trackstore_elated_get_module_part($html); } } modules/woocommerce/templates/parts/rating.php 0000644 00000001106 15132740277 0015665 0 ustar 00 <?php if ($display_rating === 'yes' && get_option( 'woocommerce_enable_review_rating' ) !== 'no') { if(!isset($product)) { $product = trackstore_elated_return_woocommerce_global_variable(); } $average = $product->get_average_rating(); ?> <div class="eltd-<?php echo esc_attr($class_name); ?>-rating-holder"> <div class="eltd-<?php echo esc_attr($class_name); ?>-rating" title="<?php sprintf(esc_html_e("Rated %s out of 5", "trackstore"), $average ); ?>"> <span style="width: <?php echo esc_attr( ( $average / 5 ) * 100 ) . '%'; ?>"></span> </div> </div> <?php } ?>