Skip to content

Instantly share code, notes, and snippets.

@Nicscott01
Nicscott01 / gist:3284a8731d3dd918463579f77b43a81a
Last active November 2, 2023 15:01
Better Way to Do WooCommerce Smart Coupon Add to Cart/Select Options button
add_action( 'init', function() {
//Saftey check
if ( !class_exists( 'WC_SC_Display_Coupons' ) ) {
return;
}
$WC_SC_Display_Coupons = WC_SC_Display_Coupons::get_instance();
remove_action( 'woocommerce_after_shop_loop_item', array( $WC_SC_Display_Coupons, 'remove_add_to_cart_button_from_shop_page' ) );
@Nicscott01
Nicscott01 / gist:7f506e1196d12d2544dc034883e1fe9c
Created November 2, 2023 14:16
Fix Smart Coupons with WooCommerce on Breakdance
/**
* Change the Action that Smart Coupons
* uses to output it's select options button
* and remove the add to cart button
*
*/
<?php
class ClassName {
/**
* Instance
*/
public static $instance = null;
<?php
/**
* Additions to the Product Add-on Plugins
*
* Enables us to add a product taxonomy to the
* addon so we can further refine where it
* is displayed
*
*
@Nicscott01
Nicscott01 / gist:ac1d50ec61c4e8d538e365edc6224fbc
Created March 5, 2020 21:57
wih_member_registration_gists
* Auto-fill email of logged-in user
* who is trying to become a member
*
* @added 3/5/2020
*/
add_filter( 'gform_field_value', 'user_upgrade_fields', 10, 3 );
function user_upgrade_fields( $value, $Field, $name ) {
@Nicscott01
Nicscott01 / facetwp_facet_render_args.php
Created January 17, 2020 14:15
Filter facets before rendered
/**
* Remove taxonomy terms that aren't a parent/child of the current page
*
*
*
*/
public function facetwp_facet_render_args( $args ) {