This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* attaches a click even to a div that selects all of a checkbox facets available options and triggers a refresh | |
* change "product_categories" to the name of your facet | |
* <div class="facetwp-checkbox select-all">Select all</div> creates a div that looks like facet checkboxes | |
* | |
*/ | |
add_action( 'wp_head', function() { ?> | |
<script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
** set option to disable fselect search field | |
**/ | |
add_action( 'wp_footer', function() { ?> | |
<script> | |
(function($) { | |
FWP.hooks.addFilter('facetwp/set_options/fselect', function(opts, facet) { | |
if (facet.facet_name == 'product_categories') { | |
opts.showSearch = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
** enable filtering on load of map | |
**/ | |
add_action( 'wp_footer', function() { | |
?> | |
<script> | |
(function($) { | |
$(document).on('facetwp-loaded', function() { | |
var filterButton = $( ".facetwp-map-filtering" ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
(function($) { | |
$(function() { | |
if ( 'undefined' !== typeof FWP ) { | |
// Make checkbox options semi-transparent | |
FWP.loading_handler = function(params) { | |
params.element.find('.facetwp-checkbox').css('opacity', 0.5); | |
} | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'wp_footer', function() { | |
?> | |
<script> | |
(function($) { | |
if ('object' !== typeof FWP) { | |
return; | |
} | |
$(function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** adds tooltips to slider handles | |
** https://refreshless.com/nouislider/slider-options/#section-tooltips | |
** note that you need an array even if you want true for both handles | |
**/ | |
add_action( 'wp_footer', function() { ?> | |
<script> | |
(function($) { | |
if ('object' != typeof FWP) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Pagination - Show numbered pagination for catalog pages | |
* | |
* This template can be overridden by copying it to yourtheme/woocommerce/loop/pagination.php. | |
* | |
* HOWEVER, on occasion WooCommerce will need to update template files and you | |
* (the theme developer) will need to copy the new files to your theme to | |
* maintain compatibility. We try to do this as little as possible, but it does | |
* happen. When this occurs the version of the template file will be bumped and |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( ! function_exists( 'woocommerce_catalog_ordering' ) ) { | |
/** | |
* Output facet sort box instead of woocommerce's | |
*/ | |
function woocommerce_catalog_ordering() { | |
echo facetwp_display( 'sort' ); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** appends your custom html before the facets output **/ | |
add_action( 'wp_head', function() { | |
?> | |
<script> | |
(function($) { | |
$(function() { | |
if ('object' != typeof FWP) { | |
return; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
$(document).on('click', '.post-item', function() { | |
var postid = $(this).attr('data-id'); | |
var markers = FWP_MAP.get_post_markers(postid); | |
$.each( markers, function( key, value ) { | |
google.maps.event.trigger(value, 'click'); | |
}); | |
}); | |
})(jQuery); |