Built Mighty

Contacts For Less US: WooCommerce Storefront Development

While working for Built Mighty, I was the developer on the US storefront of Contacts For Less, a sister site to the Canadian site contactsforless.ca, working on its prescription form, checkout and releases.

Contacts For Less US home page

A notable problem

Contact lenses need a prescription, and the US store sat next to a Canadian store that shared much of the same code. The US shop had to behave differently from the Canadian one in small but important ways, for example the labels at checkout, the tax and address details, and how a customer supplies a prescription, without splitting the code into two projects that drift apart.

What I did

  • I developed the US storefront, starting from the code base shared with the Canadian site.
  • I set up a shared locale setting and a theme settings page, so the same code can serve the US and Canadian stores.
  • I added a pop-up on first visit that points shoppers to the right store.
  • I made the check that remembers a visitor’s choice work in privacy-focused browsers.
  • I built the prescription form: it stores each submission, emails the shop, includes clinic and optometrist details, and can be switched on or off in settings.
  • I moved the prescription form into the checkout.
  • I improved the checkout: the cart refreshes by itself, state and zip labels change with the country, and the state field is required.
  • I added a replacement fee options page.
  • I tidied the code: I folded the code from a plugin that stored code snippets into the theme itself, removed an unused plugin, and kept plugins current for PHP 8.
  • I authored the site’s releases.

The result

A US storefront where customers can supply their prescription as part of buying, with checkout fields that fit the country. The site is live at contactsforless.com as a sister site to the Canadian site contactsforless.ca.

Tools I used, in plain words

WordPress and WooCommerce

the site platform and its shop plugin.

Advanced Custom Fields

a plugin for adding structured settings and form fields.

Custom post types

a WordPress feature for storing records such as prescriptions.

AvaTax

a sales tax service (kept in sync).

Wordfence and Simple History

a security plugin and an activity log.

Gallery

Screenshots

Select an image to enlarge it.

Other work

More projects

All projects

Have a site that needs fixing, moving or building, or a role to fill? Tell me what’s going on.

Get in touch