WooWeekly #453: Second Last Order | Payments By Product Type

Hello there,

Welcome back to WooWeekly, your weekly appointment with WooCommerce tutorials, tips and updates handpicked for you (and the other 17,602 subscribers) so that you can learn something new.

We’ve had crazy temperatures here in Sicily this week (44°C / 111°F yesterday), together with hundreds of devastating fires. Both airports suffered major problems; internet, electricity and water went awol; traffic everywhere. Thankfully, we stayed away from all of this (and almost burnt the air-con motor), and we made it. I heard of Greece as well, I think it was even worse there. Let’s hope for this madness to end asap.

Anyhow, here are this week’s WooCommerce tips – enjoy.

Rodolfo Melogli


GoDaddy PRO WordPress Ecommerce hosting with WooCommerce gives you the freedom to sell anything, anywhere online – from physical products to digital downloads, services and subscriptions. We’ve integrated WooCommerce into our Managed WordPress platform where you can choose from over 75 premium WooCommerce extensions included in your plan for as long as you host your ecommerce store with us. That’s nearly $6,000 in free premium extensions — at no extra charge — to build a powerful, customized ecommerce store.

1. WooCommerce Tips & Updates

WooCommerce: Get Customer Second Last Order

There is a native, handy way to get a WooCommerce customer’s last order. This time, I want to write some custom code to get the second last order instead. We will indeed reuse most of the above function code and change it slightly. ~ Rodolfo Melogli, Business Bloomer

WooCommerce: Disable Payment Gateway By Product Type

Ever wondered if you could toggle payment gateways based on whether a given “product type” is in the WooCommerce Cart? For example, disable PayPal if there are simple subscription products, or enable Stripe only when there are variable products? ~ Rodolfo Melogli, Business Bloomer

10 Hobbies that make money

No matter why you picked up your hobby, you’ve probably had that one fleeting thought: “I wonder if I could make some money from this?” There is a wide range of hobbies that make money, so there’s a pretty good chance that there’s some market for your niche skills. ~ Nexcess

Google Automated Discounts for WooCommerce

SweetCode has launched the Google Automated Discounts plugin for WooCommerce, enabling automatic discounts for Google Shopping campaigns. Despite high setup requirements, the plugin simplifies the process, potentially boosting sales and revenue. SweetCode also offers an implementation service for businesses needing assistance with the setup. Aleksandar Vucenovic, SweetCode

2. ICYMI: WooCommerce Articles

WooCommerce: Anonymize All Users & Orders

Especially when you need to let other people (such as developers) log in to your WooCommerce website, you may want to protect the identity of your customers and your order details. ~ Rodolfo Melogli, Business Bloomer

WooCommerce: Get Product / Order Cross-Sells

Getting the list of cross-sells for a WooCommerce product is actually super easy (yes, it’s one line of PHP). But what if you need to “calculate” the list of cross-sells for an entire order, made of different products? ~ Rodolfo Melogli, Business Bloomer

WooCommerce: My Account Registration Anti-Spam Honeypot

Here’s my personal attempt to fight against the WooCommerce My Account Page registration spam, without installing yet another captcha plugin. I’m pretty sure this solution is not perfect, because spam bots are very “smart”, but it can help prevent most fake registrations. ~ Rodolfo Melogli, Business Bloomer

WooCommerce: See If Product ID Belongs To a Grouped Product

It may happen during your coding career that you need to know whether a given Product ID is part of a Grouped Product (so, it’s a “child” of a Grouped Product) – the snippet below will help with that. ~ Rodolfo Melogli, Business Bloomer

WooCommerce: Search Products By Custom Field (Backend)

Let’s say, as a WooCommerce store admin, that you’ve added a product custom field (e.g. “gtin“), and you want to make sure the backend search also returns products where “gtin” is equal to the search term. This snippet will help you do that. ~ Rodolfo Melogli, Business Bloomer

WooCommerce: Allow CSV Product Export By Tag

The default product export that you can find by clicking the “Export” button on the “Products” WordPress Dashboard screen, gives you the option to export all products to a CSV. You can also refine the list by product type and product category, so that you can export specific products only. What’s missing there is a “product tag” filter, so this workaround will let you define a product tag, and the export list will be automatically filtered by that. ~ Rodolfo Melogli, Business Bloomer

WooCommerce: Add to Cart Pre-defined Quantity Selectors

The WooCommerce Single Product Page add to cart form features a quantity input and an add to cart button. Now, let’s imagine you want to change this experience based on your business requirements, and instead of the quantity input and add to cart button you want to show 3 buttons: “Add 1 to the cart“, “Add 2 to the cart“, “Add 3 to the cart“. Let’s do it! ~ Rodolfo Melogli, Business Bloomer


Optimize the SEO of your WordPress site with SEOPress: titles and metas, xml & html sitemaps, social sharing, Analytics, Local SEO, WooCommerce SEO, automatic and manual schemas, Google News, Video sitemap, Search Console integration and so much more. Fully integrated with all page builders thanks to our Universal SEO metabox and now with AI for maximum productivity. Super easy to use, no coding required, white label, no ads. Already 300,000 active installations. Start ranking now!

Struggling to find the right words to describe your products? ProductWriter.ai is here to help. Our AI-powered tool uses your product data to generate engaging descriptions in seconds. Say goodbye to spending hours writing copy or hiring a copywriter. With ProductWriter.ai, you can generate product descriptions right within WooCommerce, no extra apps or websites are needed. Try it for free today!

Nexcess Managed WooCommerce hosting is fast, easy-to-use, and includes built-in performance tools like extra PHP workers and a global CDN, which means their hosting is fully optimized for selling online. Nexcess offers free migrations, a 30 day money-back guarantee, and helpful support from WooCommerce experts 24/7/365. They are even officially recommended by WooCommerce! If you’re a serious WooCommerce store owner who needs to sell without limits, get started today by visiting Nexcess.

Enjoyed this issue?

Well, congratulations for reading this far – you’re one of a kind! There are many ways you can support WooWeekly and help us spread the word. Thank you in advance!

Share ithttps://wcwkly.com/newsletter-archive/

Invite friendshttps://wcwkly.com

Leave a reviewhttps://www.businessbloomer.com/shop/newsletters/wooweekly-free/

Become a sponsor for as little as $97https://wcwkly.com/sponsors/


  • Rodolfo Melogli

    Author, WooCommerce expert and WordCamp speaker, Rodolfo has worked as an independent WooCommerce freelancer since 2011. His goal is to help entrepreneurs and developers overcome their WooCommerce nightmares. Rodolfo loves travelling, chasing tennis & soccer balls and, of course, wood fired oven pizza.

    View all posts

Leave a Comment

Proudly supported by

Join them?