Skip to content

Instantly share code, notes, and snippets.

Avatar

Bill Robbins billrobbins

View GitHub Profile
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>
View follow-ups.html
<p style="margin:0 0 16px;color:#505050;font-size:12px"><br><img src="https://weinbergstage.wpengine.com?data=b2lkPTMmZWlkPTY1MTEmdXNlcl9lbWFpbD1hZGFtQHRpbWVsaW5ldmlkZW8uY29tJnVzZXJfaWQ9Mg%3D&amp;fuepx=1" height="1" width="1" style="border:none;display:inline-block;font-size:14px;font-weight:bold;height:auto;outline:none;text-decoration:none;text-transform:capitalize;vertical-align:middle;margin-right:10px"></p>
View actions.php
/**
* An easy way to delete all unsent items in the queue.
*/
public static function process_queue_delete_all() {
if ( empty( $_REQUEST['fue_delete_all'] ) ) {
return;
}
if ( ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'bulk-items' ) ) {
wp_die( __( 'Are you sure you want to do this?', 'follow_up_emails' ) );
View controller.php
<?php
/**
* Class FUE_Admin_Controller
*
* Controller for the Admin Panel
*/
class FUE_Admin_Controller {
/**
* Register the menu items
@billrobbins
billrobbins / gettext_minmax_quantities.php
Last active Jan 14, 2019
Place the original text on the left of the => and the new text on the right.
View gettext_minmax_quantities.php
function change_deposit_text( $translated ) {
$text = array(
'The minimum order quantity for %s is %s - please increase the quantity in your cart.' => 'Ahh man, For %s you need a total of %s to order',
);
$translated = str_ireplace( array_keys($text), $text, $translated );
return $translated;
}
add_filter( 'gettext', 'change_deposit_text', 20 );
You can’t perform that action at this time.