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
<?php | |
/** | |
* Enable text values from calculation lookup tables | |
*/ | |
add_filter( 'pewc_allow_text_calcs', '__return_true' ); |
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
<?php | |
/** | |
* Array of discount rates | |
*/ | |
function prefix_discount_rates( $rates, $product_id ) { | |
$excluded_ids = array( 1234 ); | |
if( in_array( $product_id, $excluded_ids ) ) { | |
return $rates; | |
} | |
$rates = 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
<?php | |
/** | |
* Ensure tax isn't added to options with 'value only' | |
*/ | |
function prefix_check_tax_for_option_price( $check, $option_price, $item ) { | |
if( ! empty( $item['option_price_visibility'] && $item['option_price_visibility'] == 'value' ) ) { | |
return false; | |
} | |
return $check; | |
} |
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
<?php | |
/** | |
* Filter Bookings discount rates | |
* This snippet allows you to set fixed prices for multiple tiers | |
* In the array below: | |
* rate refers to the fixed price per unit | |
* after refers to the number of units where the rate kicks in | |
* from set to 'all' to apply the rate to the entire booking price | |
*/ | |
function prefix_discount_rates( $rates, $product_id ) { |
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
/* Disable checkboxes */ | |
.pewc-group-checkbox .pewc-item-field-wrapper { | |
pointer-events: none; | |
} |
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
<?php | |
/** | |
* Display remaining quantity on Bookings page | |
*/ | |
function prefix_display_remaining_quantity() { | |
$remaining = bfwc_get_max_bookings( get_the_ID() ); | |
printf( | |
'Places remaining: %s', | |
$remaining | |
); |
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
/* Display field labels and values in columns */ | |
span.pewc-summary-panel-product-name { | |
width: 60%; | |
display: inline-block; | |
} | |
span.pewc-summary-panel-product-value { | |
display: inline-block; | |
width: 30%; | |
} | |
td.pewc-summary-panel-price { |
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
<?php | |
/** | |
* Bypass all transients | |
*/ | |
add_filter( 'pewc_disable_all_transients', '__return_true' ); |
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
<?php | |
add_filter( 'unzip_file_use_ziparchive', '__return_false' ); |
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
<html> | |
<head> | |
<title>Product Add-Ons Ultimate REST API Tester</title> | |
</head> | |
<body> | |
<script src='wp-includes/js/jquery/jquery.min.js'></script> | |
<p>API Key: <input type="text" id="wc_api_key" value="" size="50"></p> | |
<p>API Secret: <input type="text" id="wc_api_secret" value="" size="50"></p> | |
<p>API Method: |