Damn Good Content To Grow Your Business In The Digital World

Insights, Ideas and Innovations from the brains of the Saucal NERDS.

Suffering from Slow Search Speeds in WooCommerce? Give Your Site a Boost with this Free Upgrade
28 Sep

This post originally appeared on Codeable.

We’ve recently experienced some serious issues with WooCommerce search on eCommerce sites that process a large number of orders. The postmeta table needs to be queried when looking for a specific meta_value, which causes a major slowdown. For example, querying the “my orders” section would take 5s or possibly even more, depending on the server environment. To make matters worse, performing searches on the “Orders” screen for orders belonging to a specific email or person can take 30s or more (due to the involvement of extra JOINs on the postmeta table).

Both of the above examples are unacceptable for a website with high amount of traffic and had to be addressed.

Current Solutions And Associated Limitations

After doing some research, we’ve found that these issues are currently handled in one of two ways:

The ElasticSearch solution sounds good in theory, but our experience leads us to believe that it is not a good thing to integrate with WordPress. This is due to the huge number of differences between the base WP datasource (which is MySQL tables) and the ElasticSearch indexes.

While ElasticSearch performs partial searches very well and is pretty good at “guessing” what you intend to write in the search query, these minor benefits are definitely not outweighed by the downsides of integrating these two data sources:

  • latency between the ElasticSearch instance and your hosting provider (note that this won’t be an issue if you have ElasticPress installed on the same server as your PHP environment, but this is not a common scenario with today’s managed WordPress hosting solutions), and
  • the number of orders covered in each result (across all pages) is narrowed down to just a couple hundred.

In this case, we would need to query the ElasticSearch instance and then pass on the matched post IDs to WP_Query (while adhering to the max length of the SQL query being sent to MySQL). This breaks the workflow for wide range searches, and could potentially provide a misleading number of total results to the store manager searching the Orders screen.

Now, onto the secondary index table. The original solution was presented to us by Patrick Garman, a fellow WordPress developer. He originally intended to just improve the “My Orders” section of WooCommerce, but we thought that this fell a bit short for our needs.

We know that his current implementation is just meant to be a temporary fix until the release of WooCommerce 3.0 and the huge database revamp that is planned for it (which will fix the issues we are discussing in this post). We also know that WC 3.0 is not slated to be released until mid-2017, and since we need to make our customers happy before then, we forked Patrick’s implementation.

Our Proposed Solution

The original implementation of the order index only indexes the Order IDs and the Customer IDs in a secondary table (which is what Patrick set out to fix). His solution is to modify the “My Orders” WP_Query to use his index.

We extended this in a couple of ways:

  1. We’ve included the customer emails (both the billing email on the order and the customer email which is derived from the customer assigned to the order). Whenever you search an email in the orders view of the admin section, we trigger the use of the index instead of postmeta.
  2. We’ve included the customer names (billing, shipping, and display name of the assigned customer).

Here we come across an issue; we don’t want to completely remove WooCommerce’s existing search features, but we need to have some way of using the index conditionally for faster searches. This is because our index doesn’t support Address search, for example, and WooCommerce functionality covers that.

In order to achieve this, we’ve included a parameter like search. Whenever your search parameter is “name:John D,” we return all orders with names that match John D using a wildcard search. You could search for the Order ID in WooCommerce but we felt we could make it easier, so with our solution, you can just enter the search term “#1456” and have order 1456 returned to you.

How To Implement It

In order to install this index, all you have to do is install our fork of the plugin and then enable it. Here’s the URL: https://github.com/saucal/wc-customer-order-index

The only complication at the moment is that you need access to WP-CLI to create the initial index. We’re working on enabling an AJAX interface which will allow you to build the index without WP-CLI.

For now, after you enable the plugin, you need to open up your WP-CLI interface and enter the command “wp wc_coi reset_index” for it to start generating the index for you. The time this process takes will vary depending on the number of orders you have on your site.

How Things Have Changed

WooCommerce Search Before

With the use of this plugin, we have been able to vastly improve the performance of our customers’ large stores. Here above you can see an example where the time was up to almost 40 seconds. In one of our worst performing cases, email search on WP-Admin was taking over 50 seconds.

WooCommerce Search After

Using this plugin, we reduced the search time to less than 5 seconds, improving it by 867%!

Wrapping Things Up

We tried the ElasticSearch solution for one of our customers and it had too many moving parts for our liking. We prefer something that stays within the scope of WordPress and doesn’t require our customers to sign up for any external services.

To be clear, this is not a problem of ElasticSearch as a technology. It’s just that it’s too different from how WordPress works, so integrating the two created a few downsides that for us were deal breakers considering what we were trying to achieve. Additionally, we had to rely on a complex third party plugin (10up’s ElasticPress).

We iterated on Patrick’s approach and extended it to fulfill our customer’s most common needs. As a trusted WordPress agency, we know that this is not the prettiest solution since it duplicates a lot of the data. We just want to provide our customers with a solid workaround until WooCommerce 3.0 is released and renders this solution unnecessary.

Would you have done something different? Feel free to send us a pull request on our repository, we’d love to see alternatives!

High fives to our lead developer Matias for helping me with this article.

The In and Outs of Working with WooCommerce Subscriptions
18 Jul

Building an e-commerce store is essentially no different from building a physical storefront, except that it’s so much better, because, you know, no heavy lifting.

But just like a physical storefront, your website needs to sell product, and a lot of it, to be successful. If you have a one-of-a-kind product that’s so in demand people will literally send robots to wait in line for it, then you don’t really need to worry about anything we’re saying. You’re already doing great.

However, if you sell anything other than Apple iPhones, you’ll need to figure out how to sell your products on an ongoing basis. One of the best ways to do that is to turn your individual products into subscriptions.

Don’t miss: The Subscription Setup Checklist for Newbies

Sweet, sweet subscriptions

When people think “subscriptions” they probably assume you mean subscribing to a magazine or a blog, which is certainly one way of offering cool content to your customers on a regular basis. But that’s not what we’re talking about.

We’re talking about commerce subscriptions, which allow customers to order the same products on a regular schedule. Commerce subscriptions have a few benefits over trying to sell individual products one at a time:

First, commerce subscriptions are extremely convenient for customers, especially if you sell products that people buy on the regular. Think: Dollar Shave Club.

box-bottom-82144d4

Source: Dollar Shave Club

Second, they are extremely convenient for your store, as you have the ability to scale as demands change. You also have a fairly predictable source of monthly income, which is always nice.

Subscriptions also work well to build brand loyalty, since customers are invested in your business on a continuous basis. All in all, if you can turn a product into a subscription, you should.

What sort of things can be turned into subscriptions?

Now you may be thinking, “My individual products don’t really work with subscriptions!” If that’s the case, maybe come up with a new product or service that does, because seriously, subscriptions are pretty much the best source of revenue for your business.

If you don’t want to spend time and energy developing a new product (fine, fine, we get it), here are some ways you can approach subscriptions without reinventing the wheel.

Offer a membership

Again, think about companies like Dollar Shave Club or Honest Company, which are membership-based commerce sites that make millions of dollars each year selling stuff you can find for a dollar at your local drug store. How do they do it? The power of exclusivity. Even if you sell something so extremely basic that everyone already has two at home, including a yearly membership that offers additional discounts to members is a great way to add income as well as provide a service for loyal customers.

Offer discounts for frequently ordered items

If a customer in any way will return to your site to reorder, offering a way to do it that both saves them money and makes you more money is a win-win solution. Amazon does this with their Subscribe & Save service, which lets customers select items to subscribe to and then set their quantity and schedule for delivery.

beauty_whykeeprunningout_bb._V390538485_
Source: Amazon

Box single items together

If you have individual items that you’re always trying to cross-promote, consider boxing them together and selling them as a subscription product. Think about companies like JustFab (valued at $109M) or BarkBox ($1.7M), which are made up solely of these box subscriptions. Even if your customers don’t like all of the products in the box, they’ll still buy the box because it’s a deal, and everybody loves a good deal.

Turn a service into a subscription

Or, if you’re a SaaS company and don’t deal with products, your company is ready-made for subscriptions. Think of companies like Dropbox and Salesforce, which are built around subscriptions for using their services (and also are worth billions, just FYI). If customers can in any way benefit from things that you offer, and you can charge those people on a regular basis for it, don’t hesitate.

Making subscriptions run smoothly in WooCommerce

So once you’ve (wisely) decided to make the move to subscriptions, let’s talk about the nitty-gritty of what you need to know to make them run smoothly in your WooCommerce site.

Setting up subscriptions (if you’re not really a developer, but are still in charge of the store)

The things you’ll need to know about when it comes to commerce subscriptions include:

  • Creating your subscription products
  • Creating discounts association with subscriptions
  • Integrating payment gateways with subscription products
  • Setting up shipping and billing periods
  • Creating subscription account pages
  • Inputting subscription shortcodes
  • Setting up subscription emails

Sound like a lot? Okay, it might be. BUT that doesn’t mean it’s not worth it. Much of the documentation for these processes is already developed, and once the processes are set up they essentially run themselves.

add-subscription-product
Source: WooThemes

Or you could, you know, ask the experts.

Setting up subscriptions (if you’re a developer)

Of course, if you are a developer and you’ve been saddled with the task of building on subscriptions to your WooCommerce site because your boss read this article and thought it was a nifty idea (we’re sorry), then here is what you need to know. Again, the documentation for this is already available, so you can follow it step by step.

  • Get the WooCommerce Subscription plugin.
  • Choose a payment gateway. This is probably a no-brainer, as you’ll most likely use whatever payment gateway you already have set up for the rest of your products. But some gateway APIs don’t always support recurring billing, so double check that your gateway is capable of it. Stripe is easiest out of the box, or just use PayPal, maybe? (If using PayPal, make sure Reference Transactions are enabled.)
  • Use filters to register gateway support. This is done by setting the ‘supports’ property of your gateway. More information can be found here (Step 1).
  • Set up recurring payments, fees, and billing periods. Basically, all the stuff in the previous bullet points. All of this can be done through the API. More information can be found here (Step 2).
  • Manage ongoing subscriptions. Subscription status will change over time as people renew, cancel, subscribe to new services, or change their subscription periods. You’ll probably want to use the WooCommerce Payment Gateway API in addition to the Subscriptions API to help manage these changes.

Sound reasonable? Don’t worry, once everything is set up, the API takes over and manages a lot of things automatically. You’ll still need to make changes and deal with any one-off issues that arise, but overall, it’s not as complicated as it seems.

Again, the overall process to setting up WooCommerce subscriptions is fairly well documented, so whether you’re a newbie developer or a code expert you’ll be able to navigate making the changes. For everything else involved with subscriptions, like how to set pricing and market to customers, the folks over at Zuora have some tips.

Be sure to check out our Subscription Setup Checklist for Newbies, too.

written by
How to Setup the Canada Post WooCommerce Shipping Plugin
12 Jul

The Canada Post WooCommerce plugin is one best way to get shipping rate details from Canada Post, Canada’s primary postal operator. It works as a premium shipping method that provides realtime shipping rates from Canada Post’s API.

To use this extension, two criteria are required to be satisfied. First, your store needs to use Canadian Dollars. Second, your server has SimpleXML installed.

Canada Post manages both, domestic and international parcels.

Installation

  • Login to your WooThemes Account
  • Download .zip files from the account
  • Go to WordPress Admin > Plugins > Add New to upload the file that was downloaded with Choose File
  • Activate the extension

Canada Post – Getting Started

Link your Canada Post account first. Find the notification bar at the top of the admin screen, which will prompt you to Register/Connect.

canadapost connect

The plugin recommend using pretty permalinks before connecting your Canada Post account to avoid an error caused by Canada Post. To know more about permalinks, check the Codex, and choose any option except default.

  • Click the Register/Connect button and you will be taken to Canada Post’s website.
  • Login to your account or register as a new user if you don’t have an account already. Once created, WooThemes will start getting shipping quotes from the API on your behalf.
  • Canada Post might also ask you to enter a credit card detail for few future automatic transactions, like monthly fees, transaction charges, etc. You can submit the details now or update it later when you sign into My Business Profile on the Canada Post Dashboard.

Upon completion, you will be sent automatically to the admin panel.

NB: To disconnect your account in the future, click the link at the top of the Settings page.

canada post account

Canada Post – Setup & Configuration

Setup the payment gateway by going to WooCommerce > Settings > Shipping > Canada Post

canada post settings

  • Enable/Disable – Tick the checkbox to offer Canada Post as a shipping method.
  • Method Title – Give a short description. This will be shown to customers during checkout.
  • Origin Postcode – Give the postal code of the location from where shipping originates. The info will be also sent to the API to calculate rates.
  • Method Availability – Set it to All Countries or restrict it to certain countries as per your suitability. We recommend the former so that it is available to all your customers.
  • Debug Mode – Tick the checkbox if you want to log every request and response made in the Cart and Checkout pages. Useful for troubleshooting.
  • Quote Type – Commercial uses rates and discounts associated with your account. Counter uses normal rates that you will receive in person. Commercial is also used for VentureOne members.
  • Rate Cost – Two types: Base and Due. The former is base rate cost and latter is cost after taxes.
  • Lettermail – Select Standard and/or Registered rates from the dropdown. Lettermail isn’t a part of the Canada Post API and, therefore, rates are calculated by taking box packing and hard coded prices into account.
  • Additional Options – Select Coverage, Proof of Age, and/or Signature for parcels from the dropdown.
  • Delivery Time – Tick the checkbox to get delivery estimate (in days) displayed alongside rates. (Info pulled from the API).
  • Parcel Packing Method – Use the dropdown to select Pack individually. Weight of All items, or Pack with Weights and Dimensions (explained below).
  • Maximum weight –  Define the maximum weight per package.
  • Offer Rates – Select All Rates (User Choice) or Cheapest Rate (Single) from the dropdown.
  • Services – Rename and reorder Canada Post shipping rates. Add price rates by percentage or fixed dollar amount. Adjustments are positive (surcharge/fee) or negative (discount).

canada post services

Parcel Packing Methods

3 packing methods exist with Canada Post; each affects parcels sent to the API

  • Per Item – Items in your cart (non-virtual) are sent to the Canada Post API. The final cost involves quotes of all items combined.
  • Weight Based – The cart needs to be segregated into 30kg packages, details of which are sent to the API. Details include weight only, not dimensions.
  • Pack Into Boxes – Items are packed in pre-defined boxes and sent to the API. For more options, see Box Packing.

Box-Packing

Box packer lets you group items into packages wherein you define height, width, length, weight, and max-weight. Packing considers volume on a primary basis, but item size is also considered.

Setting Up Box Sizes

Set up box dimensions by clicking Add Box.

Outer dimensions refer to the parcel dimensions, an info which is passed to the API.
Inner dimensions are used for packing. It must ensure that items fit within them.
Box weight or in simple terms, weight of the box is the additional weight the cost of which is also included with shipping.
Max weight is the maximum threshold of your box. This includes content weight and box weight.

How The Calculation Works?

The packer does the following:

  • Finds boxes that would fit the item needed to be packed, using HxWxD
  • Packs all items into boxes
  • Uses the largest box that would plausibly accommodate 100% of items; or uses highest percentage of packed box, return unpacked items, and then repeats the process.
  • Packs ‘unpackable’ items alone, using item dimensions.
  • Returns all packed boxes.

Customer Usage

When customers submit their address, they get quotes from 2 places:

  •  Cart Page – using the shipping calculator
  • Checkout Page – by filling shipping and billing forms

Troubleshooting

  • Check if your production Canada Post account is connected or not?
  • Enable development mode, or turn on WP DEBUG to view debugging information on the cart page. This reveals the issue most of the time.
  • Check if product sizes and weights are set or not, since without them calculation cannot be performed.
  • Finally, ensure you have selected your store’s base country as Canada and base currency as Canadian Dollar (WooCommerce > Settings >General).

FAQs

Q: After attempting to authorize Canada Post, it brings me back to a page with a number 1 on the top left.
A: You may need to update your permalink settings for WordPress to Pretty Permalinks.

Q: Why are my lookups timing out?
A: Try opening Port 30000 for API communications.

Q: Error message in cart: Fatal error: Cannot use object of type WP_Error as array in ../woocommerce-shipping- canada-post/shipping- canada-post.php.
A: If you are seeing this message, your server is unable to use the wp_remote_get() function. This can be verified using the Status Report:

canada post wp_remote_get

In this case, we recommend you to contact your hosting company so they update your server.

Hope this blog simplifies the Canada post plugin. If you have any questions, let us know in the comments.

If you want to discuss more about the Canada post plugin with the team, or need help in configuring or customizing the plugin, please feel free to contact us.

Authorize.Net to stop support for HTTP GET method
23 Jun

Recently users have been getting an mail from Authorize.Net informing them, that they would be ending support for any HTTP GET method for transaction requests; this is because HTTP GET methods no longer adhere to current TLS protection requirements. It’s a welcome change that increases security.

Authorize.Net HTTP GET

Previously Authorize.Net has strongly encouraged merchants to upgrade their connections to use TLS 1.2 exclusively and now this, adds a huge step towards making ecommerce more secure along with the web in it’s entirety. This will eventually make transactions over the web much safer than it is now.

Solution to HTTP GET changes

All the functionalities using HTTP GET methods for transaction requests has to be replaced by HTTP POST.

The team here at Saucal would recommend users to update to the latest version of the official Authorize plugins.
Authorize.Net CIM
Authorize.Net AIM
Authorize.Net DPM

The team has been watching the transition closely and understands this can be challenging for many out there.  Don’t slack off because July 30, 2016 is approaching quickly and can kill your eCommerce sales if forgotten.

If you want to discuss more about the change with the team, or need help replacing the plugins please feel free to contact us.

Toronto WooCommerce Meetup: February 2016 Recap
16 Mar

Toronto WooCommerce Meetup - February 2016

February 27, 2016 marked the inaugural Toronto WooCommerce meetup.1 A meetup where shop owners, developers and budding online entrepreneurs can come together to learn and share stories.

I was eager to get the first meetup started.  I wasn’t sure what topics people would want to discuss. Consequently, my objective was to identify what people were interested in. With this, I would craft an agenda for the coming year.  Giving me ample time to prepare material, and find the right guests.

These are not definitive and will change, however we will follow a progression.  Without adieu:

1 – Starting with Woo: What platform should I use?

We’ll compare shopping cart platforms (primarily Shopify) and the pros and cons of each one. Then, we’ll get started with Woo to start selling online. You’ll be introduced to setting up a theme and installing plugins as well as the best resources for WooCommerce help.

Focus: beginner.

2 – Charging taxes: What are the rules?  

Which countries do you charge tax? Who do you remit it to?  How do I configure the tax rules in WooCommerce?2

Focus: intermediate.  

4 – Using WooCommerce for invoicing.

Running a services business?  Would you like an integrated invoicing system to your website? Learn how to use WooCommerce for invoicing your customers.

Focus: beginner/intermediate.

5 – Configuring multi-language for WooCommerce.

Find out which plugins to use, and what to look out for.  This is geared for those who sell in more than one language.

Focus: intermediate.

6 – WooCommerce plugins 101.

Get started with building your own WooCommerce plugin.  Do’s & don’ts and best practises.

Focus: advanced.

7 – WooCommerce theme development 101.

Get started with building your own WooCommerce theme.  Do’s & don’ts and best practises.

Focus: advanced.

8 – eCommerce marketing.  

How to setup a sales funnel and drive traffic to your website. Learn techniques to keep your visitors engaged and turn them into customers.  We’ll also discuss how to setup Google Analytics on WooCommerce.

Focus: intermediate.

9 – Using Amazon with WooCommerce.

During this session we’ll discuss Fulfillment by Amazon (FBA). All the ins and outs of drop shipping, products, reviews and more. Then, we’ll show you how to integrate your Amazon products into your WooCommerce store for greater effect. A special guest from Ordoro will speak.

Focus: intermediate.

10 – Scaling WooCommerce.  

What happens when you have 1000’s of customers or orders? How do you scale up your website so it’s stable and fast?  We’ll be having a special guest speaker Patrick Garman discuss from his experience with ColourPop.com.

Focus: advanced

11 – Selling themes and plugins.  

Want to develop plugins and themes and make some money in the WooCommerce marketplace?  We’ll have special guest Adam Pickering from Astoundify, who is one of Envato’s top selling authors.  He’ll discuss best practises and some of the challenges he’s had making world class themes for sale.

Focus: intermediate

If you’d like to see any topics up here, post them in the comments below. We’re looking forward to a great meetup with excellent content. Thank you!


  1. What is now Toronto’s go-to resource for all-the-things WooCommerce. 

  2. This will require the help of an accountant. If you know the answers to these, please holla at me

Saucal: Engaging Consumers Through WooCommerce!
14 Mar

HAAAANNNNN

Ecommerce has become a big deal; if you’re engaged in it in one form or another, you’ve at least heard about it. That can be problematic from a couple of standpoints: there’s a lot of competition out there trying to capture consumers’ attention—and there’s a lot of competition out there among vendors trying to help marketers do just that.

Business leaders are looking for the answers, and the expert support, to help them achieve results. That’s where Saucal comes in. Saucal designs revenue-maximizing WooCommerce sites that drive business growth. While others may be focused on building beautiful websites, our focus is on building websites that generate results (of course, we believe they’re pretty beautiful too!).

We’re not the only ones who think so. We’re confident in our work, but real validation comes from outside review. That’s what Clutch, a research firm based in Washington, D.C, offers us—third party perspectives on the value we provide which is gratifying to us but which, better yet, sends a strong signal to potential customers about the quality and scope of our services.

Clutch has reviewed thousands of agencies in the tech, digital, and content marketing space and selects those to profile on its web site based on their ability to meet client needs. Unlike some other sources, Clutch doesn’t derive decisions by what they see on companies’ web sites, or what companies have to say about themselves but, most importantly, by what these companies’ customers have to say about them!

Their research is extensive and involves an in-depth review of companies. Clutch seeks to validate the companies’ positioning and services by gathering evidence of proven experience through case studies, portfolio items, client lists and other indicators of market presence.

We’re delighted to have a profile on Clutch; we’re even more delighted to have been chosen recently as an up and coming top ecommerce provider! That’s a big deal to us; and a big deal to our customers! Our customers have shared some very gratifying input with Clutch as part of their review process.

For instance, one of our clients, the president of an oil and gas company, said: “We’ve had a high hit rate on our site. Our shareholders are interested in it… Saucal has a good team that understands our business and listens to us. They’re very responsive…”

Another client, the associate director of development for a music software company said: “Of all the development companies I’ve worked with, Saucal has excelled at making sure that the scope of work is dialed in before it’s actually started. I rarely have to add on additional work.”

We’re of course proud of our perfect 5 star rating. Our profile on Clutch offers potential customers a thorough summary of our services, including detailed charts showing prospective clients which industries we serve, a list of some of our clients, and a sense of what it’s like to work with us. Check out our profile or receive a free consultation for your next project!