Welcome to the ZingMap development blog.

Our blog provides how-to instructions, development stories, and realistic solutions that we've implemented for our clients.
Please note this blog is intended for developers and programmers.

How to optimize slow queries caused by filtering many meta_query custom fields in WordPress.

If you are working with a custom post type that has many fields you might want to let users filter by those fields. This filtering can be very powerful. With the limitations of a MySQL and more specifically, WordPress’s metadata tables, filtering by custom fields can become slow. This post describes one such scenario, and a few solutions. One ideal solution for WordPress’s metadata tables.

read more…

Self-boxed products with the WooCommerce UPS Shipping Method plugin

“Today a customer called in to let us know a product was being quoted by UPS for $90 to be shipped, while using the UPS calculator yourself showed a total cost of $30.”

– Client’s support ticket

That’s an upsetting bug report to get from a client, especially when it’s not your own code that is broken. This is for the official WooCommerce UPS Shipping Method plugin. It can be difficult to fix an external plugin.

As it turned out, the large dimension product could only fit in an even larger custom box size we had entered. The product in question was already packed and ready to be shipped as-is, though. The plugin was effectively trying to double-box the product. But there is no way to tell the plugin that the product does not need to be boxed.

In this article you’ll find my solution, where you can tell WooCommerce which products are already boxed and should not be combined with other packages. Here is the option we’ll be adding to your WooCommerce products:

read more…

Reverting a multisite to a single WordPress install

WordPress Multisite allows you to host multiple websites with a shared collection of users and plugins. You might need to remove one of the sites for various reasons. If you end up with only one site active, it would be nice to revert to a single site install. These instructions below follow what I’ve used recently to revert a multisite to a single install.

read more…

Updating Google Maps latitude/longitude after importing addresses into ACF

Let’s assume you are setting up a store locator or distance search system on WordPress. The client provided you with a spreadsheet of companies that you’ve already imported to a post type. The spreadsheet included business name, phone numbers, and the address.

Along the way you’ve realized the address alone will not work for putting a pin on Google Maps, or calculating the miles between a visitor’s zip code and the business address. You need the Latitude and Longitude, too, which your client probably does not have.

This tutorial will provide some code and explanation on how you can (mostly) automate Google’s GoeCoding API to get the latitude and longitude of addresses.

read more…