backend/modules/product/controllers/ProductController.php
/**
     * generate product EAN from settings
     * return Product Ean
     */
generate product EAN from settings
return Product Ean
generate product EAN from settings return Product Ean
public function generateProductEan() {
        $last_product = Product::find()->orderBy(['id' => SORT_DESC])->one();
        if (empty($last_product))
            $ean = 'PD' . sprintf('%05d', 1);
        else {
            $ean = 'PD' . sprintf('%04d', ++$last_product->id);
        }
        return $ean;
    }
public function generateProductEan ( ) { $ last_product = Product :: find ( ) -> orderBy ( [ 'id' => SORT_DESC ] ) -> one ( ) ; if ( empty ( $ last_product ) ) $ ean = 'PD' . sprintf ( '%05d' , 1 ) ; else { $ ean = 'PD' . sprintf ( '%04d' , ++ $ last_product -> id ) ; } return $ ean ; }
generate product EAN from settings
 return Product Ean
generate product EAN from settings return Product Ean