how can I get product id from new product before save event.I have used below code but it will create blank product in database every time.
$newProduct = $product->duplicate();
echo $product_id = $newProduct->getId();
any other way to get product id before product save.
Best Answer
What you could do is load the next value in the product table's auto_increment field. This should most of the time give you the id that will belong to the next product created.