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 | |
| /** | |
| * Dequeue dropzone sitewide | |
| */ | |
| add_action( 'wp_print_scripts', 'my_dequeue_pewc_dropzone', 100 ); | |
| add_action( 'wp_print_styles', 'my_dequeue_pewc_dropzone', 100 ); | |
| function my_dequeue_pewc_dropzone() { | |
| wp_dequeue_script( 'pewc-dropzone' ); | |
| wp_deregister_script( 'pewc-dropzone' ); |
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: Add a 'Shipping speed' radio field (Standard / Express) to the checkout page, | |
| * inside the order review table immediately below the subtotal row and above the | |
| * shipping/payment method options. | |
| * | |
| * Selecting 'Express' adds a 15% fee based on the cart's current total. | |
| * The field is saved to the order as post meta and shown on the admin order screen. | |
| * | |
| * Usage: add this file as an mu-plugin, or require it from your theme/child-theme |
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( 'woocommerce_order_item_display_meta_value', 'my_pewc_hide_field_value_by_type', 20, 3 ); | |
| function my_pewc_hide_field_value_by_type( $display_value, $meta, $order_item ) { | |
| if ( ! is_admin() ) { | |
| return $display_value; | |
| } | |
| // Field types to hide the entered value for (price-only display) | |
| $target_types = array( 'radio-group', 'calculation' ); |
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 day into night | |
| */ | |
| function my_bfwc_filter_unit_labels( $labels ) { | |
| $labels['day'] = array( | |
| 'single' => __( 'Night', 'bfwc' ), | |
| 'plural' => __( 'Nights', 'bfwc' ), | |
| ); | |
| return $labels; |
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 | |
| /** | |
| * Exclude specific products from a Product Categories field type | |
| * Edit the $excluded_ids array below with the product IDs you want | |
| * to hide. If you need different exclusions per field, check $args['category'] to | |
| * identify the field and apply exclusions conditionally. | |
| */ | |
| add_filter( 'pewc_get_products_for_cats_args', function( $args ) { | |
| // IDs of products to exclude from all Product Categories fields. |
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 | |
| /** | |
| * Return specified attribute term as product name | |
| * Update pa_size in line 13 with your attribute slug | |
| */ | |
| function pr_child_product_title_size_only( $title, $child_product ) { | |
| if ( ! is_a( $child_product, 'WC_Product_Variation' ) ) { | |
| return $title; | |
| } |
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 | |
| // Filters for WooCommerce Variation Product Gallery plugin | |
| // The outermost gallery container | |
| add_filter( 'apaou_gallery_container', function( $selector ) { | |
| return 'woo-variation-gallery-slider'; | |
| } ); | |
| // The wrapper where the preview layer is inserted | |
| add_filter( 'apaou_layer_parent', function( $selector ) { | |
| return 'wvg-single-gallery-image-container'; |
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 bump locations | |
| */ | |
| function demo_multiple_bumps() { | |
| return array( 'product', 'checkout' ); | |
| } | |
| add_filter( 'wcob_bump_location', 'demo_multiple_bumps' ); |
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 shipping fields at checkout for booking products | |
| */ | |
| add_filter( 'woocommerce_cart_needs_shipping_address', '__return_true' ); |
NewerOlder