This file contains 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
<?php | |
/** | |
* Filter global role-based discounts | |
*/ | |
function prefix_role_pricing_rules( $rules, $product=false ) { | |
if( ! $product ) { | |
return $rules; | |
} | |
This file contains 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
<?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 ); |
This file contains 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
<?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 ); |
This file contains 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
<?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 ); |
This file contains 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
.pewc-field-104 { | |
display: none; | |
} |
This file contains 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
<?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' ); |
This file contains 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
<?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 ); |
This file contains 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
<?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; | |
} |
This file contains 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
<?php | |
/** | |
* Filter exact children validation notice | |
*/ | |
function prefix_exact_children_validation_notice( $notice, $label, $min_products ) { | |
$notice = sprintf( | |
__( '%s requires you to choose %s products', 'pewc' ), | |
esc_html( $label ), | |
$min_products |
This file contains 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
<?php | |
/** | |
* Populate products field using SKUs from ACF field | |
* Create an ACF field with the name child_product_skus | |
* Enter the SKUs of the child products into this field as a comma-separated list | |
*/ | |
function prefix_populate_products_through_ACF( $item, $group, $group_id, $post_id ) { | |
// Check ACF is active | |
if( ! function_exists( 'get_field' ) ) { |