Submit
Path:
~
/
home
/
getwphos
/
public_html
/
ppine
/
wp-content
/
plugins
/
ti-woocommerce-wishlist
/
integrations
/
File Content:
theme-flatsome.php
<?php /** * TI WooCommerce Wishlist integration with: * * @name Flatsome * * @version 3.13.1 * * @slug flatsome * * @url http://flatsome.uxthemes.com/ * */ // If this file is called directly, abort. if ( ! defined( 'ABSPATH' ) ) { exit; } // Load integration depends on current settings. global $tinvwl_integrations; $slug = "flatsome"; $name = "Flatsome Theme"; $available = true; $tinvwl_integrations = is_array( $tinvwl_integrations ) ? $tinvwl_integrations : []; $tinvwl_integrations[ $slug ] = array( 'name' => $name, 'available' => $available, ); if ( ! tinv_get_option( 'integrations', $slug ) ) { return; } if ( ! $available ) { return; } add_action( 'after_setup_theme', 'tinvwl_flatsome' ); function tinvwl_flatsome() { if ( ! class_exists( 'Flatsome_Default' ) ) { return; } // Catalog mode if ( ! function_exists( 'tinvwl_flatsome_init' ) ) { /** * Run hooks after theme init. */ function tinvwl_flatsome_init() { if ( get_theme_mod( 'catalog_mode' ) ) { add_filter( 'tinvwl_allow_addtowishlist_single_product_summary', 'tinvwl_flatsome_woocommerce_catalog_mode', 10, 2 ); switch ( tinv_get_option( 'add_to_wishlist', 'position' ) ) { case 'before': add_action( 'woocommerce_single_variation', 'tinvwl_view_addto_html', 10 ); break; case 'after': add_action( 'woocommerce_single_variation', 'tinvwl_view_addto_html', 20 ); break; } add_action( 'woocommerce_single_variation', 'tinvwl_tinvwl_flatsome_woocommerce_catalog_mode_variable', 20 ); } } add_action( 'init', 'tinvwl_flatsome_init' ); } if ( ! function_exists( 'tinvwl_tinvwl_flatsome_woocommerce_catalog_mode_variable' ) ) { /** * Output variation hidden field. * */ function tinvwl_tinvwl_flatsome_woocommerce_catalog_mode_variable() { echo '<input type="hidden" name="variation_id" class="variation_id" value="0" />'; } } if ( ! function_exists( 'tinvwl_flatsome_woocommerce_catalog_mode' ) ) { /** * Output wishlist button for Flatsome catalog mode * * @param bool $allow allow output. * * @return bool */ function tinvwl_flatsome_woocommerce_catalog_mode( $allow, $product ) { if ( ! $product->is_type( 'variable' ) ) { return true; } return $allow; } } // Header wishlist counter if ( ! function_exists( 'tinvwl_flatsome_header_wishlist' ) ) { /** * Header Wishlist element * * @param $elements * * @return mixed */ function tinvwl_flatsome_header_wishlist( $elements ) { $elements['wishlist'] = __( 'Wishlist', 'ti-woocommerce-wishlist' ); return $elements; } } add_filter( 'flatsome_header_element', 'tinvwl_flatsome_header_wishlist' ); if ( ! function_exists( 'tinvwl_flatsome_refresh_wishlist_partials' ) ) { function tinvwl_flatsome_refresh_wishlist_partials( WP_Customize_Manager $wp_customize ) { // Abort if selective refresh is not available. if ( ! isset( $wp_customize->selective_refresh ) ) { return; } $wp_customize->selective_refresh->add_partial( 'header-wishlist', array( 'selector' => '.header-wishlist-icon', 'container_inclusive' => true, 'settings' => array( 'wishlist_title', 'wishlist_icon', 'wishlist_title', 'wishlist_icon_style', 'header_wishlist_label' ), 'render_callback' => tinvwl_flatsome_render_header_wishlist(), ) ); } } add_action( 'customize_register', 'tinvwl_flatsome_refresh_wishlist_partials' ); $transport = 'postMessage'; if ( ! isset( $wp_customize->selective_refresh ) ) { $transport = 'refresh'; } $image_url = get_template_directory_uri() . '/inc/admin/customizer/img/'; Flatsome_Option::add_section( 'header_wishlist', array( 'title' => __( 'Wishlist', 'ti-woocommerce-wishlist' ), 'panel' => 'header', 'priority' => 110, ) ); Flatsome_Option::add_field( 'option', array( 'type' => 'select', 'settings' => 'wishlist_icon', 'label' => __( 'Wishlist Icon', 'ti-woocommerce-wishlist' ), 'transport' => $transport, 'section' => 'header_wishlist', 'default' => 'heart', 'choices' => array( '' => "None", "heart" => "Heart (Default)", "heart-o" => "Heart Outline", "star" => "Star", "star-o" => "Star Outline", "menu" => "List", "pen-alt-fill" => "Pen", ), ) ); Flatsome_Option::add_field( 'option', array( 'type' => 'radio-image', 'settings' => 'wishlist_icon_style', 'label' => __( 'Wishlist Icon Style', 'ti-woocommerce-wishlist' ), 'section' => 'header_wishlist', 'transport' => $transport, 'default' => '', 'choices' => array( '' => $image_url . 'icon-plain.svg', 'outline' => $image_url . 'icon-outline.svg', 'fill' => $image_url . 'icon-fill.svg', 'fill-round' => $image_url . 'icon-fill-round.svg', 'outline-round' => $image_url . 'icon-outline-round.svg', ), ) ); Flatsome_Option::add_field( 'option', array( 'type' => 'checkbox', 'settings' => 'wishlist_title', 'label' => __( 'Show Wishlist Title', 'ti-woocommerce-wishlist' ), //'description' => __( 'This is the control description', 'ti-woocommerce-wishlist' ), //'help' => __( 'This is some extra help. You can use this to add some additional instructions for users. The main description should go in the "description" of the field, this is only to be used for help tips.', 'ti-woocommerce-wishlist' ), 'section' => 'header_wishlist', 'transport' => $transport, 'default' => 1, ) ); Flatsome_Option::add_field( 'option', array( 'type' => 'text', 'settings' => 'header_wishlist_label', 'label' => __( 'Custom Title', 'ti-woocommerce-wishlist' ), 'section' => 'header_wishlist', 'transport' => $transport, 'default' => '', ) ); function tinvwl_flatsome_render_header_wishlist() { $icon = get_theme_mod( 'wishlist_icon', flatsome_defaults( 'wishlist_icon' ) ); $icon_style = get_theme_mod( 'wishlist_icon_style', flatsome_defaults( 'wishlist_icon_style' ) ); ob_start(); ?> <li class="header-wishlist-icon"> <?php if ( $icon_style ) { ?> <div class="header-button"><?php } ?> <a href="<?php echo tinv_url_wishlist_default(); ?>" class="wishlist-link <?php echo get_flatsome_icon_class( $icon_style, 'small' ); ?>"> <?php if ( get_theme_mod( 'wishlist_title', flatsome_defaults( 'wishlist_title' ) ) ) { ?> <span class="hide-for-medium header-wishlist-title"> <?php if ( get_theme_mod( 'header_wishlist_label', flatsome_defaults( 'header_wishlist_label' ) ) ) { echo get_theme_mod( 'header_wishlist_label', flatsome_defaults( 'header_wishlist_label' ) ); } else { _e( 'Wishlist', 'ti-woocommerce-wishlist' ); } ?> </span> <?php } ?> <?php if ( $icon ) { ?> <i class="wishlist-icon icon-<?php echo $icon; ?>" <?php $class = TInvWL_Public_WishlistCounter::instance(); $counter = $class->get_counter(); if ( $counter > 0 ){ ?>data-icon-label="<?php echo $counter; ?>" <?php } ?>> </i> <?php } ?> </a> <?php if ( $icon_style ) { ?> </div> <?php } ?> </li> <?php return ob_get_clean(); } add_action( 'flatsome_header_elements', 'tinvwl_flatsome_hook_header_element' ); function tinvwl_flatsome_hook_header_element( $value ) { if ( 'wishlist' === $value ) { echo tinvwl_flatsome_render_header_wishlist(); } } // Add to wishlist button if ( ! function_exists( 'tinvwl_flatsome_product_wishlist_button' ) ) { /** * Add wishlist Button to Product Image */ function tinvwl_flatsome_product_wishlist_button() { $icon = get_theme_mod( 'wishlist_icon', 'heart' ); if ( ! $icon ) { $icon = 'heart'; } ?> <div class="wishlist-icon"> <button class="wishlist-button button is-outline circle icon" aria-label="<?php echo __( 'Wishlist', 'ti-woocommerce-wishlist' ); ?>"> <?php echo get_flatsome_icon( 'icon-' . $icon ); ?> </button> <div class="wishlist-popup dark <?php echo tinv_get_option( 'add_to_wishlist', 'show_text' ) ? '' : 'hidden'; ?>"> <?php echo do_shortcode( '[ti_wishlists_addtowishlist]' ); ?> </div> </div> <?php } } add_action( 'flatsome_product_image_tools_top', 'tinvwl_flatsome_product_wishlist_button', 2 ); if ( ! function_exists( 'tinvwl_flatsome_product_wishlist_button_loop' ) ) { /** * Add wishlist Button to Product Image */ function tinvwl_flatsome_product_wishlist_button_loop() { $icon = get_theme_mod( 'wishlist_icon', 'heart' ); if ( ! $icon ) { $icon = 'heart'; } ?> <div class="wishlist-icon"> <button class="wishlist-button button is-outline circle icon" aria-label="<?php echo __( 'Wishlist', 'ti-woocommerce-wishlist' ); ?>"> <?php echo get_flatsome_icon( 'icon-' . $icon ); ?> </button> <div class="wishlist-popup dark <?php echo tinv_get_option( 'add_to_wishlist_catalog', 'show_text' ) ? '' : 'hidden'; ?>"> <?php echo do_shortcode( '[ti_wishlists_addtowishlist loop="yes"]' ); ?> </div> </div> <?php } } if ( tinv_get_option( 'add_to_wishlist_catalog', 'show_in_loop' ) ) { add_action( 'flatsome_product_box_tools_top', 'tinvwl_flatsome_product_wishlist_button_loop', 2 ); } function tinv_add_to_wishlist_flatsome() { wp_add_inline_script( 'tinvwl', " jQuery(document).ready(function($){ $('body').on('click', '.wishlist-button', function (e) { $(this).addClass('loading'); jQuery(this).parent().find('a.tinvwl_add_to_wishlist_button').click(); e.preventDefault(); }); }); jQuery('body').on('tinvwl_wishlist_mark_products tinvwl_modal_closed', function(e, data){ jQuery('.wishlist-button').removeClass('wishlist-added loading'); }); jQuery('body').on('tinvwl_wishlist_product_marked', function(e, el,status){ jQuery(el).closest('div.wishlist-icon').find('.wishlist-button').toggleClass('wishlist-added', status); }); " ); } add_action( 'wp_enqueue_scripts', 'tinv_add_to_wishlist_flatsome', 100, 1 ); }
Edit
Rename
Chmod
Delete
FILE
FOLDER
Name
Size
Permission
Action
automatewoo
---
0755
advanced-product-fields-for-woocommerce-pro.php
6928 bytes
0644
advanced-product-fields-for-woocommerce.php
8536 bytes
0644
automatewoo.php
3463 bytes
0644
buy-now-button-for-woocommerce.php
1454 bytes
0644
check-pincodezipcode-for-shipping-woocommerce.php
1539 bytes
0644
cleantalk-spam-protect.php
1618 bytes
0644
clever-swatches.php
2543 bytes
0644
comet-cache.php
1552 bytes
0644
duracelltomi-google-tag-manager.php
1613 bytes
0644
elex-woocommerce-catalog-mode.php
2410 bytes
0644
gift-cards-for-woocommerce.php
4936 bytes
0644
hide-price-add-to-cart-button.php
14710 bytes
0644
improved-variable-product-attributes.php
5226 bytes
0644
ione360-configurator.php
4486 bytes
0644
litespeed-cache.php
2489 bytes
0644
mycred.php
11264 bytes
0644
nasa-core.php
1500 bytes
0644
product-extras-for-woocommerce.php
13123 bytes
0644
product-quantity-for-woocommerce.php
2165 bytes
0644
pw-woocommerce-gift-cards.php
3634 bytes
0644
shopengine.php
4763 bytes
0644
show-single-variations.php
1209 bytes
0644
sitepress-multilingual-cms.php
2549 bytes
0644
theme-divi.php
1571 bytes
0644
theme-flatsome.php
10579 bytes
0644
theme-kallyas.php
1191 bytes
0644
theme-oceanwp.php
1319 bytes
0644
wc-fields-factory.php
12629 bytes
0644
woo-advanced-qty.php
2585 bytes
0644
woo-payment-gateway.php
1715 bytes
0644
woo-variation-swatches-pro.php
2040 bytes
0644
woo-variations-table-grid.php
2796 bytes
0644
woocommerce-booking.php
3308 bytes
0644
woocommerce-bookings.php
6014 bytes
0644
woocommerce-composite-products.php
17755 bytes
0644
woocommerce-custom-fields.php
4953 bytes
0644
woocommerce-fast-cart.php
1690 bytes
0644
woocommerce-gravityforms-product-addons.php
14869 bytes
0644
woocommerce-mix-and-match-products.php
7322 bytes
0644
woocommerce-multilingual.php
9075 bytes
0644
woocommerce-rental-and-booking.php
9858 bytes
0644
woocommerce-square.php
1429 bytes
0644
woocommerce-tm-extra-product-options.php
14660 bytes
0644
woocommerce-waitlist.php
1561 bytes
0644
wp-fastest-cache.php
2948 bytes
0644
wp-grid-builder.php
2812 bytes
0644
wp-multilang.php
1865 bytes
0644
wp-rocket.php
4972 bytes
0644
wpc-variations-radio-buttons.php
1570 bytes
0644
yith-woocommerce-product-bundles.php
6780 bytes
0644
yith-woocommerce-quick-view.php
1395 bytes
0644
N4ST4R_ID | Naxtarrr