Only the shopping_cart class file (catalog/includes/classes/shopping_cart.php) is modified.
So, when you insert a product without any weight, it will be a virtual product.
What I have done:
1. Changed the content_type from "virtual_weight" to "virual". COD payment method need it.
2. Removed some extra codes.
Only shopping_cart.php file is uploaded. You can use the full package below and replace the class file with mine.