Software Engineering in WordPress, PHP, and Backend Development

Tag: WooCommerce (Page 2 of 2)

Programmatically Add a WooCommerce Variable Product

Adding a custom WooCommerce variable product isn’t something that’s terribly difficult given the hooks that WooCommerce provides, but there’s always a bit of context that helps when giving an example like this, right?

Last week, I shared a small bit of a code that shows how to add a custom input field to a WooCommerce product. And in that post, one of the things I shared what how I like how easy it is to create UI elements using server-side logic.

WooCommerce Variable Product: Creating the UI

And working with variable products is no different. It is, however, a matter of using a different hook.

Continue reading

Creating Custom WooCommerce Input Field

I’ve been working on a project that introduces a few new options into a standard WooCommerce installation, and one of the features calls for adding a custom WooCommerce input field.

WooCommerce

In WordPress, creating settings pages has its process. That is, you create the necessary options group (if needed), settings fields, values, and so on. You introduce any markup that’s needed, validation, sanitization, and so on.

And all of that is needed when it comes to working with WooCommerce, but one of the things that I like is how the API for the plugin supports creating input fields with server-side logic.

Continue reading

Newer posts »

© 2024 Tom McFarlin

Theme by Anders NorenUp ↑