I’ve worked with PHP for 20+ years now, and WordPress for 15+, they have become a comfort area for me. With the life changes I’ve been presented with I am faced with a choice to remain in my comfort zone or to learn something new.

Over the past few weeks I’ve been looking at different online courses available to use to progress my knowledge and start engaging my brain. The one I chose to try out and work with is https://boot.dev . My primary course is going to take me through Python and into TypeScript. There’s lots of stuff in between like Linux and Git management, with a splash of Docker. With the exception of Python, a lot of it will be stuff I’ve already worked with for several years now, I am just hoping to pick up some more tricks for my bag.

I started yesterday and completed 56 lessons. I really like how their lessons are set up, they teach you something small, then give you a coding activity to complete. It helps solidify the knowledge in your brain. It’s completely gamified, as well. As you progress you earn resources that you can then use for things like getting help from from Boots, your AI companion.

Their highest level you can reach is the Archmage, and I’ve made it a goal to reach that level.

Typically with eCommerce payment is collected, well, electronically. Sometimes though, you need to collect cash in hand, which is why WooCommerce comes with the Cash on Delivery gateway.

Typically if this gateway is used with WooCommerce Bookings, the bookings created will sit in an Unpaid status until they are manually updated by the store admin. Where this works for some, it does not work for all. So here comes the star of this post, the snippet:

This snippet takes code straight from Bookings itself and processes orders a second time only if they have COD as their payment method. It will put the associated bookings into a Confirmed status automatically. It also includes a filter to check to make sure the booking hasn’t already been set to Paid or Completed to make sure those statuses stay intact.

Hey kiddos! It’s been awhile, sorry about that!

Today we have a snippet that can be useful to so many people for different reasons. This one will add a BCC to emails you specify in WooCommerce, and here it is:

The emails you’d like to have the BCC added to are set in the $add_bcc_to array. There are a couple other examples that are already there. 99.9% of the time it’s really easy to get this name from the email settings in WooCommerce. Just go to the email settings for the email you want, then grab everything after _email_ in the address bar. In the below example we want customer_renewal_invoice:

screen-shot-2016-10-31-at-13-25-19

You, of course, need to update your email address, as well.

There are many instances where you may have virtual products in your store, or even every product may be virtual. There are snippets and plugins out there that cater to all orders, or certain orders… and this is just going to be another one of those.

This one will go through each line item in a new order, check that line item to see if it is a variation or a product, then check to see if that variation or product is virtual or not. If one line item in the order is not virtual, it exits. However, if every line item in the order is virtual, it sets the order to completed status.

Have fun, kiddos!

I had an interesting question come up earlier, I was asked why WooCommerce didn’t charge sales tax even though everything was set up correctly.

Let’s say the zip code entered for tax was 34480, and the tax rate is 6%. So, when you test, you enter in 34480 and the tax is calculated. What happens if you have a clever customer that enters in their full zip code with the additional four digit code, like so 34480-7107? WooCommerce will charge no tax.

Why? Well, to put it simple, it didn’t match. The way around this is when you’re entering in your zip codes, enter them in with a * on the end, like so 34480*. Tada!