by alexander white ©
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_action( 'woocommerce_order_status_completed', 'drip_subscribe_user_to_campaign', 20, 1 ); | |
add_action( 'woocommerce_order_status_completed', 'drip_add_user_fields', 30, 1 ); | |
function drip_subscribe_user_to_campaign( $order_id ) { | |
$WC_Drip_Settings = new WC_Drip_Settings(); | |
$wrapper = $WC_Drip_Settings->wrapper(); | |
$order = wc_get_order( $order_id ); | |
$email = $order->billing_email; |
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
#!/bin/sh | |
# Config for SSL. | |
echo "--- Making SSL Directory ---" | |
mkdir /etc/nginx/ssl | |
echo "--- Copying $i SSL crt and key ---" | |
openssl req -nodes -new -x509 -keyout /etc/nginx/ssl/server.key -out /etc/nginx/ssl/server.crt -subj "/C=US/ST=NY/L=NYC/O=Dis/CN=www.example.com" | |
echo "--- Turning SSL on in nginx.conf. ---" |
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
/** | |
* Check the cart for specific products, remove Free Shipping method if they are present | |
* | |
* Add the code to your theme functions.php file | |
*/ | |
add_filter( 'woocommerce_package_rates', 'unset_free_shipping_method' , 10, 2 ); | |
function unset_free_shipping_method( $rates, $package ) { | |
/** | |
* Setup an array or products |
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( 'wc360_image_size', 'wcs_360_image_name' ); | |
function wcs_360_image_name() { | |
return 'shop_thumbnail'; | |
} |
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 Image Upload to Series Taxonomy */ | |
// Add Upload fields to "Add New Taxonomy" form | |
function add_series_image_field() { | |
// this will add the custom meta field to the add new term page | |
?> | |
<div class="form-field"> | |
<label for="series_image"><?php _e( 'Series Image:', 'journey' ); ?></label> |
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: WooCommerce Subscriptions Remove $0.00 Recurring Discount | |
Plugin URI: | |
Description: Do not include a $0.00 recurring discount amount when a coupon is displaying it. For example, instead of display a coupon discount as "$10.00 now then $0.00 / month", display it as "$10.00". | |
Author: | |
Author URI: | |
Version: 0.1 | |
*/ | |
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 | |
// My new order statuses. | |
function register_my_new_order_statuses() { | |
register_post_status( 'wc-status-name', array( | |
'label' => _x( 'Status Name', 'Order status', 'textdomain' ), | |
'public' => true, | |
'exclude_from_search' => false, | |
'show_in_admin_all_list' => true, | |
'show_in_admin_status_list' => true, |
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
/** | |
* Convert existing meta keys to new meta keys. | |
* | |
* @since x.x.x | |
* | |
* @global object $wpdb The current database. | |
* | |
* @param string $existing_key The existing meta key. | |
* @param string $new_key The new meta key. | |
* @param bool $remove_existing Optional. Whether to remove the old meta entries after conversion. |
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 custom gateway icons | |
* | |
* @param string $icon Image HTML. | |
* @param string $gateway_id Gateway ID. | |
* | |
* @return string | |
*/ | |
function custom_wc_gateway_icons( $icon, $gateway_id ) { |