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( 'woocommerce_single_product_summary', 'wc_product_sold_count', 11 ); | |
function wc_product_sold_count() { | |
global $product; | |
$units_sold = get_post_meta( $product->id, 'total_sales', true ); | |
echo '<p>' . sprintf( __( 'Units Sold: %s', 'woocommerce' ), $units_sold ) . '</p>'; | |
} | |
?> |
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
#!/bin/bash | |
# Installation: | |
# Install the script in one of the folders in your PATH. Make sure it has execute permissions (i.e. chmod +x wp-install-core-sub-dir). | |
#Usage: | |
# $ mkdir mysite | |
# $ cd mysite |
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 the action setting | |
add_filter( 'wc_points_rewards_action_settings', 'points_rewards_newsletter_action_settings' ); | |
function points_rewards_newsletter_action_settings( $settings ) { | |
$settings[] = array( | |
'title' => __( 'Points earned for newsletter signup' ), | |
'desc_tip' => __( 'Enter the amount of points earned when a customer signs up for a newsletter via MailChimp.' ), |
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
$(window).on("scroll", function() { | |
var scrollHeight = $(document).height(); | |
var scrollPosition = $(window).height() + $(window).scrollTop(); | |
if ((scrollHeight - scrollPosition) / scrollHeight === 0) { | |
// when scroll to bottom of the page | |
} | |
}); |
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
<html> | |
<head> | |
<title>Scroll to bottom Detection</title> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> | |
<script type="text/javascript"> | |
var count=0; | |
$(document).ready(function(){ | |
SetValues(); | |
$(window).scroll(function(){ | |
//Will check if the user has reached bottom of a PAGE |
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
<? | |
///////////////////// | |
// slack2html | |
// by @levelsio | |
///////////////////// | |
// | |
///////////////////// | |
// WHAT DOES THIS DO? | |
///////////////////// | |
// |
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
/* dragging logic for nomadlist.com/dating */ | |
/* by @levelsio */ | |
/* MIT license */ | |
/* <dragging logic> */ | |
$('body').on('mousedown touchstart','.card',function(e) { | |
if(!currentCardUserId) return; | |
if($('card.match_card').is(':visible')) return; | |
if(typeof e.originalEvent.touches !=='undefined') { | |
/* touch device */ |
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 | |
/** | |
* Plugin Name: WooCommerce Prepare Notes Testing | |
* Plugin URI: https://woocommerce.com | |
* Description: Adds 3 new notes with layout: banner, thumbnail, and plain, OR sets all the notes to not deleted. | |
* Author: WooCommerce | |
* Domain Path: /test_notes | |
* Version: 0.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
<? | |
# MIT license, do whatever you want with it | |
# | |
# This is my invoice.php page which I use to make invoices that customers want, | |
# with their address on it and which are easily printable. I love Stripe but | |
# their invoices and receipts were too wild for my customers on Remote OK | |
# | |
require_once(__DIR__.'/../vendor/autoload.php'); |
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 //only copy this line if needed | |
/** | |
* Function filters the threshold for the amount of variables to load in the front end. | |
* | |
* @see https://woocommerce.wordpress.com/2015/07/13/improving-the-variations-interface-in-2-4/ | |
* @param int $threshold Default of 30 | |
* @return int 100 The new threshold. | |
*/ | |
function lets_increase_the_variation_threshold( $threshold ) { |