A WordPress plugin that integrates with the Print.com API to enable custom print-on-demand products in WooCommerce stores. Configure, edit, and sell custom printed products seamlessly through your WordPress/WooCommerce site.
- π¨οΈ Print.com API Integration - Direct connection to Print.com's print-on-demand services
- π¨ Product Configuration - Connect your product to a Print.com and we will take care of the fulfilment
- π¨ Order Synchronization - Automatically receive track-and-trace data from Print.com
-
Clone the repository:
git clone https://github.com/printdotcom/pdc-pod.git cd pdc-pod -
Run composer
composer dump-autoload
-
Start the development environment:
# Start WordPress with PHP 8.2 and WordPress 6.8 bin/run-wordpress 68 82 -
Optionally Seed WooCommerce with sample data:
# Configure WooCommerce and create sample products bin/seed-woocommerce 68 82 -
Optionally use the mock api:
# Configure WooCommerce and create sample products
bin/run-mock-api start- Access your site:
- Frontend: http://localhost:8068
- Admin: http://localhost:8068/wp-admin (admin/password)
| Command | Description | Example |
|---|---|---|
bin/run-wordpress [WP_VER] [PHP_VER] |
Start WordPress environment | bin/run-wordpress 68 82 |
bin/stop-wordpress [WP_VER] [PHP_VER] |
Stop WordPress environment | bin/stop-wordpress 68 82 |
bin/seed-woocommerce [WP_VER] [PHP_VER] |
Seed WooCommerce with sample data | bin/seed-woocommerce 68 82 |
bin/run-mock-api {start|stop|status} |
Manage Print.com Mock API | bin/run-mock-api start |
Check config/wp-version.conf for available WordPress/PHP combinations:
# WordPress 6.7 with PHP 7.0
bin/run-wordpress 67 70
# WordPress 6.8 with PHP 8.2 (if available)
bin/run-wordpress 68 82The port format is 80[WORDPRESS_VERSION]:
- WordPress 6.7:
http://localhost:8067 - WordPress 6.8:
http://localhost:8068
- Navigate to WordPress Admin β Print.com β Settings
- Enter your Print.com API credentials:
- API Key
- API Secret
- Environment (Sandbox/Production)
This project follows:
- WordPress Coding Standards
- WordPress Documentation Standards
- Conventional Commits for commit messages
When you add new strings that need translation in your PHP code:
-
Regenerate the POT template file:
wp i18n make-pot . languages/pdc-pod.pot -
Update existing PO files with new strings:
wp i18n update-po languages/pdc-pod.pot
-
Translate the new strings in each
.pofile using Poedit or a text editor -
Compile translations to MO files:
wp i18n make-mo languages
When you want to add a new language:
-
Create a new PO file from the template:
cd languages cp pdc-pod.pot pdc-pod-[LOCALE].poReplace
[LOCALE]with the WordPress locale code (e.g.,es_ESfor Spanish,it_ITfor Italian) -
Update the PO file header with language information:
- Set
Language-TeamandLanguagefields - Add appropriate plural forms for the language
- Set
-
Translate all strings using Poedit or manually edit the
msgstrvalues -
Compile to MO file:
wp i18n make-mo languages
pdc-pod/
βββ admin/ # Admin-specific functionality
β βββ AdminCore.php # Main admin class
β βββ PrintDotCom/ # Print.com API integration
β β βββ APIClient.php # API client
β β βββ Product.php # Product model
β β βββ Preset.php # Preset model
β βββ css/ # Admin stylesheets
β βββ js/ # Admin JavaScript
β βββ partials/ # Admin template partials
βββ bin/ # Development scripts
β βββ run-wordpress # Start WordPress environment
β βββ stop-wordpress # Stop WordPress environment
β βββ seed-woocommerce # Seed WooCommerce data
βββ config/ # Configuration files
β βββ docker-compose.yml # Docker Compose configuration
β βββ wp-version.conf # WordPress/PHP version mapping
βββ includes/ # Core plugin files
β βββ Core.php # Main plugin class
β βββ Activator.php # Plugin activation
β βββ Deactivator.php # Plugin deactivation
β βββ Loader.php # Hook loader
βββ front/ # Public-facing functionality
β βββ FrontCore.php # Main public class
βββ vendor/ # Composer dependencies
The project uses PSR-4 autoloading via Composer:
{
"autoload": {
"psr-4": {
"PdcPod\\Admin\\": "admin/",
"PdcPod\\Front\\": "front/",
"PdcPod\\Includes\\": "includes/"
}
}
}Running automated unit tests via phpunit is possible through:
bin/test-unitWhen working locally or running end-2-end tests, the mock-api via wiremock will mock the Print.com API.
# Start the mock API
bin/run-mock-api startSee test/wiremock/README.md for detailed documentation.
bin/create-dist- Fork the repository
- Create your feature branch (
git checkout -b feat/amazing-feature) - Open a Pull Request
- Documentation: Print.com Developer Docs
- Issues: GitHub Issues
- Email: devops@print.com
See CHANGELOG.md for a detailed history of changes.
Made with β€οΈ by the Print.com team