Unable to reference product variations. Throws call to undefined method error.

Created on 10 August 2018, over 6 years ago
Updated 5 September 2024, 7 months ago

I added an entity reference field for product variations instead of just the product. Then, when editing a product and selecting the add on products, clicking 'Save' results in a WSOD with the following error log message:

Error: Call to undefined method Drupal\commerce_product\Entity\ProductVariation::getVariations() in Drupal\commerce_pado\Form\PadoAddToCartForm->buildForm() (line 79 of /.../commerce_pado/src/Form/PadoAddToCartForm.php)

The line in question is this:

$variations = $add_on_product->getVariations();

✨ Feature request
Status

Closed: works as designed

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada Hubbs

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024