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 variation taxonomies after WP All Import import completes | |
| */ | |
| function demo_after_xml_import( $import_id, $import ) { | |
| if( function_exists( 'wcbvp_update_all_variations' ) ) { | |
| wcbvp_update_all_variations(); | |
| } | |
| } | |
| add_action( 'pmxi_after_xml_import', 'demo_after_xml_import', 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 | |
| /** | |
| * Change variation image in Products field Column layout | |
| */ | |
| add_filter( 'pewc_column_layout_replace_thumbnail', '__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 | |
| /** | |
| * Snippet: Auto-delete PEWC uploaded files 30 days after an order is completed. | |
| * | |
| * When an order transitions to "completed", a one-time WP-Cron event is scheduled | |
| * for 30 days later. When that event fires, any uploaded files attached to the | |
| * order are deleted from the filesystem and the order is marked accordingly. | |
| * | |
| * Usage: add this file as an mu-plugin, or require it from your theme/child-theme | |
| * functions.php, or use a snippet plugin such as Code Snippets. |
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 | |
| /* This code was provided by WebToffee support on 10/21/25 | |
| * Makes Plugin Republic's Product Add-ons plugin available to use in the packing list PDF | |
| */ | |
| add_filter( 'wf_pklist_add_package_product_meta', 'wf_pklist_add_additional_fields', 10, 5 ); | |
| function wf_pklist_add_additional_fields( $additional_product_meta, $template_type, $_product, $order_item, $order ) { | |
| if ( 'packinglist' !== $template_type ) { | |
| return $additional_product_meta; | |
| } |
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 | |
| /** | |
| * Send test email for DPP | |
| * Replace $order_id with an existing scheduled order on your site | |
| * Refresh a WooCommerce page, e.g. WooCommerce > Orders to fire the snippet | |
| */ | |
| function prefix_test_scheduled_order_due_email() { | |
| $order_id = 91; | |
| wcdpp_scheduled_order_due_email( $order_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
| <?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. | |
| * |
NewerOlder