PHPackages                             joanrodas/custom-product-fields - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. joanrodas/custom-product-fields

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

joanrodas/custom-product-fields
===============================

Add custom fields to WooCommerce products, CPT, terms, users and more, programatically and with ease.

v0.1.13(11mo ago)2751[1 issues](https://github.com/joanrodas/custom-code-fields/issues)[5 PRs](https://github.com/joanrodas/custom-code-fields/pulls)GPL-3.0+PHPPHP &gt;=7.4

Since Nov 6Pushed 11mo ago1 watchersCompare

[ Source](https://github.com/joanrodas/custom-code-fields)[ Packagist](https://packagist.org/packages/joanrodas/custom-product-fields)[ Docs](https://github.com/joanrodas/custom-code-fields)[ RSS](/packages/joanrodas-custom-product-fields/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)DependenciesVersions (23)Used By (0)

[![GitHub stars](https://camo.githubusercontent.com/cfcdad52119787b360517a29a0490dad12cc37cbdabc776a94d427093af4b93b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6a6f616e726f6461732f637573746f6d2d636f64652d6669656c64733f7374796c653d666f722d7468652d6261646765)](https://github.com/joanrodas/custom-code-fields/stargazers)

Product fields library for WooCommerce developers.

✔️ Custom fields integrated with WooCommerce fields
✔️ Easily extendable with hooks

Getting started
---------------

[](#getting-started)

`composer require joanrodas/custom-code-fields`

> You can also install Custom Product Fields as a standalone WordPress plugin, simply downloading the zip and placing it in the plugins folder.

Examples
--------

[](#examples)

```
use CCF\Section\ProductSection;
use CCF\Field\Field;
use CCF\Field\RepeatableField;

add_action('ccf_register_fields', function () {
	ProductSection::create('section_slug', 'Section name', [
		Field::create('text', 'text_field', 'Text Field')
			->default_value('default')
		Field::create('textarea', 'textarea_field', 'Textarea Field'),
		Field::create('switch', 'switch_field', 'Switch Field'),
		Field::create('checkbox', 'checkbox_field', 'Checkbox Field'),
		Field::create('number', 'number_field', 'Number Field')
			->min(3)
			->max(23.5)
			->step(0.1)
			->set_datalist([1,2,5,10,15]),
		Field::create('html', 'html_inside', 'Inside html')
				->html('Bold text'),
		Field::create('select', 'select_field', 'Select Field')->set_options('add_select_options'),
		Field::create('rich_text', 'rich_text_field', 'Rich Text Field'),
		RepeatableField::create('repeatable_field', 'Repeatable Field', [
			Field::create('password', 'password_inside', 'Inside password'),
			Field::create('url', 'url_inside', 'Inside url')
				->set_datalist(['https://plubo.dev']),
			Field::create('time', 'time_inside', 'Inside time')
				->set_datalist(['10:20']),
			Field::create('date', 'date_inside', 'Inside date')
				->set_datalist(['2023-02-02', '2023-02-01']),
			Field::create('color', 'color_field', 'Color Field')
				->set_datalist(['#ffdede', '#f3d4de']),

		]),
	])
		->if_tab('general')
		// ->if_product_type(['simple', 'variable'])
		// ->if_checked('virtual')
		;
});

function add_select_options() {
	return [
		'option_1' => 'Option 1',
		'option_2' => 'Option 2',
		'option_3' => 'Option 3',
		'option_4' => 'Option 4'
	];
}
```

Contributions
-------------

[](#contributions)

[![contributions welcome](https://camo.githubusercontent.com/0af13358db374a6151b58b9c4a052888205edd34b8d4f8f42a3e9f35b3a018bb/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f6e747269627574696f6e732d77656c636f6d652d627269676874677265656e2e7376673f7374796c653d666f722d7468652d6261646765)](https://github.com/joanrodas/custom-code-fields/issues)[![GitHub issues](https://camo.githubusercontent.com/6e340473d5863cd7ae83fc55e5c5a80cb2bd5536c17df5c4c8b454876b37292e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f6a6f616e726f6461732f637573746f6d2d636f64652d6669656c64733f7374796c653d666f722d7468652d6261646765)](https://github.com/joanrodas/custom-code-fields/issues)[![GitHub license](https://camo.githubusercontent.com/b3586f97e580c677a41b5647eb0069f9672ba31f41ab5aefc5675493efb89d75/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6a6f616e726f6461732f637573746f6d2d636f64652d6669656c64733f7374796c653d666f722d7468652d6261646765)](https://github.com/joanrodas/custom-code-fields/blob/main/LICENSE)

Feel free to contribute to the project, suggesting improvements, reporting bugs and coding.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance45

Moderate activity, may be stable

Popularity13

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 91.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~73 days

Total

14

Last Release

331d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5029e0ad5278b4e3cdd5cebcc2ae0d2cb93698cd76f4afeb5fcc831ab1dfda10?d=identicon)[joanrodas](/maintainers/joanrodas)

---

Top Contributors

[![joanrodas](https://avatars.githubusercontent.com/u/47475754?v=4)](https://github.com/joanrodas "joanrodas (54 commits)")[![Albert-Sirvelia](https://avatars.githubusercontent.com/u/99665859?v=4)](https://github.com/Albert-Sirvelia "Albert-Sirvelia (4 commits)")[![alexSirvelia](https://avatars.githubusercontent.com/u/114874940?v=4)](https://github.com/alexSirvelia "alexSirvelia (1 commits)")

---

Tags

wpfieldsproductscustom fieldcode field

### Embed Badge

![Health badge](/badges/joanrodas-custom-product-fields/health.svg)

```
[![Health](https://phpackages.com/badges/joanrodas-custom-product-fields/health.svg)](https://phpackages.com/packages/joanrodas-custom-product-fields)
```

###  Alternatives

[roots/bedrock

WordPress boilerplate with Composer, easier configuration, and an improved folder structure

6.5k441.8k2](/packages/roots-bedrock)[ffraenz/private-composer-installer

A composer install helper for private packages

2331.7M5](/packages/ffraenz-private-composer-installer)[vinkla/extended-acf

Register advanced custom fields with object-oriented PHP

503264.8k11](/packages/vinkla-extended-acf)[gregwar/formidable

Formidable, the pragmatic forms library

12062.2k1](/packages/gregwar-formidable)[doublesecretagency/craft-inventory

Take stock of your field usage.

70125.6k1](/packages/doublesecretagency-craft-inventory)[terminal42/contao-conditionalformfields

conditionalformfields extension for Contao Open Source CMS; Display form fields based on conditionis!

2168.5k1](/packages/terminal42-contao-conditionalformfields)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
