This file contains hidden or 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
class WC_Wishlists_Account_Endpoint { | |
private static $instance; | |
public static function register($endpoint_slug, $endpoint_name) { | |
if ( self::$instance == null ) { | |
self::$instance = new WC_Wishlists_Account_Endpoint($endpoint_slug, $endpoint_name); | |
} | |
} | |
protected $endpoint_slug; |
This file contains hidden or 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
add_filter( 'gform_delete_lead', function ( $lead_id ) { | |
if ( function_exists( 'gf_signature' ) ) { | |
$lead = RGFormsModel::get_lead( $lead_id ); | |
$form = RGFormsModel::get_form_meta( $lead['form_id'] ); | |
if ( !is_array( $form['fields'] ) ) { | |
return; | |
} |
This file contains hidden or 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
function wc_swatches_shop_loop_item_href( $product, $attribute_name, $attribute_value ) { | |
$url = add_query_arg( array( | |
$attribute_name => $attribute_value | |
), $product->get_permalink() ); | |
return $url; | |
} | |
This file contains hidden or 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
class WC_Custom_Dynamic_Pricing_Context { | |
/** | |
* @var WC_Custom_Dynamic_Pricing_Context | |
*/ | |
private static $instance; | |
/** | |
* Helper to bootstrap the class. | |
*/ | |
public static function register() { |
This file contains hidden or 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
class WC_Dynamic_Pricing_Product_Attribute_Adjustments { | |
private static $instance; | |
public static function register( $product_attribute, $label ) { | |
if ( self::$instance == null ) { | |
self::$instance = []; | |
} | |
if ( ! isset( self::$instance[ $product_attribute ] ) ) { |
This file contains hidden or 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
add_filter( 'gform_delete_lead', function ( $lead_id ) { | |
if ( function_exists( 'gf_signature' ) ) { | |
$lead = RGFormsModel::get_lead( $lead_id ); | |
$form = RGFormsModel::get_form_meta( $lead['form_id'] ); | |
if ( ! is_array( $form['fields'] ) ) { | |
return; |
This file contains hidden or 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
class ES_GravityForms_Grouped_Product_Add_To_Cart_Handler { | |
private static $instance; | |
public static function register() { | |
if ( self::$instance == null ) { | |
self::$instance = new ES_GravityForms_Grouped_Product_Add_To_Cart_Handler(); | |
} | |
} |
This file contains hidden or 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
add_action( 'wp_footer', function () { | |
if ( ! class_exists( 'WC_Dynamic_Pricing_Table' ) ) { | |
return; | |
} | |
$instance = WC_Dynamic_Pricing_Table::instance(); | |
$array_rule_sets = $instance->get_pricing_array_rule_sets(); | |
$json_prices = array(); |
This file contains hidden or 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
add_filter( 'woocommerce_dynamic_pricing_process_product_discounts', 'is_product_eligible', 10, 4 ); | |
function is_product_eligible( $eligible, $product, $discounter_name, $discounter_object ) { | |
//Be sure to change this to your product(s) you want to exclude. | |
$exclude_products = array( | |
320, | |
401, | |
100 | |
); |
This file contains hidden or 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
function custom_catalog_visibility_user_can_view_price( $can_view_price, $product ) { | |
//Set to true so everyone can purchase. | |
if ($can_view_price) { | |
return $can_view_price; | |
} | |
if ( current_user_can( 'retail' ) ) { | |
//User is retail user, set prices to false. | |
$can_view_price = true; | |
} |