Skip to content

Instantly share code, notes, and snippets.

@rayflores
Created September 16, 2014 05:09
Show Gist options
  • Save rayflores/a5ac9e590fb269d9c2c9 to your computer and use it in GitHub Desktop.
Save rayflores/a5ac9e590fb269d9c2c9 to your computer and use it in GitHub Desktop.
If you needed to add notes close to the available shipping methods
<?php
/**
* Plugin Name: WooCommerce Add Shipping Notes
* Description: Adds some shipping notes to the cart page
* Version: 1.0.0
* Author: Ray Flores
* Author URI: http://www.rayflores.com
* Requires at least: 3.9
* Tested up to: 3.9
*
* License: GNU General Public License v3.0
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
*/
//uncomment if you're showing shipping in the cart
//add_action( 'woocommerce_cart_collaterals', 'wc_add_shipping_notes_in_cart_display' );
function wc_add_shipping_notes_in_cart_display() {
?>
<div class="woocommerce-content-box one_half first cart-totals-container" style="width:43%;margin-top:20px;">
<div class="shipping-notes">
<h2><?php _e( 'Shipping Notes', 'woocommerce' ) ?></h2>
<table cellspacing="0">
<tbody>
<tr class="shipping-note">
<td style="font-weight:bold;">&raquo; To view delivery for UPS Ground <a href="http://www.ups.com/maps/results?zip=11111" style="text-decoration:underline;">Click here</a></td>
</tr>
<tr class="shipping-note">
<td style="font-weight:bold;">&raquo; USPS Priority Mail is slower than UPS Ground</td>
</tr>
</tbody>
</table>
</div>
</div>
<?php }
// review-order.php shows available hooks
add_action('woocommerce_review_order_after_shipping','wc_add_shipping_notes_in_checkout_display');
function wc_add_shipping_notes_in_checkout_display() {
?>
<th class="shipping-notes" style="text-align:left;"><?php _e( 'Shipping Notes', 'woocommerce' ) ?>
<br/><span style="font-weight:normal;">&raquo; To view delivery for UPS Ground <a href="http://www.ups.com/maps/results?zip=60174" style="text-decoration:underline;" target="_blank">Click here</a>
<br/>&raquo; USPS Priority Mail is slower than UPS Ground</span></th>
<?php }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment