Tax Exempt Customers for Woocommerce

Tax Exempt

I recently had a client who uses WordPress and Woocommerce for his e-commerce site ask me to come up with a method of making some customers tax exempt. He primarily sells to retail customers, but he has a number of resellers who use the site. The resellers should not pay sales tax, even though they reside in a state which does charge sales tax for retail customers.

I found some information on Woocommerce’s site which recommended extending the capabilities for the “customer” user role and adding an action to set the value of “set_is_vat_exempt” into the child theme’s functions.php in order to make some customers tax exempt. Unfortunately, the code snippet, which as of this writing hadn’t been updated since 2013, didn’t work, throwing a fatal PHP error on the test site and taking the entire site down.

Although, in the end, the fix was simple, it took a while for me to come up with a working solution, so I’d like to share it here, hopefully saving someone else the time and trouble of setting up tax exempt customers in Woocommerce. I’ve tested this approach using WordPress 4.9.6 and Woocommerce 3.4.2.

Continue reading “Tax Exempt Customers for Woocommerce”

Social Media Icons For Mobile Devices On Woocommerce’s Storefront Theme

Social Media Icons For Mobile Devices On Woocommerce Storefront

Woocommerce has kindly provided a Codex snippet to add social media icons to the Storefront theme. Their approach creates a very nice-looking social media icon menu; however, on displays less than 768 pixels in width, the Storefront theme hides the secondary navigation menu location used. Mobile devices using smaller displays end up with no social media icons.

The Storefront theme is a responsive theme, so it really should have the capability to display social media icons at all resolutions. I didn’t even notice there weren’t any until a client pointed it out to me.

Continue reading “Social Media Icons For Mobile Devices On Woocommerce’s Storefront Theme”

Send a Notification Email When a Woocommerce Customer Changes Their Address

Envelope

I have a client who runs a subscription-based business on a WordPress site using Woocommerce. Since some of his subscriptions last a year or more, increasing the likelihood that a customer’s address might change, he wanted to be notified by email if the customer used the Woocommerce change-of-address form.

While it’s possible to add a custom email notification class so that the email notification will show up in Woocommerce -> Settings -> Emails, I really just needed something simple, and didn’t mind that the recipient email address would be hard-coded. I came up with the following code snippet, which does the trick in WordPress 4.6 and Woocommerce 2.6.4.

Continue reading “Send a Notification Email When a Woocommerce Customer Changes Their Address”

Turn Off Pesky Order Notes for Woocommerce Order/Customer CSV Export

Cash Register

One of my clients uses the plugin Woocommerce Order/Customer CSV Export to export his customers’ orders into a spreadsheet for managing a mailing list. The other day, he emailed me to tell me that instead of being prompted to download the CSV when he clicked the “Export” button, he was getting a nasty screen-full of text.

It took a while to troubleshoot, but it turned out the problem was caused by the 34,000+ records that CSV Export had inserted into the WordPress comments and commentmeta tables. Each time the client was clicking that “Export” button, a new record was added to each table for each exported order, and as the number of orders added up, the records were increasing proportionally. Not only was it causing serious database-bloat, but it was also cluttering up the Order Notes box for each order with “Order exported to CSV and successfully downloaded” notes that the client neither wanted or needed.

Continue reading “Turn Off Pesky Order Notes for Woocommerce Order/Customer CSV Export”

WordPress E-commerce Without the E-commerce Plugin

Jerry Cave Art

I recently built a WordPress site for an artist named Jerry Cave. One of the interesting aspects of the job was that he wanted to sell both originals and prints of his work on the site, but he expected his sales volume to be low, and didn’t want to spend the money to have me install, configure, and maintain a full-fledged e-commerce plugin like Woocommerce until he saw how many sales the site generated.

Continue reading “WordPress E-commerce Without the E-commerce Plugin”