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

Netgear Routers Are Terrible

Why did we purchase this product for our office? What a mistake. Range on this router is about 4 feet before the signal drops off significantly. Speeds are sketchy and we experienced significant slowdown periods throughout the day. Connections lost – impromptu port disabling, you name it. If there

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

New Website for NWSF!

Northwest Seafood got hacked unfortunately. Being previous clients of ours we came to the rescue. The site was damaged beyond repair so our team of Gainesville Web Design experts took hold and gave them a brand new website in a matter of days. We always support our clients in

Small Business Sees A Rise In Cyber Threats

Come on, let’s all live in the real world: we’re all vulnerable. Really the only chance you have these days is to make it as difficult as possible for any potential hacker to get to your valuable data. First and foremost this means protecting your data in transit.

Local Search Listing Management on Google

Building a strong customer base in your local community has always been one of the most significant components in the success of a business. With over 50% of Google searches completed on mobile devices, it’s more important than ever that on-the-go users can locate your business fast through

How To Win Visitors And Influence Traffic

Is there anything more of a turn-off than a untrustworthy website? Not in our world. Increasing the trust in your website is key to making conversions (calls, emails…. sales … you know, money). There are a number of factors determining the level of trust on your website. Here’s