Question

Uncaught exception 'RuntimeException' with message 'Entity Id should be specified in EAV fixture'

Superior/Base/Test/Model/Test/fixtures/priceCalculation.yaml

scope:
  website: # Initialize websites
    - website_id: 2
      code: usa_website
      name: USA Website
      default_group_id: 2
    - website_id: 3
      code: canada_website
      name: Canada Website
      default_group_id: 3
    - website_id: 4
      code: german_website
      name: German Website
      default_group_id: 4
  group: # Initializes store groups
    - group_id: 2
      website_id: 2
      name: USA Store Group
      default_store_id: 2
      root_category_id: 2 # Default Category
    - group_id: 3
      website_id: 3
      name: Canada Store Group
      default_store_id: 3
      root_category_id: 2 # Default Category
    - group_id: 4
      website_id: 4
      name: German Store Group
      default_store_id: 4
      root_category_id: 2 # Default Category
  store: # Initializes store views
    - store_id: 2
      website_id: 2
      group_id: 2
      code: usa
      name: USA Store
      is_active: 1
    - store_id: 3
      website_id: 3
      group_id: 3
      code: canada
      name: Canada Store
      is_active: 1
    - store_id: 4
      website_id: 4
      group_id: 4
      code: germany
      name: Germany
      is_active: 1
config:
  default/catalog/price/scope: 1 # Set price scope to website

eav:
  catalog_product:
    - entity_id: 1
      type_id: simple
      sku: book
      name: Book
      short_description: Book
      description: Book
      url_key: book
      stock:
        qty: 100.00
        is_in_stock: 1
      website_ids:
      - usa_website
      - canada_website
      - german_website
    category_ids:
      - 2 # Default Category
    price: 12.99
    tax_class_id: 2 # Taxable Goods
    status: 1 # Enabled
    visibility: 4 # Visible in Catalog & Search
    /websites: # Set different prices per website
      usa_website:
        special_price: 9.99
      german_website:
        price: 9.99
        special_price: 5.99

Trying to load a fixture and so far its processes everything up to the entity_id in the EAV. I get the error at the top

No correct solution

OTHER TIPS

Add two spaces to these lines:

  category_ids:
    - 2 # Default Category
  price: 12.99
  tax_class_id: 2 # Taxable Goods
  status: 1 # Enabled
  visibility: 4 # Visible in Catalog & Search
  /websites: # Set different prices per website
    usa_website:
      special_price: 9.99
    german_website:
      price: 9.99
      special_price: 5.99

This data belongs to your product with entity_id: 1. Therefore you have to indent the lines so that they are part of the product definition. They should have the same indentation as type_id or website_ids.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top