Skip to content

Instantly share code, notes, and snippets.

View woogist's full-sized avatar

WooCommerce.com Documentation woogist

View GitHub Profile
@woogist
woogist / foundationpress-functions.php
Created April 8, 2015 16:41
This code integrates Zurb FoundationPress theme from Ole Fredrik ( http://foundationpress.olefredrik.com ) with the Sensei LMS by Woothemes. To add this integration simply copy this cod to your functions.php file:.
/*********************
* Sensei Integration
*********************/
/**
* Declare that your theme now supports Sensei
*/
add_action( 'after_setup_theme','foundationpress_sensei_support' );
function foundationpress_sensei_support () {
@woogist
woogist / Remove field
Created April 8, 2015 16:10
InterFax Integration: Remove Fax field on checkout page
<?php
// Hook in
add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );
// Our hooked in function - $fields is passed via the filter!
function custom_override_checkout_fields( $fields ) {
unset($fields['billing']['billing_fax']);
return $fields;
}
@woogist
woogist / functions.php
Created April 7, 2015 07:19
Allows shortcodes in the product vendor's description
/**
* Allows shortcodes in the product vendor's description
*
* @param string $desc
* @return string
*/
function wc_vendors_use_sc_in_desc( $desc ) {
return do_shortcode( $desc );
}
add_filter( 'product_vendors_page_description', 'wc_vendors_use_sc_in_desc' );
@woogist
woogist / sensei-redirect-functions.php
Last active December 7, 2015 08:13
This code snippet was used on ZD ticket 274932 . It stops Sensei from automatically redirecting from the lesson to the quiz. Tags: Sensei Redirect, Lesson Redirect, Sensei Auto Redirect.
add_action('template_redirect', 'custom_remove_sensei_quiz_view');
function custom_remove_sensei_quiz_view(){
if( is_singular('quiz') ){
global $post;
//redirect back to the lesson page
$lesson_id = $post->post_parent;
//make sure this does not run again
$lesson_link = add_query_arg( 'sa', '1', get_permalink( $lesson_id ) );
@woogist
woogist / functions.php
Created April 2, 2015 10:14
Allows shortcodes in the product vendor's description
/**
* Allows shortcodes in the product vendor's description
*
* @param string $desc
* @return string
*/
function wc_vendors_use_sc_in_desc( $desc ) {
return do_shortcode( $desc );
}
add_filter( 'product_vendors_page_description', 'wc_vendors_use_sc_in_desc' );
@woogist
woogist / twentyten-functions.php
Created March 26, 2015 06:26
Sensei integration for the WordPress Twentyten theme from. Add the code below into your themes functions.php.
/*********************
* Sensei Integration
*********************/
/**
* Declare that your theme now supports Sensei
*/
add_action( 'after_setup_theme','twentyten_sensei_support' );
function twentyten_sensei_support () {
@woogist
woogist / storefront-funcitons.php
Created March 26, 2015 03:18
Sensei integration for our Storefront theme. Add the code below to your child themes functions.php file.
/*********************
* Sensei Integration
*********************/
/**
* Declare that your theme now supports Sensei
*/
add_action( 'after_setup_theme','storefront_sensei_support' );
function storefront_sensei_support () {
@woogist
woogist / customizr-functions.php
Created March 26, 2015 02:40
Sensei integration for The Customizr theme from Themes and Co. Add the code below into your themes functions.php. This will only work for The Customizr them.
/*********************
* Sensei Integration
*********************/
/**
* Declare that your theme now supports Sensei
*/
add_action( 'after_setup_theme','customizr_sensei_support' );
function customizr_sensei_support () {
add_theme_support( 'sensei' );
@woogist
woogist / custom.css
Created March 11, 2015 16:17
Animate the course progress bar in Sensei
/* from Sensei 1.8 we have removed the javascript animation on the course progress meter on the My Courses page. If you wish
* to restore the animation, copy this CSS into your theme's CSS file.
*/
.meter span {
-webkit-animation: meter 2s 1;
-moz-animation: meter 2s 1;
-ms-animation: meter 2s 1;
animation: meter 2s 1;
}
@woogist
woogist / functions.php
Last active August 29, 2015 14:16
Sensei integration for The 7 theme from Dream Themes. Add the code below into your themes functions.php. This will only work for The 7 them from Dream Themes
/*********************
* Sensei Integration
*********************/
/**
* Declare that your theme now supports Sensei
*/
add_action( 'after_setup_theme','the_7_sensei_support' );
function the_7_sensei_support () {
add_theme_support( 'sensei' );