Adding a Fee in Woocommerce

This piggybacks off of a solution I found elsewhere. We modified it to add a single fee for products based on the taxonomy. It comes in handy to categories products and then apply this rule to that category.

function action_woocommerce_checkout_calculate_fees( $cart ) {

// Initialize
$quantity = 0;
$hasfee = 0;
$fee = 0;
// Loop though each cart item
foreach ( $cart->get_cart() as $cart_item ) {
// Compare
$quantity = 0;
$product_id = $cart_item[‘product_id’];
$quantity = $cart_item[‘quantity’];
$taxonomy = ‘product_tag’;
if( has_term( ‘Embroidery’, $taxonomy, $product_id ) ){
if( !has_term( ‘NOE’, $taxonomy, $product_id ) ){
// Addition
// Get product quantity in cart
$hasfee = 1;
$fee = $fee + (4.99 * $quantity);
}
}
}
if($hasfee == 1){
$cart->add_fee( __( ‘Embroidery Fee’, ‘woocommerce’ ), $fee );
}

}
add_action( ‘woocommerce_cart_calculate_fees’, ‘action_woocommerce_checkout_calculate_fees’, 10, 1 );

 

How To Survive A Good Google Dinging

This is a great demonstration of what can happen with unnatural linking schemes and getting hosed by using link farms. This company did some black-hat SEO and it came back to bite them. Luckily the article shows that it is possible to recover from a Google update nightmare, but

Updating WordPress Database After Website Move

Boy life sure would be easy if WordPress used relative URL’s throughout the menu and post content but that simply isn’t going to happen, they’ve made that clear. Changing the URL in the admin Settings would then be all you need to do, making moving installations a breeze.

No Business is too Small for Mobile

No matter how small your business is, you need to be on mobile. There are more mobile users these days than traditional desktop/laptop users, so the benefit is apparent. If your website is not mobile ready, you are at a distinct disadvantage. First, the user will probably have

Review: Total Cache WordPress Plugin ★★★★

An easy plugin for WordPress that does all your caching for you automatically. What is caching? A cache essentially takes a screenshot of your page and keeps it in local memory. When that page is called (by a user visiting it) then it is called up from the

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.

Sitemaps

Back in the day a simple website could get away with an on-page sitemap. Just a simple list of pages somewhere on the site. Not so much anymore. Sitemaps – at least the ones we intend for search engines to look at – are all internal. We use