Adding shipping charge exemption for virtual products
I have tried hard to work on adding a shipping charge exemption with the assistance of ChatGPT. It was helpful to implement other changes, but not so much for this.
Most of our products are shipped, but we also have three virtual products. If only these are ordered, I need shipping to be zero.
But if virtual products and shippable products are ordered, I need shipping to be what is defined in the php file.
In one spot, shipping rules are set to true. I thought it would be easiest to put them in a conditional statement. Like if shippable = 1 for at least one product, then return the shipping as true.
The problem is that I don't know how to get the shippable value into the statement. It is not a session. It is just on value, that is either 0 for virtual products or 1 for shippable products. If I cannot use a value from the database, I can also use $articel, which is the item number. It is passed to the cart. That could be set to: if not these, return shipping.
Needless to say, I am not a coder. I get by with the help of code snippets and now also ChatGPT, but here I am stuck. Could I please get help with that?