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
RewriteEngine On | |
RewriteCond %{HTTPS} !on | |
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} |
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
// Sort by stock on front end | |
add_filter( 'woocommerce_get_catalog_ordering_args', 'custom_woocommerce_get_catalog_ordering_args' ); | |
function custom_woocommerce_get_catalog_ordering_args( $args ) { | |
$orderby_value = isset( $_GET['orderby'] ) ? woocommerce_clean( $_GET['orderby'] ) : apply_filters( 'woocommerce_default_catalog_orderby', get_option( 'woocommerce_default_catalog_orderby' ) ); | |
if ( 'stock' == $orderby_value ) { | |
$args['orderby'] = 'meta_value'; | |
$args['order'] = 'asc'; | |
$args['meta_key'] = '_stock_status'; | |
} |
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
jQuery(document).ready(function($){ | |
var isDevice = /Mobile|webOs|iPad|IEMobile|Windows Phone/.test(navigator.userAgent); | |
if (isDevice) { | |
jQuery('.mobile-menu-button').unbind('click').toggle(function (){ | |
jQuery('.responsive-menu').show().animate({right:'0'},300); | |
jQuery('.ib-overlay').css('display','block'); | |
jQuery('body').css('overflow','hidden'); | |
}, function (){ | |
jQuery('.responsive-menu').animate({right:'-260px'},300); | |
jQuery('.ib-overlay').hide(); |
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 | |
/** | |
* Custom Loop Add to Cart. | |
* | |
* Template with quantity and ajax. | |
*/ | |
if (!defined('ABSPATH')) | |
exit; // Exit if accessed directly. | |
global $product; |
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
jQuery(document).ready(function($){ | |
$('.cart input[type="number"]').on('change', function(){ | |
$(this).parent().parent().find('button[data-quantity]').attr('data-quantity', parseInt($(this).val())); | |
}); | |
jQuery.fn.disableSelection = function() { | |
return this | |
.attr('unselectable', 'on') | |
.css('user-select', 'none') | |
.on('selectstart', 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
add_filter( 'woocommerce_get_availability', 'wcs_custom_get_availability', 1, 2); | |
function wcs_custom_get_availability( $availability, $_product ) { | |
// Change Out of Stock Text | |
if ( ! $_product->is_in_stock() ) { | |
$availability['availability'] = __('Currently Unavailable', 'woocommerce'); | |
} | |
return $availability; |
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
/* Term ID - 10 */ | |
add_filter( 'pre_get_posts', 'hide_out_of_stock_from_cat' ); | |
function hide_out_of_stock_from_cat( $query ) { | |
if ( $query->is_tax( 'product_cat', 10 ) && $query->is_main_query() ) { | |
$query->set( 'meta_query', array(array( | |
'key' => '_stock_status', | |
'value' => 'outofstock', | |
'compare' => 'NOT IN' | |
))); |
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
.pp-content-grid-post { | |
font-size: 14px; | |
} | |
.pp-content-grid-post-image { | |
padding: 0; | |
position: relative; | |
} | |
.pp-content-grid-post-image a img { | |
filter: saturate(1.6) contrast(1.1); | |
opacity: 1; |
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
jQuery.fn.getSubHtml = function( startHtml, endHtml, node ) { | |
var $this = jQuery(this); | |
var $html = $this.html(); | |
startHtml = startHtml.replace( /<\//g, '<\\/' ).trim(); | |
endHtml = endHtml.replace( /<\//g, '<\\/' ).trim(); | |
var startHtmlRegEx = new RegExp( startHtml ); | |
var endHtmlRegEx = new RegExp( endHtml ); |
OlderNewer