Update: please note that I have since switched to using a set of bash scripts instead of poluting the Git repository with git svn
.
Author: Kaspars Dambis
kaspars.net / @konstruktors
protected function get_location_select_html( $object_id, $chosen_location = null, $product = null ) { | |
$object_type = $this->get_object_type(); | |
$enhanced_search = $this->use_enhanced_search(); | |
$field_name = wc_local_pickup_plus_shipping_method()->is_per_item_selection_enabled() ? '_pickup_location_id' : '_shipping_method_pickup_location_id'; | |
if ( $using_single_location = $this->get_product_pickup_location( $product ) ) { | |
$chosen_location = $using_single_location; | |
$using_single_location = true; | |
} elseif ( ! $chosen_location ) { |
<?php | |
add_action('admin_menu', 'add_custom_featured_product_link'); | |
function add_custom_featured_product_link() { | |
global $submenu; | |
$permalink = add_query_arg(array('post_type' => 'product','product_visibility' => 'featured'), admin_url('edit.php')); | |
$submenu['edit.php?post_type=product'][] = array( 'Featured Products', 'manage_options', $permalink ); | |
} |
<div id="stat-wrapper"> | |
<?php if ( have_rows( 'stats' ) ) : ?> | |
<?php $showitems = 2; $i = 0;$maincount = 0; ?> | |
<div class="col"> | |
<?php while ( have_rows( 'stats' ) ) : the_row(); ?> | |
<div class="stat stat-<?php echo $maincount; ?>"> | |
<?php if ( get_sub_field( 'stat_icon' ) ) { ?> | |
<img src="<?php the_sub_field( 'stat_icon' ); ?>" /> | |
<?php } ?> | |
<?php the_sub_field( 'stat_headline' ); ?> |
<?php | |
add_filter( 'woocommerce_bookings_in_date_range_query', 'wswp_filter_check_in_cart', 100, 1); | |
function wswp_filter_check_in_cart( $booking_ids ) { | |
foreach( $booking_ids as $key => $booking_id ) { | |
$booking = get_wc_booking( $booking_id ); | |
if ( $booking->has_status( 'in-cart' ) ) { | |
unset( $booking_ids[$key] ); | |
} |
jQuery(function($) { | |
var beforeButton = $("<i class='incr-button fa fa-minus-circle fa-2x' />"); | |
var beforeButtonClick = function() { | |
var input = $(this).next(); | |
input.val(new Number(input.val()) - 1); | |
} | |
var afterButton = $("<i class='incr-button fa fa-plus-circle fa-2x' />"); | |
var afterButtonClick = function() { | |
var input = $(this).prev(); | |
input.val(new Number(input.val()) + 1); |
Update: please note that I have since switched to using a set of bash scripts instead of poluting the Git repository with git svn
.
Author: Kaspars Dambis
kaspars.net / @konstruktors
add_action('init','run_my_query'); | |
function run_my_query() { | |
$todays_date = date("Y-m-d"); | |
if (get_transient("_query_run_".$todays_date)) | |
return; | |
set_transient("_query_run_".$todays_date,24 * HOUR_IN_SECONDS); | |
global $wpdb; | |
$query = "UPDATE wp_2_posts SET menu_order = '9999999' where id in (SELECT DISTINCT tr.object_id FROM wp_2_terms t, wp_2_term_taxonomy tt, wp_2_term_relationships tr WHERE (t.term_id = tt.term_id) AND (tt.term_taxonomy_id = tr.term_taxonomy_id) AND t.term_id = 1440)"; |
jQuery(function($) { | |
$("a.add_to_cart_button").after("<span class='item_cost_holder'></span>"); | |
$(".single_add_to_cart_button").after("<span id='item_cost_holder'></span>"); | |
$(".summary form.cart .quantity").remove(); | |
$(".wswp_id_numbers_field").keypress(function(event) { | |
if ( $(this).closest('li').find(".add_to_cart_button").length > 0) { | |
$(this).closest('li').find(".add_to_cart_button").hide(); | |
} | |
if(event.which != 8 && event.which != 32 && isNaN(String.fromCharCode(event.which))){ | |
event.preventDefault(); //stop character from entering input |
<?php | |
/** | |
* Plugin Name: Woocommerce Vendors Bookings Management | |
* Description: Allows vendors to manage their bookings in the frontend | |
* Version: 1.0.0 | |
* Author: Liam Bailey | |
* Author URI: http://webbyscots.com/ | |
* License: GNU General Public License v3.0 | |
* License URI: http://www.gnu.org/licenses/gpl-3.0.html | |
*/ |
<?php | |
/* | |
Plugin Name: Woocommerce Bookings Dropdown | |
Description: Swaps the date picker for a dropdown of dates | |
Version: 1.0.0 | |
Author: Webby Scots | |
Author URI: http://webbyscots.com/ | |
*/ | |
add_action('wp_ajax_wswp_refresh_dates','wswp_refresh_dates'); | |
add_action('wp_ajax_nopriv_wswp_refresh_dates','wswp_refresh_dates'); |