Problem/Motivation

Currently if you want to use Commerce Recurring with Commerce Webform Order module, the only way to do it is to use Commerce Product module. The purchasable entity type doesn't have Trait support like regular product entity type.

Steps to reproduce

- Install Commerce Recurring.
- Go to the form to create new Purchasable Entity Type.
- You should see "Allow subscription" checkbox, but it isn't there.

Proposed resolution

- Let PurchasableEntityType class extend CommerceBundleEntityBase instead of ConfigEntityBundleBase.
- Let PurchasableEntityTypeForm class extend CommerceBundleEntityFormBase instead of BundleEntityFormBase.
- Other minor adjustments.

Remaining tasks

- create MR.

User interface changes

- Will introduce "Allow subscriptions" checkbox to the purchasable entity type form IF commerce recurring is installed.

API changes

- none

Data model changes

Given reliance on Traits, this will be backwards compatible.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

elaman created an issue. See original summary.

nickolaj made their first commit to this issue’s fork.

nickolaj’s picture

Status: Active » Needs review

Patch extends PurchasableEntityType from CommerceBundleEntityBase and PurchasableEntityTypeForm from CommerceBundleEntityFormBase, adding trait support (buildTraitForm/validateTraitForm/submitTraitForm) and updating the config schema to use commerce_config_entity_bundle. This enables Commerce Recurring and other trait-based modules to work with purchasable entities.