Once a line item of a non-product line item type is added to the cart (e.g. a shipping line item), evaluation of the "Sum quantities for products sharing a display" action fails and the price is no longer calculated correctly.

Relevant extract from rules debug log:

  • 0 ms Rule Override price with price table fires.
  • 0.076 ms Evaluating the action commerce_price_table_sum_quantities. [edit]
  • 12.31 ms Unable to get a data value. Error: Unknown data property commerce_product.
  • 2281.182 ms Unable to evaluate action commerce_price_table_sum_quantities. [edit]
  • 2281.819 ms Unable to get variable combined_product_sum, it is not defined.
  • 2282.299 ms Unable to evaluate action commerce_price_table_set_price. [edit]
  • 2282.339 ms Rule Override price with price table has fired.

Steps to reproduce:

  • Make sure, that the cart is displayed on the review page of the checkout process.
  • Create a new order for a product and a quantity, so that an alternative sales price is used.
  • Make sure, that a line item of a non-product line-item type is added to the order before you reach the review page, e.g. a shipping line item.

Actual result

The "Sum quantities for products sharing a display" action will fail to evaluate and thus, the price shown in the cart on the checkout review page is not calculated correctly.

Expected result

The "Sum quantities for products sharing a display" action is evaluated. The price shown in the cart on the checkout review page is calculated correctly.

Proposed fix

Skip non-product line items in "Sum quantities for products sharing a display" action.

Tag1 supports Drupal development!Tag1 logo

Comments

FeyP created an issue. See original summary.

FeyP’s picture

Status: Active » Needs review
FileSize
776 bytes

Attached is a patch against 7.x-1.x-dev

FeyP’s picture

Unfortunately, there was a small mistake in my previous patch. This time it should work correctly.

kscheirer’s picture

Status: Needs review » Reviewed & tested by the community

Seems pretty sane.

  • Alex Liannoy committed 78bc76e on 7.x-1.x authored by FeyP
    Issue #2803613 by FeyP, kscheirer: Skip non-product line items in "Sum...
Alex Liannoy’s picture

Status: Reviewed & tested by the community » Fixed

Hi guys,

Thank you for committing and reviewing the patch.
Now, 2 years later, I am pushing it to the dev branch :)

Thank you for your patience.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.