Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Sébastien Dumont seb86

🏠
Working from home
View GitHub Profile
@seb86
seb86 / gist:5728571
Last active Dec 18, 2015
writepanel-product_data.php - Added download type select option.
View gist:5728571
// Download Type
woocommerce_wp_select( array( 'id' => '_download_type', 'label' => __( 'Download Type', 'woocommerce' ), 'options' => array(
'application' => __( 'Application/Software', 'woocommerce' ),
'music' => __( 'Music', 'woocommerce' ),
) ) );
@seb86
seb86 / gist:5728582
Last active Dec 18, 2015
woocommerce-hooks.php - Added action for the product schema before the single products.
View gist:5728582
add_action( 'woocommerce_before_single_product', 'woocommerce_product_schema', 10 );
@seb86
seb86 / gist:5728772
Last active Dec 18, 2015
content-single-product.php - Line 24 is removed and replaced with a comment.
View gist:5728772
<?php /* The beginning of the product container is added by the hook - woocommerce_product_schema */ ?>
@seb86
seb86 / gist:5730061
Last active Dec 18, 2015
writepanel-product_data.php - Saves the new field for the download type. After line 1015
View gist:5730061
if ( isset( $_POST['_download_type'] ) )
update_post_meta( $post_id, '_download_type', esc_attr( $_POST['_download_type'] ) );
@seb86
seb86 / gist:5730383
Created Jun 7, 2013
New template file for single-product in WooCommerce. schema.php
View gist:5730383
<?php
/**
* Identifies the product type and outputs the
* correct Schema for the beginning of the
* product container.
*
* @author: Seb's Studio
* @package WooCommerce/Templates
* @version 2.1
*/
@seb86
seb86 / gist:5730401
Created Jun 7, 2013
woocommerce\woocommerce-template.php - Between Line 466 Line 467
View gist:5730401
if ( ! function_exists( 'woocommerce_product_schema' ) ) {
/**
* Outputs the correct Schema for the beginning of the product container.
*
* @access public
* @subpackage Product
* @return void
*/
View woocommerce-email-new-address.php
<?php
/**
* Plugin Name: WooCommerce Email Customer Address
* Plugin URI: https://gist.github.com/BFTrick/7891074
* Description: Email the site admin when a customer changes their address
* Author: Patrick Rauland
* Author URI: http://patrickrauland.com/
* Version: 1.0
*
* This program is free software: you can redistribute it and/or modify
View woocommerce-remove-virtual-billing-fields.php
<?php
/**
* Plugin Name: WooCommerce Remove Billing Fields for Free Virtual Products
* Plugin URI: https://gist.github.com/BFTrick/7873168
* Description: Remove the billing address fields for free virtual orders
* Author: Patrick Rauland
* Author URI: http://patrickrauland.com/
* Version: 1.0
*
* This program is free software: you can redistribute it and/or modify
View woocommerce-check-terms.php
<?php
/**
* Plugin Name: WooCommerce Check Terms & Conditions
* Plugin URI: https://gist.github.com/BFTrick/7789974
* Description: Make the Terms & Conditions checkbox checked by default
* Author: Patrick Rauland
* Author URI: http://patrickrauland.com/
* Version: 1.0
*
* This program is free software: you can redistribute it and/or modify
View gist:10070574
<?php
/*
Plugin Name: WooCommerce <enter name> Gateway
Plugin URI: http://woothemes.com/woocommerce
Description: Extends WooCommerce with an <enter name> gateway.
Version: 1.0
Author: WooThemes
Author URI: http://woothemes.com/
Copyright: © 2009-2011 WooThemes.