Is it okay to have a bar code for the design patent?

You can't. Design patent is the protection of product appearance, and its patent right is mainly aimed at the product design itself, excluding any other elements such as logo, text or barcode. Therefore, including bar codes in the pictures of design patents may affect the scope and effectiveness of patent protection, and may even be considered as a bad influence on patent applications.