How can I create a code for free shipping and a product discount?
Please note that Shopify's discount settings do not allow for creating codes that provide both a discount on shipping and the products in a cart. However, with Shopify's new Discount Combinations feature, you may create a Free Shipping discount code or automatic discount that can be combined with another discount code. To do this, both discounts must be configured to combine with each other. Learn more from Shopify.
Note
Combinations must currently be set in your Shopify Discounts admin after the code set is created.
Another workaround to complete this is to use Shopify's custom shipping profiles, which allow you to create shipping rules that automatically change the price of shipping based on configured criteria, without needing a discount code.