Skip to content

Instantly share code, notes, and snippets.

View woogist's full-sized avatar

WooCommerce.com Documentation woogist

View GitHub Profile
@woogist
woogist / wrapper-end.php
Created August 29, 2014 07:57
WPExplorere Total Theme , Sensei end Wrappers
<?php
/**
* Content wrappers
*
* @author WooThemes
* @package Sensei/Templates
* @version 1.0.0
*/
if ( ! defined( 'ABSPATH' ) ) exit;
@woogist
woogist / header.php
Created August 31, 2014 00:06
show the memorable slider on all pages
<?php
if ( ! defined( 'ABSPATH' ) ) exit;
/**
* Header Template
*
* Here we setup all logic and XHTML that is required for the header section of all screens.
*
* @package WooFramework
* @subpackage Template
*/
@woogist
woogist / function.php
Created September 3, 2014 04:33
load memorable feature slider js on all other page except for home
add_action( 'woothemes_add_javascript' , 'woo_load_featured_slider_on_all_other_pages_js' );
function woo_load_featured_slider_on_all_other_pages_js() {
if ( !is_home() ) {
//Slider settings
$settings = array(
'featured_speed' => '7',
'featured_hover' => 'true',
'featured_action' => 'true',
@woogist
woogist / functions.php
Created October 2, 2014 14:13
Show the order payment URL on the admin order page
add_action( 'woocommerce_admin_order_data_after_order_details', 'woo_show_order_payment_url' );
function woo_show_order_payment_url( $order ) {
echo '<a href="' . $order->get_checkout_payment_url() . '" title="' . __( 'Get order payment URL', 'your-domain' ) . '" target="_blank">' . __( 'Get order payment URL', 'your-domain' ) . '</a>';
}
@woogist
woogist / gist:bdb8a7dd24dba7cee202
Created October 8, 2014 13:26
Change the Vendor tab label
add_filter( 'woocommerce_product_tabs', 'woo_rename_vendor_tab' );
function woo_rename_vendor_tab( $tabs ) {
if ( isset( $tabs['vendor'] ) ) {
$tabs['vendor']['title'] = __( 'Your Label Here' );
}
return $tabs;
}
@woogist
woogist / login-form.php
Created October 9, 2014 06:30
sensei login form fix
<?php
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
/**
* The Template for displaying the sensei login form
*
* Override this template by copying it to yourtheme/sensei/user/login-form.php
*
* @author WooThemes
* @package Sensei/Templates
@woogist
woogist / functions.php
Created October 10, 2014 01:22
custom testimonials output
/**
* Display or return HTML-formatted testimonials.
* @param string/array $args Arguments.
* @since 1.0.0
* @return string
*/
function woothemes_testimonials ( $args = '' ) {
global $post;
$defaults = apply_filters( 'woothemes_testimonials_default_args', array(
@woogist
woogist / functions.php
Last active August 29, 2015 14:07
Hide a specific category from the shop
function wc_hide_category_archive() {
$hide_category = 'category-slug'; //Change this with your category slug
if ( ! is_user_logged_in() && is_product_category( $hide_category ) ) {
wp_redirect( home_url() );
exit;
} elseif ( is_product() && ! is_user_logged_in() ) {
global $product;
$taxonomy = 'product_cat';
@woogist
woogist / functions.php
Last active August 29, 2015 14:09
Send the customer invoice to multiple email addresses
<?php
add_filter( 'woocommerce_email_recipient_customer_invoice', 'wc_send_invoice_multiple_addresses' );
function wc_send_invoice_multiple_addresses( $recipient ) {
$recipient = rtrim( trim( $recipient ), ',' );
$new_recipients = array(
'yourmeail@domain.com',
'onemore@anotherdomain.com',
//Add more email addresses if needed
);
@woogist
woogist / gist:18b6e11115058b9a8fda
Created November 18, 2014 13:33
Shipwire: export completed orders
function wcs_shipwire_valid_order_statuses_for_export( $statuses ) {
$statuses[] = 'completed';
return $statuses;
}
add_filter( 'wc_shipwire_valid_order_statuses_for_export', 'wcs_shipwire_valid_order_statuses_for_export' );