diff --git a/app/code/core/Mage/Eav/Model/Entity/Increment/Numeric.php b/app/code/core/Mage/Eav/Model/Entity/Increment/Numeric.php index c89fd4ba312..b3e8f3df541 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Increment/Numeric.php +++ b/app/code/core/Mage/Eav/Model/Entity/Increment/Numeric.php @@ -45,8 +45,8 @@ public function getNextId() if (empty($last)) { $last = 0; - } else if (strpos($last, (string)$this->getPrefix()) === 0) { - $last = (int)substr($last, strlen($this->getPrefix())); + } else if (!empty($prefix = (string)$this->getPrefix()) && strpos($last, $prefix) === 0) { + $last = (int)substr($last, strlen($prefix)); } else { $last = (int)$last; }