Adjustments (discounts) not applied to custom product type line items

Created on 12 September 2023, about 1 year ago
Updated 3 October 2023, about 1 year ago

Problem/Motivation

When products with coupons are migrated, only line items of type product get the discounts applied to them and are counted. When a site has custom product types, the discounts don't get applied to those orders during the migration.

Steps to reproduce

  • Create a custom product type in Drupal 7, for example webinar
  • Create a discount in Drupal 7
  • Create an order in Drupal 7 that uses a custom product type and a coupon/discount
  • Migrate the content to Drupal 9
  • Migrated content for product will appear, but not for the custom product types

Proposed resolution

The LineItem.php code assumes that product type is always product. I propose that we should define something as a product by excluding a list of known line items that are not products, such as tax, shipping, discounts.

Proposed patch is included.

πŸ› Bug report
Status

Needs work

Version

3.2

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States makbeta

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024