This file contains hidden or 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 statusChangeCallback(response) { | |
fbRegister(response); | |
} | |
jQuery('.register-button').on('click', function (e) { | |
e.preventDefault(); | |
ajaxRegister(); | |
}); |
This file contains hidden or 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
// Removes the WooCommerce filter, that is validating the quantity to be an int | |
remove_filter('woocommerce_stock_amount', 'intval'); | |
// Add a filter, that validates the quantity to be a float | |
add_filter('woocommerce_stock_amount', 'floatval'); |
This file contains hidden or 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
add_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_single_add_to_cart', 10 ); | |
/* In woocommerce/single-product/add-to-cart/variable.php file use "radio button" insead of "Select" tag | |
* Style the radio button with their "lable" to create "Switch" UI element. | |
* Something like that: */ | |
$unique_id = twentytwenty_unique_id(); | |
$unique_id = 'product_variations_div'. ($unique_id * rand(1, 999999)); | |
$terms = wc_get_product_terms( |
This file contains hidden or 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 mz_display_sub_cats() { | |
$object = get_queried_object(); | |
$current = $object->term_id; | |
echo '<div class="cats cats_filters d-flex flex-nowrap">'; | |
$class = ''; | |
if( $object->parent > 0 ) { |
This file contains hidden or 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
$('body').on('submit', '.product form', function (e) { | |
e.preventDefault(); | |
var productVariationID = $(this).find('.variations').length > 0 ? $(this).find('.variation_id').val() : null, | |
productID = $(this).find('[name="add-to-cart"]').val(), | |
productQty = $(this).find('input.qty').val(), | |
variationArray = {}, | |
productElm = $(this).closest('.product'); | |
This file contains hidden or 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
$('body').on('change keyup input', '.quantity_mini input', function () { | |
var qtyMiniWrapper = $(this).closest('.quantity_mini'), | |
qtyMiniUpdateBtn = qtyMiniWrapper.find('button.update'), | |
defaultQty = parseFloat(qtyMiniUpdateBtn.attr('data-default_qty')), | |
selectedQty = parseFloat($(this).val()); | |
if( defaultQty !== selectedQty ) { | |
qtyMiniUpdateBtn.fadeIn('350'); | |
} else { | |
qtyMiniUpdateBtn.fadeOut('350'); |
This file contains hidden or 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
add_filter( 'pre_get_posts','mz_search_posts_per_page' ); | |
// Alter search posts per page | |
function mz_search_posts_per_page($query) { | |
if ( $query->is_search ) { | |
$query->set( 'posts_per_page', '-1' ); | |
$query->set( 'post_type', 'product' ); | |
} | |
return $query; | |
} |
This file contains hidden or 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
// Removes the WooCommerce filter, that is validating the quantity to be an int | |
remove_filter('woocommerce_stock_amount', 'intval'); | |
// Add a filter, that validates the quantity to be a float | |
add_filter('woocommerce_stock_amount', 'floatval'); | |
add_filter( 'woocommerce_quantity_input_step', 'mz_woocommerce_quantity_input_step', 99, 2 ); | |
function mz_woocommerce_quantity_input_step($step, $product) { | |
// change the "step" based on $product |
This file contains hidden or 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 | |
/** | |
* @package Auto_Placeholder_Images | |
* @version 1.0.0 | |
*/ | |
/* | |
Plugin Name: Auto Placeholder For Broken Images | |
Plugin URI: https://www.webstorm.co.il/css-live-reload/ | |
Description: **FOR DEV USE ONLY** This plugin resolve broken layout when we work on local machine without all uploaded images up to date. Will replace the images with image placeholder via placeholder.com | |
Author: Moshe Harush |
This file contains hidden or 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 ( ! defined( 'ABSPATH' ) ) { | |
exit; // Exit if accessed directly | |
} | |
add_action('acf/init', 'ofert_acf_add_local_field_groups'); | |
function ofert_acf_add_local_field_groups() { | |
//$screen = get_current_screen(); |