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 | |
| /** | |
| * Update the maximum discount rate in the Bookings for WooCommerce plugin | |
| */ | |
| funcion prefix_bfwc_discount_rate_max( $max, $product_id ) { | |
| return 1000; | |
| } | |
| add_filter( 'bfwc_discount_rate_max', 'prefix_bfwc_discount_rate_max', 10, 2 ); |
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_action( 'wp_footer', function () { ?> | |
| <script> | |
| jQuery(document).ready(function($) { | |
| setTimeout(function() { | |
| $('.woocommerce-product-gallery .wd-carousel-item:not( :last-child ) img').click(function() { | |
| $('.aipaou-image-layer').hide(); | |
| }); | |
| $('.woocommerce-product-gallery .wd-carousel-item:last-child img').click(function() { | |
| $('.aipaou-image-layer').show(); |
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 | |
| // Update shipping class if any of the specified fields has any value. | |
| // Uncomment the marked line below if you want to check fields for a specific value. | |
| add_action( 'woocommerce_before_calculate_totals', function( $cart ) { | |
| if ( is_admin() && ! defined( 'DOING_AJAX' ) ) { | |
| return; | |
| } | |
| $target_field_ids = [ 1642, 1643, 1644 ]; // the field IDs | |
| $shipping_class = 'easy'; // the shipping class 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
| <?php | |
| /** | |
| * Flat rate with daily overage for Bookings for WooCommerce | |
| * | |
| * When a product has the "Flat rate" option enabled, charges the flat rate | |
| * for bookings up to $min_days, then adds $daily_rate | |
| * for each additional day beyond that. | |
| * | |
| * Add to your theme's functions.php or a site-specific plugin. | |
| * |
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 | |
| /** | |
| * Set migration to done for Dynamic Pricing and Discount Rules | |
| */ | |
| add_filter( 'wcfad_assume_migration_done', '__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 | |
| /** | |
| * Subtract last day's cost from daily booking | |
| * Requires bookings to be a minimum of 2 days | |
| */ | |
| function demo_dont_charge_last_day( $booking_cost, $product_id ) { | |
| $std_cost = bfwc_get_standard_cost( $product_id ); | |
| $booking_cost = $booking_cost - $std_cost; | |
| return $booking_cost; | |
| } |
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_action( 'wp_footer', function(){ | |
| ?> | |
| <script> | |
| jQuery( document ).ready( function(){ | |
| jQuery( document.body ).on( 'woosq_loaded', function( event, id ){ | |
| jQuery( 'body' ).trigger( 'pewc_check_conditions' ).trigger('pewc_trigger_calculations'); | |
| jQuery( 'body' ).trigger( 'pewc_reinitiate_js_validation' ); | |
| jQuery( 'body' ).trigger( 'pewc_attach_form_cart_input_change' ); | |
| jQuery( 'body' ).trigger( 'pewc_trigger_initial_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 | |
| /** | |
| * If a product has an alternative featured image, display that on the archive page | |
| */ | |
| function pr_demo_product_get_image( $image, $product, $size, $attr, $placeholder ) { | |
| if( is_product() ) { | |
| // We're on a product page so just return the image | |
| return $image; | |
| } | |
| $product_id = $product->get_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
| .pewc-has-hex .pewc-radio-images-wrapper img { | |
| visibility: visible; | |
| height: auto; | |
| } | |
| .pewc-hex { | |
| display: none; | |
| } |
NewerOlder