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_filter('woocommerce_email_headers', 'woo_cc_emails' ); | |
function woo_cc_emails() { | |
return 'Bcc: [email protected]' . "\r\n"; | |
} | |
?> |
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 | |
remove_action( 'woo_main_after', 'woocommerce_get_sidebar', 10 ); | |
add_action( 'woo_main_after', 'woo_custom_sidebar', 10 ); | |
function woo_custom_sidebar() { | |
if ( ! is_product() ) { | |
woocommerce_get_sidebar(); | |
} | |
} | |
remove_action( 'woocommerce_before_main_content', 'shelflife_before_content', 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 | |
// Delete Account Functionality | |
add_action( 'woocommerce_after_my_account', 'woo_delete_account_button' ); | |
function woo_delete_account_button() { | |
?> | |
<a href="<?php echo add_query_arg( 'wc-api', 'wc-delete-account', home_url( '/' ) ) ?>" class="button">Delete Account</a> | |
<?php | |
} | |
add_action( 'woocommerce_api_' . strtolower( 'wc-delete-account' ), 'woo_handle_account_delete' ); |
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_filter('add_to_cart_redirect', 'custom_add_to_cart_redirect'); | |
function custom_add_to_cart_redirect( $url ) { | |
$product_id = (int) $_REQUEST['add-to-cart']; | |
if ( class_exists( 'WC_Subscriptions_Product' ) ) { | |
if ( WC_Subscriptions_Product::is_subscription( $product_id ) ) { | |
return get_permalink(get_option( 'woocommerce_checkout_page_id' ) ); | |
} else return $url; | |
} else return $url; | |
} |
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_shortcode( 'product_upsells', 'wc_upsells_shortcode' ); | |
function wc_upsells_shortcode( $atts ) { | |
extract( shortcode_atts( array( | |
'posts_per_page' => '-1', | |
'columns' => '2', | |
'orderby' => 'rand' | |
), $atts ) ); | |
woocommerce_get_template( 'single-product/up-sells.php', array( | |
'posts_per_page' => $posts_per_page, |
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_action( 'wp_enqueue_scripts', 'checkout_lightbox' ); | |
function checkout_lightbox() { | |
global $woocommerce; | |
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; | |
if ( is_checkout() ) { | |
wp_enqueue_script( 'prettyPhoto', $woocommerce->plugin_url() . '/assets/js/prettyPhoto/jquery.prettyPhoto' . $suffix . '.js', array( 'jquery' ), $woocommerce->version, true ); | |
wp_enqueue_script( 'prettyPhoto-init', $woocommerce->plugin_url() . '/assets/js/prettyPhoto/jquery.prettyPhoto.init' . $suffix . '.js', array( 'jquery' ), $woocommerce->version, true ); | |
wp_enqueue_style( 'woocommerce_prettyPhoto_css', $woocommerce->plugin_url() . '/assets/css/prettyPhoto.css' ); | |
} |
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_action( 'woocommerce_before_single_product', 'wc_brand_image_single_product' ); | |
function wc_brand_image_single_product() { | |
global $post; | |
$brands = wp_get_post_terms( $post->ID, 'product_brand' ); | |
if ( $brands ) | |
$brand = $brands[0]; | |
if ( ! empty( $brand ) ) { | |
$thumbnail = get_brand_thumbnail_url( $brand->term_id ); | |
$url = get_term_link( $brand->slug, 'product_brand' ); |
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_shortcode( 'product_upsells', 'wc_upsells_shortcode' ); | |
function wc_upsells_shortcode( $atts ) { | |
extract( shortcode_atts( array( | |
'posts_per_page' => '-1', | |
'columns' => '2', | |
'orderby' => 'rand' | |
), $atts ) ); | |
woocommerce_get_template( 'single-product/up-sells.php', array( | |
'posts_per_page' => $posts_per_page, |
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_action( 'woocommerce_after_shop_loop_item', 'woocoomerce_archive_backorder', 6 ); | |
function woocoomerce_archive_backorder(){ | |
global $product; | |
if ( $product->backorders_require_notification() && $product->is_on_backorder( 1 ) ) | |
echo '<p class="backorder_notification">' . __( 'Available on backorder', 'woocommerce' ) . '</p>'; | |
} | |
?> |
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_filter( 'manage_edit-shop_order_columns', 'woo_order_weight_column' ); | |
function woo_order_weight_column( $columns ) { | |
$columns['total_weight'] = __( 'Weight', 'woocommerce' ); | |
return $columns; | |
} | |
add_action( 'manage_shop_order_posts_custom_column', 'woo_custom_order_weight_column', 2 ); | |
function woo_custom_order_weight_column( $column ) { | |
global $post, $woocommerce, $the_order; |