Skip to main content

Mage2Plenty v3.8 - Offline-Capture Safety & Stock Import Efficiency

· 3 min read
Soft Commerce Team
Mage2Plenty Development Team

Mage2Plenty v3.8 makes the PlentyONE → Magento order import safer around payments, and gives the stock import a meaningful efficiency and correctness pass — including a fix for a query that could full-scan the reservation table on every call.

Order Import

Imported payments never trigger a live capture

When PlentyONE orders are mirrored back into Magento, creating an invoice in Magento must not re-charge the customer through a live payment gateway — the money was already taken in PlentyONE. Previously, invoicing an imported order could fall through to an online capture depending on the resolved payment method.

Imported orders are now stamped with plenty_payment / plenty_capture_type=offline on the payment's additional_information at creation time (in QuotePayment, so it carries through the quote → order conversion). Invoice::determineCaptureCase() then forces CAPTURE_OFFLINE whenever that flag is present, so an imported record can never trigger a live/online gateway capture regardless of which payment method it resolves to.

Shipping profile falls back to order-item properties

Building on the v3.7 shipping-profile work, resolution is now extracted into a dedicated getShippingProfileId() that checks the order-level property first, then scans the order line items for a shipping profile ID when the order-level property has none — so the shipping method still resolves on orders that only carry the profile on their items.

Stock Import

Skip products with Manage Stock disabled

Products configured with "Manage Stock = No" have no meaningful stock or reservations to sync, yet they were still being processed on every import. The import validator now detects them and marks them SKIPPED, which suppresses both physical-stock and reservation import for those products in one place.

The flag is read through the non-deprecated MSI facade GetStockItemConfiguration::isManageStock(), which resolves the use_config_manage_stock fallback to the global config — so per-product overrides and the store default are both honoured.

Unsupported stock types no longer error the row

Source assignment threw a LogicException for any stock type without a registered processor — for example preorder reservations, which have no physical source to assign — surfacing as a per-row error in the import summary. It now logs a warning and skips the unhandled type instead, so the import row completes cleanly. The behaviour is defensive for any future type.

Performance

inventory_reservation SKU index

The connector queries inventory_reservation by sku during stock import and order export, but the table's only index leads with stock_id — so a WHERE sku = ? lookup could full-scan the entire table on every call, dragging down the whole database under load. v3.8 adds a B-tree index on sku, turning those scans into direct lookups.

Release Summary

ModuleVersionBumpKey Changes
module-plenty-order-profile2.5.1 → 2.6.0minorForce offline capture for imported payments; shipping-profile fallback to order-item properties
module-plenty-stock-profile2.3.0 → 2.4.0minorSkip import for unmanaged products; tolerate unsupported stock types in source assignment; inventory_reservation SKU index

Metapackage: softcommerce/mage2plenty-os 3.7.0 → 3.8.0

Upgrade Guide

composer require softcommerce/mage2plenty-os:^3.8

bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento cache:flush

setup:upgrade adds the inventory_reservation SKU index via declarative schema — this issues a single ALTER TABLE, so run the upgrade during a low-traffic window. No configuration changes are required; all changes apply automatically.

Resources


Questions about the upgrade? Reach out to us at support@byte8.io.