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
| # This is a basic VCL configuration file for varnish. See the vcl(7) | |
| # man page for details on VCL syntax and semantics. | |
| # | |
| # Default backend definition. Set this to point to your content | |
| # server. | |
| # | |
| # | |
| # BACKEND | |
| backend default { | |
| .host = "127.0.0.1"; |
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
| # A heavily customized VCL to support WordPress | |
| # Some items of note: | |
| # Supports https | |
| # Supports admin cookies for wp-admin | |
| # Caches everything | |
| # Support for custom error html page | |
| vcl 4.0; | |
| import directors; | |
| import std; |
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 | |
| /** | |
| * Do not allow account creation with temp email addresses | |
| * @param Object $validation_errors | |
| * @param string $username | |
| * @param string $email | |
| * @return WP_Error | |
| */ | |
| function do_not_allow_temp_email_addresses( $validation_errors, $username, $email ) { | |
| $prohibitied_domains = 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
| /** | |
| * @desc Remove in all product type quantity fields | |
| */ | |
| function wc_remove_all_quantity_fields( $return, $product ) { | |
| return true; | |
| } | |
| add_filter( 'woocommerce_is_sold_individually', 'wc_remove_all_quantity_fields', 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
| function custom_wc_ajax_variation_threshold( $qty, $product ) { | |
| return 50; | |
| } | |
| add_filter( 'woocommerce_ajax_variation_threshold', 'custom_wc_ajax_variation_threshold', 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 | |
| // UPDATE: Stefan from Stack Overflow has explained a better way to handle cart item data. | |
| // See http://stackoverflow.com/a/32327810/470480 | |
| // ---------------------- | |
| /* | |
| Instructions: |
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
| function WC_custom_booking_price( $price, $product ) { | |
| $target_product_types = array( | |
| 'booking' | |
| ); | |
| if ( in_array ( $product->product_type, $target_product_types ) ) { | |
| // if variable product change price output | |
| $price = ''; | |
| $price .= woocommerce_price($product->get_price()) . ' per person'; | |
| return $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
| add_action( 'woocommerce_loaded', 'wc_custom_loaded' ); | |
| function wc_custom_loaded() { | |
| $old_statuses = array( | |
| 'failed', | |
| //uncomment any of the below statuses to include those statuses | |
| //'pending', | |
| //'processing', | |
| //'on-hold', | |
| //'cancelled', |
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
| /** | |
| * Function adds a BCC header to emails that match our array | |
| * | |
| * @param string $headers The default headers being used | |
| * @param string $object The email type/object that is being processed | |
| */ | |
| function add_bcc_to_certain_emails( $headers, $object ) { | |
| // email types/objects to add bcc to | |
| $add_bcc_to = 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 | |
| /** | |
| * Plugin Name: WooCommerce Subscriptions Product Removed Message | |
| * Description: Display a notice on checkout when a product was removed from the cart after a subscription was added. | |
| * Author: Gerhard Potgieter & Brent Shepherd | |
| * Author URI: | |
| * Version: 1.1 | |
| * License: GPL v2 | |
| */ | |