All posts in Tutorials

Prevent WooCommerce Checkout for Add-on Products

Today’s Ask SkyVerge question comes from Ian (I’m paraphrasing it a bit though): Is there a way to prevent purchase if a customer only has certain products in the cart? I sell ink cartridges as add-ons for printers, but these should not be purchased alone. I tried using a grouped product, but a customer could only order cartridges or remove the main product from the cart. Can checkout require another Keep Reading…

Add Member Area Links to the Sidebar with WooCommerce Memberships

When a customer has at least one membership assigned or purchased via WooCommerce Memberships, the customer will be able to see the “My Memberships” table via the account dashboard. This lets your members see membership information, and if you have the member area enabled, members can get lists of their available content, products, and discounts. However, some sites use both Memberships and WooCommerce Subscriptions and may want to remove this Keep Reading…

Checking if the WooCommerce Cart Contains a Product Category

While many plugins treat all products as if they’re the same, your client may not want to for your store’s needs. For example, shop owners may want to show Checkout Field Editor fields only for certain product types, show a mailing list opt in for membership products only, or add a banner at checkout if a customer is purchasing an item from a specific category. As such, it can be Keep Reading…

How to Create a Simple WooCommerce Payment Gateway

This is post 8 of 8 in the series “Build a WooCommerce Extension” Within our series on building a WooCommerce extension, we’ve talked about using classes while building a widget and while creating a complex shortcode. Today we’ll take a look at building a simple WooCommerce payment gateway integration, as this will give us an opportunity to extend a WooCommerce class. WooCommerce gives you several core classes, such as payment Keep Reading…

Change the default WooCommerce External Product Button

This is an Ask SkyVerge question from Manuel: How can I change the add to cart button for external products? I need to use something besides “Buy product” for my external products. The good news here is that there’s already a setting for your WooCommerce external products to change the button text. When you edit the product, you can enter the button text while creating it, right after you enter Keep Reading…

Modifying Print Invoices and Packing Lists Templates

When our Print Invoices & Packing Lists rewrite was released, we talked about how customizing templates was modified. The goal of these changes was to make it far easier to modify templates in an upgrade-safe way so that they didn’t have to be overridden for changes to take effect. To that end, a more modular template approach was taken, along with the addition of ample WordPress hooks to allow changes Keep Reading…

Creating WooCommerce Memberships Menus for Members

One of our popular Woo Ideas for Memberships is the ability to create a menu for members. We’d examined this for version one of the plugin, but we weren’t crazy about included a lot of the commonly used menu restrictions in the core plugin, so it wasn’t included at launch. We also know that a lot of memberships sites have role-based menu restrictions in place to begin with, such as Keep Reading…

Setting minimum and maximum input values with Measurement Price Calculator

A frequent question I get from developers using our Measurement Price Calculator plugin is along these lines: Can I set minimum and maximum input values for measurements? At present, this isn’t possible because (1) a UI for measurement attributes would be a bit tough to do on the current product page without being confusing, and (2) the inputs for measurements are currently text fields, not number inputs. The reason for Keep Reading…

Limiting Members to One Membership with WooCommerce Memberships

When we built WooCommerce Memberships, one of the biggest requests we had from our surveys and beta testers was to build a plugin that would allow customers to have as many memberships as they wanted to purchase. This became one of the major decisions we made in the initial version, and any customer can have 0 or more memberships. However, some shops want to limit the number of memberships a Keep Reading…

WooCommerce Class Members Example: Create a WooCommerce Upsell Shortcode

This is post 7 of 8 in the series “Build a WooCommerce Extension” When building your first WooCommerce plugins, it’s a good idea to look at other extensions or WooCommerce core itself for ideas. You’ll notice that many of them take an OOP (object-oriented programming) approach. Rather than being composed solely of functions that take in data, use some logic to manipulate the data, then output data, the code focuses Keep Reading…