Skip to content

Instantly share code, notes, and snippets.

Avatar

Bill Robbins billrobbins

View GitHub Profile
View increase-failure-rate.php
add_filter( 'automatewoo/batched_job_monitor/failure_rate_threshold', 'woo_set_custom_failure_rate' );
function woo_set_custom_failure_rate ($threshold ) {
return 10000;
}
View change-bookings-in-cart-expiration-time.php
// Changes the amount of time a WooCommerce Booking can remain in the cart before it is removed. Time is in minutes.
function ijab_change_inactive_cart_bookings_time() {
return 5;
}
add_filter( 'woocommerce_bookings_remove_inactive_cart_time', 'ijab_change_inactive_cart_bookings_time' );
View search-order-numbers-only.php
<?php
function ijab_woo_remove_order_meta_search() {
return;
}
add_filter( 'woocommerce_shop_order_search_fields', 'ijab_woo_remove_order_meta_search' );
View fb-file-url.php
function sv_facebook_feed_url_admin_notice(){
if ( class_exists( 'WC_Facebook_Product_Feed' ) ) {
$feed_file_url = class_exists( 'SkyVerge\WooCommerce\Facebook\Products\Feed' ) ? get_bloginfo( 'url' ) . '/?wc-api=wc_facebook_get_feed_data&secret=' . SkyVerge\WooCommerce\Facebook\Products\Feed::get_feed_secret() : '';
if ( ( isset( $_GET['page'], $_GET['tab'], $_GET['section'] ) &&
( 'wc-settings' == $_GET['page'] && 'integration' == $_GET['tab'] &&
'facebookcommerce' == $_GET['section'] ) ) ||
( isset( $_GET['page'] ) && 'wc-facebook' == $_GET['page'] ) ) {
View storefront-per-section.php
add_action( 'customize_register', 'jp_override_storefront_powerpack', 21 );
/**
* @param WP_Customize_Manager $wp_customizer
*/
function jp_override_storefront_powerpack( $wp_customizer ) {
$controls = array(
'sp_homepage_featured_products_limit',
'sp_homepage_top_rated_products_limit',
'sp_homepage_on_sale_products_limit',
'sp_homepage_recent_products_limit',
View add-puerto-rico-states-list.php
<?php
add_filter( 'woocommerce_states', 'ijab_add_puerto_rico_wc_states' );
function ijab_add_puerto_rico_wc_states( $states ) {
$states['US'] = array(
'AL' => __( 'Alabama', 'woocommerce' ),
'AK' => __( 'Alaska', 'woocommerce' ),
'AZ' => __( 'Arizona', 'woocommerce' ),
'AR' => __( 'Arkansas', 'woocommerce' ),
View selectively-enable-gateway.php
// This function disables the Stripe gateway everywhere except for the order-pay endpoint.
// It also removes the Check gateway from the order-pay endpoint.
function ijab_selected_gateways_order_pay( $available_gateways ) {
if ( is_checkout() && ! is_wc_endpoint_url( 'order-pay' ) ) {
unset( $available_gateways[ 'stripe' ] );
}
if ( is_checkout() && is_wc_endpoint_url( 'order-pay' ) ) {
View payfast_filter.php
add_filter( 'woocommerce_gateway_payfast_is_valid_ip', '__return_true' );
View bypass.php
function woohe_forcelogin_bypass( $bypass ) {
if ( is_wc_endpoint_url( 'lost-password' ) ) {
$bypass = true;
}
return $bypass;
}
add_filter( 'v_forcelogin_bypass', 'woohe_forcelogin_bypass' );
View meta.php
<?php $ih_sc = $product->get_shipping_class(); ?>
<?php /* <?php if($ih_sc === 'level-iv') : ?>
<p style="color: #666666;"><small><i>*Delivery Surcharge: $150</i></small></p>
<?php elseif($ih_sc === 'level-v') : ?>
<p style="color: #666666;"><small><i>*Delivery Surcharge: $150</i></small></p> */ ?>
<?php if($ih_sc === 'level-vi') : ?>
<p style="color: #666666;"><small><i>*Delivery Surcharge: $150</i></small></p>
<?php elseif($ih_sc === 'level-vii') : ?>
<p style="color: #666666;"><small><i>*Delivery Surcharge: $150</i></small></p>