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

What’s Worse?

What’s worse than these dang North Florida love bugs? Having a poor website, for one. A website should be like the dream employee . It should never call in sick, treat your customers properly and get them the information and the attention the require each and every time.

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

WP: Adding a HTML5 Search Form

A simple script from your local Gainesville Web Designer. [code scroll=”false” language=”htmml”] <form role=”search” method=”get” class=”search-form” action=”<?php echo home_url( ‘/’ ); ?>”> <label> <span class=”screen-reader-text”><?php echo _x( ‘Search for:’, ‘label’ ) ?></span> <input type=”search” class=”search-field” placeholder=”<?php echo esc_attr_x( ‘Search …’, ‘placeholder’ ) ?>” value=”<?php echo get_search_query() ?>” name=”s” title=”<?php echo esc_attr_x( ‘Search

SEO is No Big Secret

Really, SEO is not some big secret. Some companies try to pretend it is but you don’t have to be an expert to manage your own SEO. What do you think search engines like Google want? Well, they want what their users’ want. That’s how they get business,

A Little ZipBamBoom From Livewire and You’re #1

Performance Transmission came to us in need of a Gainesville SEO Expert. Luckily, we have one of those and loan him out on occasion. They had tried other SEO tactics and were just not seeing the results they needed. No matter what they were doing they couldn’t jawbone

Maintaining The Correct Keyword Density

Keyword density, by definition, is the number of times, expressed in a percentage, that a particular keyphrase or keyword appears in a body of text. So if your keyword appears 4 times and the number of words on the page is 200 then your keyword density is 2%.