Skip to content

[FEATURE] Store whether an ordered product is shippable, cancelable and returnable - #898

Merged
d-g-codappix merged 1 commit into
mainfrom
order-product-properties
Nov 24, 2026
Merged

d-g-codappix merged 1 commit into
mainfrom
order-product-properties

Conversation

@d-g-codappix

@d-g-codappix d-g-codappix commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Resolves: #895

Ordered products get the fields shippable, cancelable and returnable as a snapshot at order time. They are needed later for partial deliveries, cancellations and returns per ordered product.

  • tx_cart_domain_model_order_product: shippable, cancelable, returnable (database default 1, read only in the TCA), getters in Order\Product.
  • PersistOrder\Products sets them before an ordered product (or backend variant) is stored. Defaults: shippable = not a virtual product, cancelable and returnable = true.
  • New PSR-14 event BeforePersistOrderProductEvent (order item, order product, cart product, backend variant), so product extensions can change the three values. ProductInterface gets no new methods.
  • The event dispatcher is an optional fourth constructor argument of PersistOrder\Products, so subclasses calling the constructor with three arguments keep working.
  • The order details in the backend module show a badge below the title of products that are not shippable, cancelable or returnable.
  • No upgrade wizard: existing order products keep the database default; the right value of shippable for old orders depends on the product extension.

Tests: unit tests for Order\Product, functional tests for the persisted values (physical, virtual, backend variant, listener, constructor without event dispatcher) and the badges.

The changelog of 12.8 is also added by #897; the second PR to be merged needs a rebase of Documentation/Changelog/12.8/Index.rst. extcode/cart_products#315 uses the new event.

…nd returnable

Ordered products get the fields shippable, cancelable and returnable. They
are set once when the order is persisted and are not changed afterwards.
Shippable defaults to the inverse of the virtual product flag of the cart
product, cancelable and returnable default to true.

The new BeforePersistOrderProductEvent is dispatched per ordered
product (or backend variant) before it is stored, so product extensions
can change the values without new methods in the ProductInterface.

The order details in the backend module mark products that are not
shippable, not cancelable or not returnable.

Resolves: #895

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@d-g-codappix
d-g-codappix force-pushed the order-product-properties branch from bf8cc8a to a7ae1ef Compare November 24, 2026 17:05
@d-g-codappix
d-g-codappix merged commit 1e6f1c6 into main Nov 24, 2026
25 checks passed
@d-g-codappix
d-g-codappix deleted the order-product-properties branch November 24, 2026 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Store whether an ordered product is shippable, cancelable and returnable

1 participant