fix notices when product has no category, refactoring, fixes #18