How you doing?
It’s a busy summer Wednesday here in Sicily… I apologize for missing the last two newsletters – I’ve got very used to my time off. I hope I’m able to get back to full time in September… it will be very hard!
Anyhow, welcome back to WCWeekly – in this “Beach Edition” I will cover one WooCommerce topic, so that you can improve your knowledge around that.
Stay safe and be happy!
The Importance of “Getting” The Values You Need
The most difficult thing (at least at the very beginning of someone’s WooCommerce dev career), is “getting” stuff. What I mean, for example, is “getting the product title”, “getting the order total”, “getting the cart items”, and so on.
Basically, based on where you are in WooCommerce (backend / frontend) and what you need (cart, order, product info), you always need to find a way to “get” what you need.
Thankfully, WooCommerce came up with “getters” PHP function. These are coded so that you can “get” whatever you like from inside a PHP variable. If you “have access” to the $order variable, you can “get the order billing address”. If you have access to the $product variable, you can for example “get the product price”. And so on…
Because remembering all these getters is impossible, I built three developer tutorials, one for each “section”:
- https://businessbloomer.com/woocommerce-easily-get-product-info-title-sku-desc-product-object/
- https://businessbloomer.com/woocommerce-easily-get-order-info-total-items-etc-from-order-object/
- https://www.businessbloomer.com/woocommerce-get-cart-info-total-items-etc-from-cart-object/
URLs should be self-explanatory. If you customize WooCommerce, even a little, even if you’re a beginner, sooner or later you’ll need to bookmark these 3 resources.









