Home » Ecommerce » Code School: Woo Shipping Per Product Count Script

Code School: Woo Shipping Per Product Count Script

Here’s a little snippet that has been useful for woocommerce development. This regulates shipping charges from a simple fee based system to a fee per quantity output. We modified this to allow for a couple of different shipping charge options based on quantity – first by three’s and then free shipping if over 9 are purchased.

cart->get_cart_contents_count();

// if we have items that need shipping, round the quantity / 2 to the nearest whole number

// this produces tiered cost increases for every 2 items

if ( $cart_item_count > 1 ) {

$cost = ceil( $cart_item_count / 3 ) * $cost;

}
return $cost;

}

add_filter( ‘woocommerce_shipping_rate_cost’, ‘njengah_wc_shipping_cost_tiers’, 10, 2 );

web design north carolina

PHP Is Still King

Hypertext Preprocessor (PHP) is a popular server-side scripting language for building websites. Around 70% of all websites online today use PHP, a computer language that was created in 1994 by Rasmus Lerdorf. Since it is available for everyone to use and alter, PHP is known as an open-source

Are You Using Linkedin Like You Should?

Probably not. Linkedin is a valuable resource for any professional, but particularly freelancers and business owners. There is a lot to love about the social media construct, and a lot to hate; but no matter what side of the coin you fall on it is no secret that you

You get 15 seconds! Web Design Trends for 2016

Mobile is in and users are becoming increasingly impatient. In 2014, 55% of users spent less than 15 seconds on a webpage according to data by Tony Haile of Chartbeat.  This means you only have 15 seconds to capture a users attention and convert a visitor to a customer.

Bed Bug Guru Has a New Website

New website up and running. This turned out to be a rush job so it is actually a work in progress. Their business is opening in a few days and they needed something up quickly that was still professional. Glad they called Livewire. We cooked up a great

Understanding Image Optimization

Image optimization is complicated and a multi-tiered process that takes months of study and practice. Just kidding. It’s easy. First, make sure you’re images aren’t huge. Most digital devices take pictures in high resolutions and most stock photos come that way. Always size your images to the exact

Review: Google Chrome – StayFocusd ★★★★★

We. Love. This. Chrome extension. Warning: It’s brutal. Stayfocusd is essentially a task manager, not as in manage what task is next, but keeps you focused on your tasks at hand. It blocks websites that waste your time and keep you distracted through a time limit feature. You