You are here

function commerce_product_entity_view_display_update in Commerce Core 8.2

Implements hook_ENTITY_TYPE_update().

File

modules/product/commerce_product.module, line 45
Defines the Product entity and associated features.

Code

function commerce_product_entity_view_display_update(EntityInterface $entity) {

  // The product view uses the variation view and needs to be cleared, which doesn't
  // happen automatically because we're editing the variation, not the product.
  if (substr($entity
    ->getConfigTarget(), 0, 27) === 'commerce_product_variation.') {
    Cache::invalidateTags([
      'commerce_product_view',
    ]);
  }
}