Damn Good Content To Grow Your Business In The Digital World
Insights, Ideas and Innovations from the brains of the Saucal NERDS.
Our Shipping Game Stepped Up
Formally starting today, we’d like to introduce our newest partner, ShipStation.
Shipstation is awesome, they:
are the most powerful shipping management tool in the industry
provide the lowest rates for shipping
allow you to easily print your own shipping labels
have GREAT metrics that help you constantly perfect your shipping rules and prices
You know us. We’re Saucal. We’re pretty awesome too. We:
always give you that crucial extra technical help whenever you need it so you can keep being awesome.
share your values. We’re:
constantly improving ourselves to better meet our clients’ needs
strive to make your life easier
all about making your customer experience the best it can be
ShipStation and Saucal Together?
We can take over the world. Or at least the part of it that has to do with shipping. With ShipStation’s leading shipping and fulfillment software and our eCommerce expertise, there is no limit to how you can grow your business.
Configuring the Canada Post Custom Declarations Form via the API
I had a question roll through on the WooCommerce Slack, which I think could be of assistance to our readers –
When shipping using Canada Post, the majority of orders go from CA to USA. So there needs to be a “customs declaration” form for each order. Apparently this “customs declaration” form is somewhere readily available in the Canada Post account. How do I know?
Well, the client is sick and tired of having to bounce back and forth for every order and jumping back into the Canada Post dashboard just to retrieve the “customs declaration” form. Is there a way to ‘pull’ this info from the Canada Post API?
Lol, somewhat dramatic – anyhow, it’s completely possible. Thanks to the helpful folks at Canada Post, here is a guide on how to get it done.
Via the API, Canada Post always return the custom forms for USA/Intl destination. It can be combined with the shipping labels, or in some instances it comes separately. This is where it becomes important to make available all copies when you get an answer back from Createshipments. It would require also that on the front end, you offer the capability for the end user to fill in the customs information.
Below are 2 examples where you see the customs info combined with the shipping labels. The 2nd example shows where it is a separate copy. It all depends on the shipping service and paper format opted for.
#1 Xpresspost USA (Canada Post combines the custom info on the shipping label)
Notice the answer, we only one instance of the endpoint name : LABEL
So, as per usual, I was chatting with someone about the inner workings of WooCommerce. In this case, it was Patrick Garman. Reason being, I get a lot of questions of whether or not a business should use Shopify, or WooCommerce. For me, the answer is simple: with WooCommerce, you own your shit. That alone is enough reason to end the conversation. However, let’s take it a bit deeper. More often than not, this boils down to technical expertise vs. convenience.
Please note that some text has been redacted and replaced with equivalent statements, omitting references to individuals or projects.
cally Hey Patrick amigo, quick q for you..
I’m working on getting a pretty good sized retailer onto WooCommerce. They’re very much a recognized brand. However, for bandwidth/usage it’s not too intense1.
cally They asked about “clunkiness” in WooCommerce, and I was wondering if you had a chart, or threshold where you start to see this?
pmgarman Really depends on the site and how it’s built, to be honest REDACTED [we’ve built and run WooCommerce sites with databases over 100GB in size, which ran better than some sites that have databases less than 1GB].
Do you have new relic or anything running?
cally It’ll be built from scratch and put on an entry level dedicated box at WP Engine, so we could run New Relic.
At this time they’re contemplating platforms, and it’s between Woo and Shopify.
They’re familiar with REDACTED. 😉
pmgarman Well if you need to bring in some expertise, I’m not longer at REDACTED 😉 REDACTED is my sole focus.
cally I saw. I creep you once and a while, y’know? 😉
pmgarman Ha keeping tabs on me
cally Lol Mostly wanna know what you have your hands in!
pmgarman We’re working with REDACTED on their managed platform and part of that is *the* feature plugin for custom order tables
cally Deep down tho, you still hardcore Woo? Or, if a large brand lands on your doorstep, would you ever recommend Shopify? What would that tipping point be?
pmgarman Just to start 😀
cally I’m like 100% against Shopify, lol. But I haven’t put it all into words yet.
pmgarman I work heavily on both now, depends on their level of customization and how much they want to “manage” it
*the* feature plugin for custom order tables
You’ve always got your hands in something good!
pmgarman It’s good for someone who has a simple site and doesn’t want to deal with the headache of WP/WC
depends on their level of customization
How far can you customize Shopify? For example, could you easily add subscriptions, or multi-language as an add-on? I’ve never built on it.
pmgarman multi language basically means you run multiple stores, thats essentially your only real option
customizations, you can customize the html essentially. and then whatever you can do via the API.
with enterprise “plus” plans, you can do a bit more. but thats minimum $2k/mo. and that is now going to go up a lot from my understanding
unless you are paying $2k/mo, your checkout URL is my.shopify.com or something
cally Yea they’re definitely considering Plus, and it’s funny you mention price, because that is definitely an uncertainty I wondered about.
pmgarman plus: it can handle a significant number of orders/min. REDACTED
con: all customizations are significantly more involved
cally To me it sounds like the advantage of Shopify is: – Allows for a lot of orders. – No worries for maintenance
Is that about it?
pmgarman apps have long term costs you can’t ever get away from. customizations of your own if it touches the API means you need to host and run your own custom application
yeah thats the main points
a lot as in, it handles the biggest flash seller in the world
cally lolol Good to know.
cally So a very extreme edge case. What about the payment gateway, too? I think they penalize you for not using their’s, correct?
pmgarman they don’t “penalize” you, but, you don’t get the benefits their white label stripe offers. stripe won’t even talk to you if you are using shopify, you *must* use their shopify payments
cally I heard they add a % point for using a 3rd party.
pmgarman which you don’t get your own stripe yeah you have transaction fees unless you use theirs. but i’m not sure if plus changes that
cally So the benefits really aren’t that much. IMO Then concerns if the company goes bankrupt, restricts features, etc. It’s a lot to pay for some convenience.
About Woo scalability, progress is being made then, as you’re working on it now?
pmgarman the benefits to the lay person is “you dont have to manage your site, they do it for you” where WP/WC you *really* have to manage it. you need someone monitoring it if you are doing any sort of volume or want to run it right, you need to deal with updates/etc
cally Okay, so assuming they have a Saucal or Patrick Garman, they’re covered. Plus, all the benefits of full flexibility and ownership.
pmgarman yeah basically tl;dr – if you are paying more than $2k/mo to run your site (hosting and maintenance), then it’s worth considering, if you have a simple site that doesn’t require much customization.
without plus you can’t even use the discounts api so you can’t create coupons unless you do it by hand $2k/mo to have the power to import coupons
at the end of the day i’ve worked on the largest WC site ever, and now the two largest Shopify stores ever. I’ve broken things on both, Shopify has banned my API keys because i was stressing things.
cally Lol, you’re the man. And that’s at current pricing. If pricing goes up at Shopify, things change.
What are the two sites on Shopify?
pmgarman Which, it is going up i don’t know if they have publicly said it or not. plus is now also a transaction or % based model
cally You know by how much?
pmgarman let me look it up, i can find out from some other people. REDACTED was grandfathered in
REDACTED was #2 at shopify, REDACTED was #1
cally That would be great. And, is it okay if I share this information? Ofc, I want to ask you first. Dude, how do you land these all star customers?
pmgarman REDACTED wasn’t a client, REDACTED was my full time job, REDACTED was under the umbrella of REDACTED and REDACTED was the second brand. REDACTED < i built that site
cally I’m gonna wear a Patrick Garman t-shirt at WooConf2
pmgarman theres a lot of separation and similarities at the same time. but at the end of the day architecturally what my role became when on shopify was connecting things together and building internal tools and applications
ha you should. some mindsize jerseys, garman on the back
cally hahahaha, i was thinking more like those rapper t’s.. your face on the front. Maybe wearing a crown ?
my role became when on shopify was connecting things together and building internal tools and applications
And these were hosted off-site, therefore putting you back in the realm of maintenance, etc.
yeah it was a custom application that i developed myself (built on laravel spark) from the “ground” up
thats how we did reporting, i exported all shopify data through the API, thats why ops hated me
would run 20 threads of API calls
cally wow, so exporting the data pounded the API and they didn’t like it.. ha damn.
WooCommerce Subscriptions and Payment Gateways, Who Manages What?
We had a question come through, followed by a tweet. The tweet went on it’s own tangent talking about things not previously discussed, however it did raise a good question about payment gateways and WooCommerce Subscriptions.
Q: I was always under the impression that in Subscriptions, it does not set up a recurring profile on the payment provider, rather Subscriptions sends single charges each month to the payment gateway1. I know at least it’s that way in Stripe. But I had a guy come through, and said I was wrong for PayPal.
A: You are right for almost all gateways. With PayPal Standard (and one or two other gateways, like WorldPay), the only option is to create a subscription at the payment provider. With all other gateways, including PayPal Reference Transactions (also built into Subscriptions, but requires special approval from PayPal’s end before it can be used) we just need a payment token, and can do everything else ourselves2. Although that said, for PayPal Reference Transactions, the “token” is actually a billing agreement, so the custom can still cancel/suspend that billing agreement at PayPal. AFAIK, there is no PayPal product which does not allow the customer to also manage the recurring payments. Something like PayPal Pro, which is just a credit card gateway, might do that though. But in those cases, you’d just want to use Stripe or something better anyway.
So there you have it. If you’re using PayPal Standard, or 1 or 2 other gateways, the subscription is managed on their platform. Otherwise, it’s managed within Subscriptions directly. And by “manage” I don’t mean it’s storing credit card data locally.
I hope that clears things up. Cheers to the team at Prospress for the answer. 😉
By no means are we implying storing credit card data on the local server. This is a question of using a token and where and when charges are authorized from. This is explained in the answer. ↩
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:
using a secondary index table within the same site database.
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:
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.
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.
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
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.
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.