I’m trying to add some logic and validation to the checkout process of a CartThrob site but I’m running into some issues. I think I might be missing something.
What I want to happen is if a shopper doesn’t have any shippable products in their cart I want the user to not have to fill out the shipping form. Conversely, if a user has shippable products in their cart I want them to have to input their shipping data. The way CartThrob currently works for me is that a user can just skip the shipping form.
I had thought there would be a tag within CartThrob to check for shippable products on the shipping page like the below:
//display shipping form
//redirect to payment form
I’m pretty sure I can just loop over each cart entry, checking if there’s a shippable product within the cart, but that seems like overkill.
Is there some simpler way to do this I’m missing? This being a commercial product I’m reluctant to invest time into writing a custom plugin or module so, being a customer and all, I’m hoping there’s some way I’m missing.