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 the following to your theme's functions.php: | |
add_action( 'woocommerce_order_status_pending_to_processing_notification', 'watch_for_processing_email', 5 ); | |
add_action( 'woocommerce_order_status_pending_to_on-hold_notification', 'watch_for_processing_email', 5 ); | |
function watch_for_processing_email() { | |
// only add the instructions for processing type emails | |
add_action( 'woocommerce_email_before_order_table', 'add_order_email_instructions', 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 | |
function get_the_user_ip() { | |
if ( ! empty( $_SERVER['HTTP_CLIENT_IP'] ) ) { | |
//check ip from share internet | |
$ip = $_SERVER['HTTP_CLIENT_IP']; | |
} elseif ( ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) { | |
//to check ip is pass from proxy | |
$ip = $_SERVER['HTTP_X_FORWARDED_FOR']; | |
} else { | |
$ip = $_SERVER['REMOTE_ADDR']; |
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 Display Currency Code in Currency Symbol | |
* Plugin URI: https://gist.github.com/BFTrick/10681832 | |
* Description: Add the currency code to the currency symbol in WooCommerce. Ex. USD $. | |
* Author: Patrick Rauland | |
* Author URI: http://patrickrauland.com/ | |
* Version: 1.0 | |
* | |
* This program is free software: you can redistribute it and/or modify |
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 Shop page from WooCommerce breadcrumb on is_product page, see https://gist.github.com/Willem-Siebe/6f43704e8536fc308fc3. | |
function wsis_wpseo_breadcrumb_output( $output ){ | |
if( is_product() ){ | |
$from = ' » <span typeof="v:Breadcrumb"><a href="http://yoururl.com/shop/" rel="v:url" property="v:title">Producten</a></span>'; | |
$to = ''; | |
$output = str_replace( $from, $to, $output ); |
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 Order number besides invoicenumber to invoice (WooCommerce PDF Invoices & Packing Slips plugin), see https://gist.github.com/Willem-Siebe/c05bd7d2938e951b54bc --> | |
<span class="order-number-label"><?php _e( 'Order Number:', 'wpo_wcpdf' ); ?></span> | |
<span class="order-number"><?php $wpo_wcpdf->order_number(); ?></span><br /> |
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
// The return to shop button in WooCommerce empty-cart.php goes to the shop archive page. However, if we don't want a shop page and leave this option unset in WooCommerce settings, we need this button to go to our homepage. See https://gist.github.com/Willem-Siebe/c1d70aeef75a3e60ab15. | |
function wsis_woocommerce_return_to_shop_redirect() { | |
return get_home_url(); | |
} | |
add_filter( 'woocommerce_return_to_shop_redirect', 'wsis_woocommerce_return_to_shop_redirect' ); |
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 the first custom fields available in WooCommerce PDF Invoices & Packing Slips to your own custom invoice template, see https://gist.github.com/Willem-Siebe/cf8474b5ca4e72880a04. --> | |
<?php if ( $wpo_wcpdf->get_extra_1() ): ?> | |
<div id="extra1"> | |
<?php $wpo_wcpdf->extra_1(); ?> | |
</div> | |
<?php endif; ?> | |
<!-- Add the second custom fields available in WooCommerce PDF Invoices & Packing Slips to your own custom invoice template, see https://gist.github.com/Willem-Siebe/cf8474b5ca4e72880a04. --> |
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 | |
/** | |
* Limit previous/next post title character length and append a ellipsis if trunicated | |
*/ | |
$previous_post = get_adjacent_post( false, '', true ); | |
$next_post = get_adjacent_post( false, '', false ); | |
$previous_post_title= get_the_title($previous_post); | |
$next_post_title = get_the_title($next_post); | |
$max_length = 75; | |
$previous_post_length = strlen($previous_post_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
// Remove CSS from WooCommerce after version 2.1, see https://gist.github.com/Willem-Siebe/8c29bcfa791316165127. | |
add_filter( 'woocommerce_enqueue_styles', '__return_empty_array' ); |