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
location ~ \.php$ { | |
fastcgi_param PHP_VALUE "sendmail_path=/usr/bin/env PATH/TO/catchmail -f [email protected]"; | |
} |
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
remove_action( 'woocommerce_after_checkout_billing_form', array( 'WC_EU_VAT_Number', 'vat_number_field' ) ); | |
add_action( 'HOOK-YOU-WANT-TO-ADD-IT-TO', array( 'WC_EU_VAT_Number', 'vat_number_field' ) ); |
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 ( class_exists( 'WC_Product_Vendors_Vendor_Frontend' ) ) { | |
add_action( 'woocommerce_single_product_summary', array( WC_Product_Vendors_Vendor_Frontend, 'add_sold_by_single' ), 5 ); | |
} |
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 | |
// hide coupon form from the cart and checkout pages if there's a deposit product in the cart | |
function hide_coupon_field( $enabled ) { | |
if ( is_cart() || is_checkout() ) { | |
if ( class_exists( 'WC_Deposits_Cart_Manager' ) ) { | |
if ( WC_Deposits_Cart_Manager::has_deposit() ) { | |
$enabled = 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
<?php | |
add_action( 'wp', 'vn_remove_related_products' ); | |
function vn_remove_related_products() { | |
// replace 'accessories' with the slug for your product category | |
if ( is_product() && has_term( 'accessories', 'product_cat' ) ) { | |
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 ); | |
} | |
} |
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 | |
function wpml_filter_gateways($gateways){ | |
if(ICL_LANGUAGE_CODE == 'fr') //Checks if the selected language is French. | |
unset($gateways['paypal']); //"remove" paypal | |
return $gateways; //returns the other payment methods. | |
} | |
add_filter('woocommerce_available_payment_gateways','wpml_filter_gateways',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
class Luminus_Woocommerce_Auto_Stock_Restore { | |
function __construct() { | |
add_action( 'woocommerce_order_status_processing_to_cancelled', array( $this, 'restore_order_stock' ), 10, 1 ); | |
add_action( 'woocommerce_order_status_completed_to_cancelled', array( $this, 'restore_order_stock' ), 10, 1 ); | |
add_action( 'woocommerce_order_status_on-hold_to_cancelled', array( $this, 'restore_order_stock' ), 10, 1 ); | |
// add_action( 'woocommerce_order_status_processing_to_refunded', array( $this, 'restore_order_stock' ), 10, 1 ); | |
// add_action( 'woocommerce_order_status_completed_to_refunded', array( $this, 'restore_order_stock' ), 10, 1 ); | |
// add_action( 'woocommerce_order_status_on-hold_to_refunded', array( $this, 'restore_order_stock' ), 10, 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
#!/bin/bash | |
# Function to display usage instructions when the command is used incorrectly | |
function usage { | |
echo "usage: wc-site <name> [--master]" | |
echo "e.g. wc-site gradient will create a site at https://gradient.test" | |
echo "The \"--master\" switch will install the current WooCommerce master from Github" | |
exit 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
#!/bin/bash | |
# Function to display usage instructions when the command is used incorrectly | |
function usage { | |
echo "usage: wp-clone <source> <destination>" | |
echo "<source> is the site you want to clone" | |
echo "<destination> is where you want to clone it to" | |
exit 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
core config: | |
dbuser: root | |
dbpass: root | |
extra-php: | | |
define('WP_DEBUG', true); | |
define('WP_DEBUG_LOG', true); | |
define('WP_DEBUG_DISPLAY', false); | |
@ini_set('display_errors',0); | |
define( 'WCS_DEBUG', true ); |