• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Razworks Food Blog

Razworks Food Blog

  • Home
  • Contact Us

razworks

Woocommerce Free Shipping default selection

January 28, 2020 by razworks

When entering a coupon code for Free Shipping, the Free shipping option is not selected by default. A quick solution is to add a function that disables all other shipping options, leaving Free Shipping as the only available option.

Add this snippet to your functions file. It hides everything but free_shipping if it’s available and is compatible with Shipping Zones.

/**
* Hide shipping rates when free shipping is available.
* Updated to support WooCommerce 2.6 Shipping Zones.
*
* @param array $rates Array of rates found for the package.
* @return array
*/
function my_hide_shipping_when_free_is_available( $rates ) {
$free = array();
foreach ( $rates as $rate_id => $rate ) {
if ( 'free_shipping' === $rate->method_id ) {
$free[ $rate_id ] = $rate;
break;
}
}
return ! empty( $free ) ? $free : $rates;
}
add_filter( 'woocommerce_package_rates', 'my_hide_shipping_when_free_is_available', 100 );

Filed Under: Uncategorized

iOS specific CSS

April 10, 2019 by razworks

To target iOS specific devices:

@supports (-webkit-overflow-scrolling: touch) {
  /* CSS specific to iOS devices */ 
}

@supports not (-webkit-overflow-scrolling: touch) {
  /* CSS for other than iOS devices */ 
}

It works because only Safari Mobile implements -webkit-overflow-scrolling: https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-overflow-scrolling

I used this because a WordPress Genesis responsive menu had some icon alignment discrepancies on iPhone only.
Here is the example in a media Query:

/*** IOS mobile icon adjustments ***/
	@supports (-webkit-overflow-scrolling: touch) {
		/* CSS specific to iOS devices */ 
		.genesis-nav-menu.responsive-menu .menu-item-has-children li {
			position: relative;	
		}
		.genesis-nav-menu.responsive-menu .menu-item-has-children > a {
			margin-right: 0;
		}
		
		.genesis-nav-menu.responsive-menu > .menu-item-has-children:before {
			content: "\f347";
			position:absolute;
			left:80%;
			float: none;
			font: normal 16px/1 'dashicons';
			height: 16px;
			padding: 15px 20px;
			right: 0;
			text-align: right;
			z-index: 9999;
			color:#fff;
		}
		
		.genesis-nav-menu.responsive-menu .menu-open.menu-item-has-children:before {
			content: "\f343";
		}
		.genesis-nav-menu.responsive-menu li a {
			font-size:30px;
			font-size:3.0rem;
		}

	  }

 

Filed Under: Web Dev, Wordpress

Gravity Forms Google Analytics tracking in Tag Manager

February 1, 2019 by razworks

Step 1:

Create a formID datalayer variable

tag-manager-gravity-forms-formid-datalayer-variable
tag-manager-gravity-forms-formid-datalayer-variable

Step 2:

Create custom HTML tag, to push Gravity Forms into the datalayer:

tag-manager-gravity-forms-html-tag-datalayer-push
tag-manager-gravity-forms-html-tag-datalayer-push
<script type="text/javascript">
 jQuery(document).ready(function() {
   jQuery(document).bind("gform_confirmation_loaded", function(event, formID) {
     window.dataLayer = window.dataLayer || [];
     window.dataLayer.push({
       event: "formSubmission",
       formID: formID
     });
   });
 });
</script>

Step 3:

Create Trigger for Gravity Forms:

tag-manager-gravity-forms-trigger

Step 4:

Create Form Event Tag:

tag-manager-gravity-forms-tag-event
tag-manager-gravity-forms-tag-event

Filed Under: Music

SSL htaccess redirect

December 26, 2018 by razworks

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Filed Under: Web Dev

Outstanding Volunteer Award

November 5, 2018 by razworks

outstanding-volunteer/

Michael Rassel was presented with the “Outstanding Adult Volunteer Award” by Sarasota County, for volunteering weekly as an elementary school chess coach in 2008-2011.

Filed Under: Michael-Rassel

About Razworks

October 16, 2018 by razworks

Razworks is a company founded Michael Rassel in Sarasota, FL in  2002. Michael is a 3D animator and web/game programmer, originally hailing from Minneapolis, MN. As a realtime 3D developer in New York City, Michael worked on web 3D projects for clients such as Sony, Nike, and IBM. Michael managed a team that won a Comminator award for a Hewlett Packard web 3D application.

Dedicated to serving family and the local community, Michael was recognized with Sarasota County’s “Outstanding Adult Volunteer Award”, for volunteering weekly as an elementary school chess coach in 2008-2011. And he continues serving in 2018 as a volunteer coach for U19 recreational soccer in the FCSarasota soccer league.

Filed Under: Uncategorized

  • Go to page 1
  • Go to page 2
  • Go to page 3
  • Interim pages omitted …
  • Go to page 7
  • Go to Next Page »

Primary Sidebar

Recent Posts

  • Woocommerce Free Shipping default selection
  • iOS specific CSS
  • Gravity Forms Google Analytics tracking in Tag Manager
  • SSL htaccess redirect
  • Outstanding Volunteer Award

Footer

Breakfast

Breakfast

Dinner

Dinner

Grilling

Grilling

Copyright © 2021 · Genesis Sample on Genesis Framework · WordPress · Log in