Automatically Apply Coupons in Cart on WooCommerce

Providing great deals is a wonderful way to entice first time and returning customers. Imagine if you’ve created a coupon for a product on your store that you want everyone to use. Sure you can add a site banner to inform the customers of the coupon, what if they forget to enter the code though? There may be another way, what if you can have the coupon automatically apply at Checkout if conditions are met.

Using the WooCommerce Extended Coupon Features this is totally possible! Let’s see how it’s done.

How can I set a coupon to automatically apply to the cart for my customers?

Applying coupons to the cart automatically simplifies the checkout process even further, making purchasing with a coupon as easy as possible for your buyers. First, install the WooCommerce Extended Coupon Features plugin on your shop, you can find the plugin here. Once the plugin is installed and activated on your site you can continue.

To start using this plugin, go to WooCommerce > Coupons. Under Coupon data > Miscellaneous choose ‘Auto coupon‘ as shown in the example and check the Auto coupon box.

And that’s about it! More or less, the coupon system and configuration works the same as before – now you have the option to auto apply your coupons though.

Disable the In Stock message on WooCommerce Products

Lets say you have an eCommerce business selling customized coffee mugs. Each mug you sell gets a custom message printed on it and you just fill the orders as they come in. You know each mug gets customized before shipping out, so you don’t really need to track the inventory.

If you happen to run out of your local stock of blank mugs then you’ll just buy a new box, no big deal. In a case like this you may track inventory, but don’t actually need WooCommerce to report this. So how can you hide the ‘In Stock’ message on your product pages? Continue reading “Disable the In Stock message on WooCommerce Products”

Using GTIN numbers on products in WooCommerce

By default WooCommerce adds in a SKU custom field to products, but that may not cover your needs, depending on the products you offer. If you’re selling books or magazines ISBN numbers are going to be necessary. Various GTIN (Global Trade Identification Number) options are also important, both for selling and for tracking your products.

How to add GTIN number fields to WooCommerce Products

Or: I need to be able to add GTIN numbers onto the products listed on my store, but WooCommerce only adds an option for SKU?

Fortunately, there is code that can be added to your theme’s function.php that will allow you to use different GTIN options, be they UPC, EAN or ISBN numbers, for the products you’re selling. This is also handy if you happen to be listing your products on Amazon, via a feed.

WordPress Code Warning:
This article features code changes, or snippets, that you can make in your active themes function.php file. If you are unfamiliar with this task, or want to brush up, we have an article on Managing code snippets in WooCommerce. The technique provided can be used for both WordPress and WooCommerce sites.

It is recommended that you try this in a staging environment, which allows you the ability to make sure you have the functionality you’re looking for, without impacting your live site until you’re ready.

Alternative Option: Use a plugin to add GTINs

The option above is great if you’re familiar with customizing your site with code. You can easily drop that code into your themes functions.php file or even as a mu-plugin and get rolling. For those less familiar with using code though an alternative exists. There is a plugin on WordPress.org that can add the field in for you called WooCommerce Add GTIN: UPC, EAN, and ISBN. Just install this plugin like any other one and you’ll be good to go.

Managing code snippets in WooCommerce

When working on a WordPress site, especially stores, you’ll likely reach a point where you need something custom. You might want to customize something that doesn’t have a true setting in WordPress? Or, you need to add a custom hook to modify something? Or, maybe you need to customize part of your WooCommerce store?

No matter the case, making code changes means you’ll need to know the right place to do that. In this article we cover the best ways to get this done and some best practices.
Continue reading “Managing code snippets in WooCommerce”

How To Install Git on Ubuntu 16.04 LTS

Git is one of the most popular tools used for distributed version control system(VCS). Git is commonly used for source code management (SCM) and has become more used than old VCS systems like SVN.

Installing Git on Ubuntu 16.04 LTS

Pre-Flight Check
  • You should be running a server with any Ubuntu 16.04 LTS release.
  • You will need to log in to SSH via the root user.
  • In this tutorial I’ll be working with a Core Managed Ubuntu 16.04.4 LTS server

First, as always, we should start out by running general OS and package updates. On Ubuntu we’ll do this by running:apt-get update

After you have run the general updates on the server you can get started with installing Git.

  1. Install Git
    apt-get install git-coreYou may be asked to confirm the download and installation; simply enter y to confirm. It’s that simple, git should be installed and ready to use!
  2. Confirm Git the installation
    With the main installation done, first check to ensure the executable file is setup and accessible. The best way to do this is simply to run git with the version command.
    git --version

    git version 2.7.4
  3. Configure Git’s settings (for the root user)
    It’s a good idea to setup your user for git now, to prevent any commit errors later. We’ll setup the user testuser with the e-mail address testuser@example.com.

    git config --global user.name "testuser"
    git config --global user.email "testuser@example.com"
    Note:
    It’s important to know that git configs work on a user by user basis. For example if you have a ‘david’ Linux user and they will be working with git then David should run the same commands from his user account. By doing this the commits made by the ‘david’ Linux user will be done under his details in git.
  4. Verify the Config changes
    Now we’ll verify the configuration changes by viewing the .gitconfig file. You can do this a few ways, we’ll show you both methods here.

    1. View the config file using cat with the following command:
      cat ~/.gitconfig
    2. Or, you can also view the same details using the git config command:
      git config --list

And that’s it! You have now installed Git on your Ubuntu 16.04 LTS server and have it configured on your root user. You can get rolling with your code changes from here, or you can repeat steps 3 and 4 for the other system user accounts.

How to Install and Configure vsftpd on CentOS 7

FTP (File Transfer Protocol) is one of the most popular methods to upload files to a server. There exist a wide array of FTP servers, such as vsftpd, you can use and FTP clients exist for every platform.

Essentially no matter what OS you use you can find an easy to use FTP client, so it makes for a great solution to transfer files. On CentOS based servers before you can connect via FTP you’ll have to setup an FTP server. Here we’re gonna setup vsftpd which is a great option since it has a focus on security and speed.

Continue reading “How to Install and Configure vsftpd on CentOS 7”

Why Is Most of My Memory Being Used?

Often we hear a lot of customers asking why, when their server is largely idle, much of their RAM appears to be in use.

When RAM is not needed for other functions, your server will load frequently-accessed files into memory in order to read them more quickly. When a file is loaded into RAM, the server can access the information orders of magnitude faster than from disk. A modern SSD disk can read files at up to around 500-700 MB/second, if the files are in sequential units. However, RAM can be read at GB/second rates; or even tens of GB/second.

If the RAM becomes needed for another function, these files are quickly flushed out of memory, and the RAM becomes available for other tasks. Continue reading “Why Is Most of My Memory Being Used?”

What to expect for a Windows Server Migration?

If you ever need to upgrade the hardware on your Windows server, Liquid Web’s Windows team is happy to help you through the migration process. While it is not the most simple process, keeping in communication with our Heroic Support teams will help make things go smoothly. Before beginning a Windows server migration it’s a good idea to familiarize yourself with the overall process so you know what to expect.

Things to Consider

There are a few things to keep in mind when starting a migration. Review the items listed here to make sure you’re prepared for the process. Continue reading “What to expect for a Windows Server Migration?”

What is a FQDN?

What is a Fully Qualified Domain Name (FQDN)?

When working with domains and DNS management understanding what a FQDN is can be very helpful. This article will help explain the concept of a FQDN and a domains different components.

The Parts of a Domain

A domain is made up of a two essential parts, the Top-Level Domain (TLD) and the main Domain Name which is what you register. The other component of domain names are the subdomains. Continue reading “What is a FQDN?”