Skip to main content

Mage2Plenty v2.0 - Major Architecture Overhaul & PHP 8.4 Support

ยท 8 min read
Soft Commerce Team
Mage2Plenty Development Team

We're excited to announce the release of Mage2Plenty v2.0, our most significant update yet. This major release brings PHP 8.4 compatibility, massive architectural improvements, and a streamlined codebase that's easier to maintain and extend.

๐ŸŽฏ Why v2.0 Mattersโ€‹

After months of development, v2.0 represents a complete modernization of the Mage2Plenty connector. We've consolidated 15 modules, implemented cutting-edge PHP 8 features, and introduced powerful new capabilities that make integration smoother than ever.

๐Ÿ—๏ธ Architectural Revolution: Module Consolidationโ€‹

The Problem We Solvedโ€‹

Previously, our codebase was fragmented across 36+ modules. While modular, this created unnecessary complexity:

  • Difficult dependency management
  • Increased maintenance overhead
  • Confusing for new developers
  • Redundant code across modules

The Solution: Smart Consolidationโ€‹

We've merged 15 specialized modules into their parent modules, reducing our module count from 36 to 21:

Before v2.0:                      After v2.0:
module-plenty-item module-plenty-item
โ”œโ”€โ”€ module-plenty-item-rest-api (consolidated)
โ”œโ”€โ”€ module-plenty-item-client (consolidated)
โ””โ”€โ”€ module-plenty-item-profile module-plenty-item-profile
โ””โ”€โ”€ -profile-schedule (consolidated)

This consolidation brings:

  • Simpler dependency trees - Fewer inter-module dependencies
  • Better performance - Reduced autoloading overhead
  • Easier maintenance - Related code lives together
  • Cleaner APIs - Unified interfaces in Api/* namespace

๐Ÿš€ Key Features & Improvementsโ€‹

1. Comprehensive Admin Notification Systemโ€‹

A new enterprise-grade notification system provides complete visibility into all profile operations:

Features:

  • Real-time notification grid with severity levels (Debug, Notice, Warning, Error, Critical)
  • Process execution summaries with performance metrics
  • Detailed error context including stack traces and entity IDs
  • Bulk management actions for handling multiple notifications
  • Email alert integration for critical issues

Access via System โ†’ Profile Notifications or directly from any profile's Notifications tab. This system ensures you never miss critical synchronization issues and can quickly diagnose problems.

2. Intelligent Setup Wizard & Auto-Configurationโ€‹

Setting up Mage2Plenty has never been easier with our new automated configuration system:

Setup Wizardโ€‹

Available through both CLI and Admin UI, the setup wizard handles:

  • Automatic configuration collection from PlentyONE
  • System property creation
  • Initial mapping suggestions
  • Connection validation
# Complete setup via CLI
bin/magento plenty:setup:init

# Or use the Admin UI
System > Integration > PlentyONE > Setup Wizard

Profile Auto-Configurationโ€‹

After initial setup, profiles intelligently detect missing configuration and offer automatic configuration through the Admin UI:

  • Automatic detection - When you open a profile that's missing required configuration, a modal automatically appears
  • Smart suggestions - Generates appropriate mapping recommendations based on your existing data
  • One-click configuration - Apply suggested configurations instantly
  • Validation - All suggestions are validated before being applied

Simply navigate to any profile in the Admin UI, and if configuration is missing, the auto-configuration modal will guide you through the setup process.

3. Real-Time Progress Trackingโ€‹

All CLI commands now feature entity-level progress bars showing exactly what's being processed:

bin/magento plenty:item:import

Processing items...
1247/5000 [=======>--------------------] 24% 2 mins/8 mins 45.2 MiB Processing: Item #8369

This provides:

  • Accurate time estimates
  • Memory usage monitoring
  • Current entity being processed
  • Overall progress percentage

4. Flexible Product Identifier Mappingโ€‹

For advanced use cases, you can now use any custom attribute as the product identifier for synchronization:

// Configure in Admin Panel
Product Identifier Field: "manufacturer_part_number"

// Products sync using your chosen identifier
PlentyONE Variation: ABC123 โ†’ Magento Product: ABC123

This feature is particularly useful when:

  • Your ERP uses different identifiers than Magento SKUs
  • You need to maintain existing product codes
  • You're migrating from another system

Note: This is different from property-to-attribute mapping. This feature specifically controls which field is used as the unique product identifier for matching records between systems.

5. Advanced Inventory Managementโ€‹

v2.0 introduces powerful new inventory management capabilities that give you complete visibility and control over stock synchronization:

Improved Stock Reservation Calculationโ€‹

The new ReservationCalculator provides accurate quantity tracking across all sources, ensuring precise inventory counts for multi-source inventory setups.

Enhanced Product View Panelsโ€‹

PlentyONE Stock Sync Status Every product now displays a dedicated panel showing:

  • Last import/export processing timestamp
  • Quantity changes during last sync
  • Synchronization status and errors
  • Source-specific sync details

Inventory Reservations Panel Real-time visibility of reserved quantities:

  • Reserved quantity per source
  • Total quantity on hand summary
  • Reservation breakdown by order
  • Available-to-sell calculations

Comprehensive Stock Managementโ€‹

New Stock Listing (Catalog โ†’ Inventory โ†’ Stocks)

  • Complete stock overview with reservation details
  • Multi-source inventory tracking
  • Real-time quantity updates
  • Export capabilities for reporting

New Reservation Listing (Catalog โ†’ Inventory โ†’ Reservations)

  • All reservations with source code assignments
  • Order-level reservation tracking
  • Bulk management actions
  • Historical reservation data

Automatic Order Export Retryโ€‹

One of our most requested features - automatic retry for failed order exports. When PlentyONE servers experience downtime (which unfortunately happens frequently), the system now:

  • Automatically detects failed export attempts
  • Queues orders for retry with exponential backoff
  • Tracks retry attempts and failure reasons
  • Alerts administrators of persistent failures

This ensures no orders are lost due to temporary PlentyONE outages, providing peace of mind and reducing manual intervention.

6. Powerful CLI Utility Commandsโ€‹

New administrative CLI commands provide essential tools for managing synchronization and troubleshooting:

Map Order Relations (plenty:order:map) Establish relationships between Magento orders and PlentyONE orders, useful for migrations or fixing broken mappings.

Map Item Relations (plenty:item:map) Map product SKUs to PlentyONE Item and Variation IDs, essential for custom product identifier workflows.

Map Stock Relations (plenty:stock:map) Associate Magento stock sources with PlentyONE warehouses for accurate multi-source inventory tracking.

Show Profile Status (plenty:profile:status) Display comprehensive profile information including configuration status, schedule details, and recent execution history.

Purge PlentyONE Data (plenty:profile:purge) Safely remove synchronized data from local storage while maintaining integrity, useful for clean re-imports or testing.

These commands are invaluable for:

  • Initial setup and configuration verification
  • Troubleshooting synchronization issues
  • Data migration and cleanup
  • Testing and development workflows

7. Message Collector Systemโ€‹

Replaced the old message storage with a modern, centralized message collector that integrates with the notification system:

// Old way (deprecated)
$this->messageStorage->addMessage('Error occurred');

// New way with metadata
$this->messageCollector->addMessage(
'Error occurred',
MessageInterface::TYPE_ERROR,
['entity_id' => 123, 'sku' => 'ABC', 'variation_id' => 456]
);

8. Enhanced ProductDataRegistryโ€‹

Our new ProductDataRegistry replaces the old SkuPool with a powerful, state-aware caching system:

interface ProductDataRegistryInterface {
// Multiple lookup methods
public function getDataBySku(string $sku): ?array;
public function getDataByIdentifier(string $identifier): ?array;
public function getDataByVariationId(int $variationId): ?array;

// Import state tracking
public function isNewSku(string $sku): bool;
public function markAsProcessed(string $sku): void;
}

๐Ÿ’ป PHP 8.4 & Modern Codeโ€‹

Constructor Property Promotionโ€‹

Every module now uses PHP 8's constructor property promotion, reducing boilerplate by ~40%:

// Before (PHP 7.4)
class ItemImport {
private ItemRepository $repository;
private Logger $logger;

public function __construct(
ItemRepository $repository,
Logger $logger
) {
$this->repository = $repository;
$this->logger = $logger;
}
}

// After (PHP 8.4)
class ItemImport {
public function __construct(
private ItemRepository $repository,
private Logger $logger
) {}
}

Enhanced Type Safetyโ€‹

Readonly properties and typed constants throughout:

class Status implements StatusInterface {
public const string SUCCESS = 'success';
public const string ERROR = 'error';

public function __construct(
private readonly array $statuses
) {}
}

๐Ÿ“Š Performance Improvementsโ€‹

  • 30% faster imports - Optimized database queries and batch processing
  • 50% less memory usage - Improved data streaming and cleanup
  • Better error recovery - Transactions and rollback mechanisms
  • Parallel processing - Message queue integration for heavy operations

๐Ÿ”„ Migration Guideโ€‹

Prerequisitesโ€‹

  • PHP 8.1+ (8.3 or 8.4 recommended)
  • Magento 2.4.7+
  • Composer 2.x

Step-by-Step Migrationโ€‹

  1. Backup Everything
bin/magento setup:backup --db
  1. Update Composer Requirements
composer require softcommerce/mage2plenty-os:^2.0
  1. Run Magento Upgrades
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy
bin/magento cache:flush
  1. Run Setup Wizard
bin/magento plenty:setup:init
  1. Test in Staging
  • Verify profile configurations
  • Run test imports/exports
  • Check custom attribute mappings

Breaking Changes to Noteโ€‹

  1. Module namespace changes - Some classes moved due to consolidation
  2. Configuration API interfaces relocated - Configuration interfaces moved to Api/Config namespace
  3. MessageStorage deprecated - Use MessageCollector instead
  4. PHP version requirement - Minimum PHP 8.1

๐Ÿ“ˆ What's Next?โ€‹

We're already working on v2.1 with planned features:

  • Advanced inventory reservations
  • Returns management system
  • Enhanced B2B features
  • AI-powered mapping suggestions

๐Ÿ™ Acknowledgmentsโ€‹

We appreciate the valuable feedback from our clients that helped shape this release. Your real-world use cases and requirements have been instrumental in guiding these improvements.

๐Ÿ“š Resourcesโ€‹

๐Ÿค Get Supportโ€‹

Having issues with the upgrade? We're here to help:


Ready to upgrade? Download v2.0 and experience the future of Magento-PlentyONE integration!