Skip to content

Instantly share code, notes, and snippets.

View DanielSantoro's full-sized avatar

Danny Santoro DanielSantoro

View GitHub Profile
@DanielSantoro
DanielSantoro / functions.php
Created February 18, 2016 16:24
Change No Shipping Method Available Message
add_filter( 'woocommerce_cart_no_shipping_available_html', 'change_noship_message' );
add_filter( 'woocommerce_no_shipping_available_html', 'change_noship_message' );
function change_noship_message() {
print "Please call us after placing your order to negotiate shipping: <br />(123) 456-7890";
}
@DanielSantoro
DanielSantoro / addtotexteditor.html
Created February 8, 2016 22:19
Sample Amazon S3 Embedding
<a href="[amazon_s3 bucket=wooshippingsupport object=Sangre_y_Queso_Soundtrack/FILENAME.EXT]" target="_blank">Link Text</a>
@DanielSantoro
DanielSantoro / customer-pre-ordered.php
Created January 26, 2016 21:45
Pre-Order Email Modification
<?php
/**
* WooCommerce Pre-Orders
*
* @package WC_Pre_Orders/Templates/Email
* @author WooThemes
* @copyright Copyright (c) 2013, WooThemes
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
*/
@DanielSantoro
DanielSantoro / form-login.php
Created January 26, 2016 19:08
Login Form (Modification)
<?php
/**
* Login Form
*
* This template can be overridden by copying it to yourtheme/woocommerce/myaccount/form-login.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you (the theme developer).
* will need to copy the new files to your theme to maintain compatibility. We try to do this.
* as little as possible, but it does happen. When this occurs the version of the template file will.
* be bumped and the readme will list any important changes.
@DanielSantoro
DanielSantoro / functions.php
Created January 19, 2016 14:29
Filter Product Variations Shipping Methods
/**
* Deactivate USPS Shipping if products with specific shipping
* classes are in the cart
*
* Add the shipping class slugs to the $shippingclass_array array
*/
add_filter( 'woocommerce_shipping_usps_is_available', 'unset_woocommerce_shipping_methods_usps', 10 ,2 );
function unset_woocommerce_shipping_methods_usps ( $return, $package ) {
// Setup an array of shipping classes that do not allow USPS Shipping
@DanielSantoro
DanielSantoro / template-body.php
Last active December 9, 2015 17:50
PIP Changes
<header>
<a class="print" href="#" onclick="window.print()"><?php _e('Print', 'woocommerce-pip'); ?></a>
<div style="float: left; width: 49%;">
<?php echo woocommerce_pip_print_logo(); ?>
<?php if ($action == 'print_invoice') { ?>
<h3><?php _e('Invoice', 'woocommerce-pip'); ?> <?php echo woocommerce_pip_invoice_number($order->id); ?></h3>
<?php } else { ?>
<h3><?php _e('Packing list', 'woocommerce-pip'); ?></h3>
<?php } ?>
<h3><?php _e('Order', 'woocommerce-pip'); ?> <?php echo $order->get_order_number(); ?> &mdash; <time datetime="<?php echo date("d/m/Y", strtotime($order->order_date)); ?>"><?php echo date("d/m/Y", strtotime($order->order_date)); ?></time></h3>
@DanielSantoro
DanielSantoro / progress.html
Last active November 30, 2015 19:29
Progress Bar
<progress value="50" max="100"></progress>
@DanielSantoro
DanielSantoro / dl.html
Created November 20, 2015 19:15
Definition List HTML
<dl>
<dt>Term</dt><dd>Definition</dd>
<dt>Term</dt><dd>Definition</dd>
<dt>Term</dt><dd>Definition</dd>
<dt>Term</dt><dd>Definition</dd>
<dt>Term</dt><dd>Definition</dd>
</dl>
@DanielSantoro
DanielSantoro / class-wc-cart.php
Created November 4, 2015 16:27
WC Error Notices
<?php
/**
* WooCommerce cart
*
* The WooCommerce cart class stores cart data and active coupons as well as handling customer sessions and some cart related urls.
* The cart class also has a price calculation function which calls upon other classes to calculate totals.
*
* @class WC_Cart
* @version 2.1.0
* @package WooCommerce/Classes
@DanielSantoro
DanielSantoro / sample.php
Created October 21, 2015 18:57
Embed Brands Icon into Page
<?php echo do_shortcode('[product_brand width="64px" height="64px" class="alignright"]') ?>