Using a function to bring back the progenitor product id (highest valid parent or self)