Skip to content

Instantly share code, notes, and snippets.

.qty-discounted-price {
display: inline-block !important;
width: 30% !important;
position: absolute !important;
right: 80px !important;
}
.qty-percent-savings {
position: absolute !important;
right: 0 !important;
color: green !important;
<?php
/**
* Apply part payment before tax
*/
add_filter( 'wcdpp_apply_part_payment_before_tax', '__return_true' );
<?php
/**
* Filter global role-based discounts
*/
function prefix_role_pricing_rules( $rules, $product=false ) {
if( ! $product ) {
return $rules;
}
<?php
/**
* Get all bookings with an end date in a specified number of days time
*/
function prefix_get_bookings_ending() {
// How many days in advance should we send the email?
$days = 3;
$date = date( 'Y-m-d', strtotime( '+' . absint( $days ) . 'days' ) );
error_log( $date );
<?php
/**
* Rename product data tabs
*/
function woo_rename_tabs( $tabs ) {
$tabs['additional_information']['title'] = __( 'Product Data' );
return $tabs;
}
add_filter( 'woocommerce_product_tabs', 'woo_rename_tabs', 98 );
<?php
/**
* Remove product data tabs
*/
function woo_remove_product_tabs( $tabs ) {
unset( $tabs['additional_information'] );
return $tabs;
}
add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 );
.pewc-field-104 {
display: none;
}
<?php
/**
* Display the 'Force minimum price' setting
* This setting will be deprecated in a future version
* Please use https://pluginrepublic.com/wordpress-plugins/woocommerce-minimum-maximum-quantity-and-order/ instead
*/
add_filter( 'pewc_enable_minimum_price_option', '__return_true' );
<?php
/**
* Apply fixed discounts in Bookings for WooCommerce
*/
function prefix_discount_type( $type, $product_id ) {
return 'fixed';
}
add_filter( 'bfwc_discount_type', 'prefix_discount_type', 10, 2 );
<?php
/**
* Filter bulk discount rules by taxonomy instead of product category
*/
function prefix_validate_bulk_rule_taxonomy( $tax, $rule, $rule_id ) {
$tax = 'product_brand';
return $tax;
}