Plugin Support
Hannah S.L.
(@fernashes)
Automattic Happiness Engineer
> We charge an extra shipping fee for residential addresses
Is there any way to tell from the address, for example by zip code, if it’s residential? In that case, you could handle this using shipping zones.
You can add a fee based on the user role, but you’d need to manually set the role before the customer would see the fee. Here’s a snippet of code to add the fee:
http://www.remicorson.com/add-custom-fee-to-woocommerce-cart-dynamically/
Hi, Hannah, thanks for that. I am also using the plugin User Role Editor, so would that count as manual?
Also, how would I tweak the specifics of this code (assigning it to the role, setting the fee amount, and changing the fee name that shows on the frontend)? I usually know enough to find my way around in code, but I don’t know how to write code myself.
Thanks!
You would use the code in Remi’s post and change the text Custom to the name of your user group.
The 5 in the text equates to $5 (or whatever currency) and will display at checkout.
OK, thanks Dustin. And applying to the user role? How would that connect? Seems like you’d have to add another line of code or something to specify it.
Oh wow, I am so stupid. Sorry guys, I just looked at this again and realized you answered my question already. Works beautifully so far! Thanks for the tip!
Plugin Support
Hannah S.L.
(@fernashes)
Automattic Happiness Engineer
Thanks for letting us know – I’m glad to hear it!
I actually may need more help with this after all, guys. I just had another customer (who is not in my Residential Fee group) place an order, and a residential fee got added. I`ll process it, since the payment has been processed, but I may have missed something. Is there a way to ensure that my fee only applies to the user group “Residential Fee”? I don’t want to charge other people extra, just that one group.
Thanks!