Get stores last order increment ids

This can be done by the following database query:

SELECT
  cs.store_id,
  csg.name                    AS group_name,
  cw.name                     AS website_name,
  cs.name                     AS store_name,
  increment_last_id           AS last_increment_id,
  entity_type_code            AS entity_code
FROM eav_entity_store         AS ees
  INNER JOIN eav_entity_type  AS eet  ON eet.entity_type_id = ees.entity_type_id
  INNER JOIN core_store       AS cs   ON cs.store_id = ees.store_id
  INNER JOIN core_store_group AS csg  ON csg.group_id = cs.group_id
  INNER JOIN core_website     AS cw   ON cw.website_id = cs.website_id
WHERE ees.store_id != 0 ORDER BY ees.store_id;

To change or increment the increment ids of all stores, have a look at Increment order increment ids for all stores.

Leave a Reply

Your email address will not be published.

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.