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

More Web Design Blog Content

Why is a short domain name better than a long one?

There are several reasons why a short domain name is generally considered better than a long one: Easier to remember: Short domain names are easier to remember than long ones, which makes it easier for people to find and return to your website. More professional: Short domain names

SEO Update: American Metals

Since SEO is our specialty – we know what it takes to put a website on page 1. When American Metals came to us they were back past page 10 for a lot of their keywords and getting about 50 users per month on average on the website.

Using Red In Website Design

A key component of website design is color, and many designers choose the color red in particular. Red is a passionate, vivid color that may elicit strong feelings and emotions, making it a fantastic choice for designing a strong, compelling website. These are several justifications on why red

Web Marketing Staff Training

How easy is it for one to do their own SEO? Difficulty level: 5 out of 10 If you know how to use a computer and can spare 3-5 hours per week then it is perfectly reasonable to expect you can do your own SEO and save hundreds

web design north carolina

B2B Social Marketing

Social media marketing is usually not as important for business-to-business (B2B) businesses because most of their customers find them through word-of-mouth or a lot of online searching. Many B2Bs are also in ‘dry’ or serious businesses that don’t work well with pictures. But a social media marketing plan

Five Frequent SEO Mistakes and How to Fix Them.

Five Frequent SEO Mistakes and How to Fix Them. A few simple missteps can derail all the hours of toil, not to mention money, put into your SEO efforts. Here are five common SEO mistakes and how to rectify them.  Keywords Should Match Content. Google wants its customers