Skip to content

Instantly share code, notes, and snippets.

View ejntaylor's full-sized avatar
🚢
Shipping

Elliot ejntaylor

🚢
Shipping
View GitHub Profile
@ejntaylor
ejntaylor / functions.php
Created November 3, 2014 14:20
Translate WooCommerce Text
<?php
// Cart - Basket Text
function wpa_change_my_basket_text( $translated_text, $text, $domain ){
if( $domain == 'woothemes' && $translated_text == 'Cart:' )
$translated_text = 'Basket:';
return $translated_text;
}
@ejntaylor
ejntaylor / functions.php
Last active October 2, 2015 01:36
Add Canvas Business Slider to any page with any slide group
<?php
// Display the "Business" slider above the default WordPress homepage.
add_action( 'get_header', 'woo_custom_load_biz_slider', 10 );
function woo_slider_biz_new() {
$args = array(
'slide_page' => 394,
'use_slide_page' => true
add_action ('template_redirect','hide_fe');
function hide_fe() {
if (!is_admin()) {
wp_redirect(admin_url('/', 'http'), 301);
}
@ejntaylor
ejntaylor / functions.php
Created September 17, 2014 15:12
WooCommerce Shipping Calculated after Coupon
<?php
// WooCommerce Shipping Calculated after Coupon
add_filter( 'woocommerce_shipping_free_shipping_is_available', 'filter_shipping', 10, 2 );
function filter_shipping( $is_available, $package ) {
if ( WC()->cart->prices_include_tax )
$total = WC()->cart->cart_contents_total + array_sum( WC()->cart->taxes );
else
# END WordPress
AuthType Basic
AuthName "restricted area"
AuthUserFile /home/rstage/public_html/.htpasswd
require valid-user
//add placeholder for subscribe form
$(".widget_ns_mailchimp input").focus(function(){
showEmptyLabels();
$(this).siblings("label").stop().fadeOut();
});
$(".widget_ns_mailchimp input").blur(function(){
showEmptyLabels();
});
$(".widget_ns_mailchimp label").bind("click", function() {
$(this).siblings("div").find("input, textarea").focus();
<?php
public function save_settings() {
if( isset($_REQUEST["{$this->prefix}_setting"]) && check_admin_referer("save_{$this->prefix}_settings","{$this->prefix}_save") ) {
$new_settings = $_REQUEST["{$this->prefix}_setting"];
foreach( $new_settings as $setting_name => $setting_value ) {
foreach( $setting_value as $type => $value ) {
echo '<br> t1 <br>';
if( is_array($value) ) {
<?php
// Settings
global $BambooPlugin; // we'll need this below
$default_plugins = $BambooPlugin->get_setting('req_plugins_arr','array');
@ejntaylor
ejntaylor / css.css
Last active August 29, 2015 13:58
Adds Top Menu toggle for Woo Canvas and Uber Menu
/* Responsive Top Nav Toggle */
#responsive-icons {
position: absolute; right: 0px; top:10px; z-index: 5000; font-size: 30px;
}
#responsive-icons a {
margin-right: 10px;
}
@ejntaylor
ejntaylor / Products per row
Last active April 11, 2018 12:58
Upsells / Related Product Product Quantity and Columns
http://docs.woothemes.com/document/change-number-of-products-per-row/