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 );

More Web Design Blog Content

TOP 3 PROJECT MANAGEMENT TOOLS AND WHY THEY ARE SO IMPORTANT

Whether you are a Freelancer or a small business owner, you know the importance of an accurate project management, here are 3 of the best project management tools that can help you achieve your goals. 1.- Teamwork Projects Teamwork Projects is a cloud-based project management solution it allows you

Add YARPP to Custom Post Types: WordPress

A great little plugin for adding related posts to your blog has been around for a while: YARPP, Yet Another Related Posts Plugin. It’s fairly robust, for being free, but it does not natively support custom post types – a bummer. A quick way around this is to

Responsive Design and Why it is important for your Small Business Website

Responsive design provides users with quick seamless access to the same content regardless if they are using a smartphone, a tablet, or a laptop/desktop. “Web Design is responsive design, Responsive Wed Design is web design, done right.” – Andy Clarke A responsive design website responds to the device

Website Redesign Launch: Precon Tanks Gets a Modern Upgrade

We’re excited to announce the launch of the brand-new website for Precon Tanks — a leading manufacturer of precast concrete tanks and systems for the wastewater and stormwater industries. With decades of expertise and a reputation for quality and dependability, Precon needed a website that reflected their technical

New Website: Top Dawg Detection

Bed bug detection is a fascinating new business. Trained in a facility up north, these dogs are trained to detect even a single bed bug. Most of the business is certifying hotels and motels as “bed bug free”. These dogs are about 97% accurate and are fun to

Redirects & Canonical. What’s The Difference?

There is a lot of confusion about the difference between setting redirects and canonicalization. Here’s the deal. What a 301 says to search engines. Hello, Mr. Search Engine. My page has has moved, permanently, to this other address. If you will please remove my old domain from your