Skip to content

Instantly share code, notes, and snippets.

View raajtram's full-sized avatar
✈️
On the go, always.

Raaj Trambadia raajtram

✈️
On the go, always.
View GitHub Profile
@raajtram
raajtram / free-item-shipping.php
Created April 13, 2017 14:59 — forked from helgatheviking/free-item-shipping.php
Remove certain items from shipping calculations
function remove_free_shipping_items( $packages ) {
foreach( $packages as $i => $package ){
foreach ( $package['contents'] as $key => $item ) {
if ( $item['data']->get_shipping_class() == 'free' ) {
unset( $packages[$i]['contents'][$key] );
add_filter( 'woocommerce_cart_needs_shipping', '__return_true' );
@raajtram
raajtram / acfextra-google-maps.php
Created May 23, 2016 13:10
Google Maps Snippet (ACF Extras)
<?php
function page_map_sc() {
ob_start(); ?>
<?php if( get_field('my_map') ): ?>
<iframe width="600" height="450" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.ca/maps?center=<?php the_field('my_map'); ?>&q=<?php the_field('my_map'); ?>&z=14&size=600x450&output=embed&iwloc=near"></iframe>
<?php endif; ?>
<? $output = ob_get_clean();
return $output;
}