- Install and activate the
smtp-config.php
file as a plugin or drop it in/mu-plugins
. - Define the necessary constants in
wp-config.php
.
This file contains 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 // only copy this line if needed | |
/** | |
* Auto Complete all WooCommerce virtual orders. | |
* | |
* @param int $order_id The order ID to check | |
* @return void | |
*/ | |
function custom_woocommerce_auto_complete_virtual_orders( $order_id ) { |
This file contains 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 | |
/** | |
* Custom variable price HTML. | |
* Shows "Starting at" prefix with when min price is different from max price. | |
* | |
* @param stirng $price Product price HTML | |
* @param WC_Product_Variable $product Product data. | |
* @return string | |
*/ | |
function cs_my_wc_custom_variable_price_html( $price, $product ) { |
This file contains 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 include this if already open! | |
/** | |
* Remove existing tabs from single product pages. | |
*/ | |
function remove_woocommerce_product_tabs( $tabs ) { | |
unset( $tabs['description'] ); | |
unset( $tabs['reviews'] ); | |
unset( $tabs['additional_information'] ); | |
return $tabs; |
This file contains 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_filter( 'woocommerce_upsell_display_args', 'custom_woocommerce_upsell_display_args' ); | |
function custom_woocommerce_upsell_display_args( $args ) { | |
$args['posts_per_page'] = 5; // Change this number | |
$args['columns'] = 5; // This is the number shown per row. | |
return $args; | |
} |
This file contains 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 | |
// Display Fields | |
add_action( 'woocommerce_product_options_related', 'woo_add_custom_fields' ); | |
// Save Fields | |
add_action( 'woocommerce_process_product_meta', 'woo_add_custom_fields_save' ); | |
// Display notice on proeuct page | |
add_action( 'woocommerce_single_product_summary', 'woo_display_more_recent_product_notice', 10 ); |
This file contains 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 | |
class My_Custom_My_Account_Endpoint { | |
/** | |
* Custom endpoint name. | |
* | |
* @var string | |
*/ | |
public static $endpoint = 'my-custom-endpoint'; |
This file contains 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: Disable WooThemes Updater Notice | |
* Version: 1.0.0 | |
* Plugin URI: https://github.com/unfulvio/ | |
* Description: Disables the WooThemes Updater activation notice nag when the Updater is deactivated. | |
* Author: Fulvio Notarstefano | |
* Author URI: https://github.com/unfulvio/ | |
* Requires at least: 4.0 | |
* Tested up to: 4.5 |
This file contains 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 new register fields for WooCommerce registration. | |
*/ | |
function wooc_extra_register_fields() { | |
?> | |
<p class="form-row form-row-first"> | |
<label for="reg_billing_first_name"><?php _e( 'First name', 'woocommerce' ); ?> <span class="required">*</span></label> | |
<input type="text" class="input-text" name="billing_first_name" id="reg_billing_first_name" value="<?php if ( ! empty( $_POST['billing_first_name'] ) ) esc_attr_e( $_POST['billing_first_name'] ); ?>" /> |
This file contains 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_filter( 'woocommerce_get_order_item_totals', 'adjust_woocommerce_get_order_item_totals' ); | |
function adjust_woocommerce_get_order_item_totals( $totals ) { | |
unset($totals['cart_subtotal'] ); | |
return $totals; | |
} |