Skip to content

Instantly share code, notes, and snippets.

@PavloBorysenko
PavloBorysenko / functions.php
Last active August 23, 2019 10:24
Code for compatibility of WOOF and Elementor. Paste in functions.php
add_action('elementor/widgets/widgets_registered', function($widgets_manager) { $widgets_manager->unregister_widget_type('wp-widget-woof_widget'); });
@PavloBorysenko
PavloBorysenko / front.js
Last active January 4, 2021 09:30
You need to make changes to the js file. file: path/to/domain/wp-content/plugins/woocommerce-products-filter/js/front.js 1. Finde function woof_init_toggles() and comment it. 2. Then add this function after the previous comment function:
function woof_init_toggles() {
jQuery('body').on('click','.woof_container_inner h4', function () {
if (jQuery(this).children().data('condition') == 'opened') {
jQuery(this).children().removeClass('woof_front_toggle_opened');
jQuery(this).children().addClass('woof_front_toggle_closed');
jQuery(this).children().data('condition', 'closed');
if (woof_toggle_type == 'text') {
jQuery(this).children().text(woof_toggle_closed_text);
} else {
jQuery(this).children().find('img').prop('src', woof_toggle_closed_image);
@PavloBorysenko
PavloBorysenko / functions.php
Created August 23, 2023 10:07
Example about how to show always ‘In Stock products only’ in the search results:
add_filter('woof_get_request_data', 'my_woof_get_request_data');
function my_woof_get_request_data($data){
$data['stock']='instock';
return $data;
}