One place for hosting & domains

      How To Use the MySQL BLOB Data Type to Store Images with PHP on Ubuntu 18.04


      The author selected Girls Who Code to receive a donation as part of the Write for DOnations program.

      Introduction

      A Binary Large Object (BLOB) is a MySQL data type that can store binary data such as images, multimedia, and PDF files.

      When creating applications that require a tightly-coupled database where images should be in sync with related data (for example, an employee portal, a student database, or a financial application), you might find it convenient to store images such as students’ passport photos and signatures in a MySQL database alongside other related information.

      This is where the MySQL BLOB data type comes in. This programming approach eliminates the need for creating a separate file system for storing images. The scheme also centralizes the database, making it more portable and secure because the data is isolated from the file system. Creating backups is also more seamless since you can create a single MySQL dump file that contains all your data.

      Retrieving data is faster, and when creating records you can be sure that data validation rules and referential integrity are maintained especially when using MySQL transactions.

      In this tutorial, you will use the MySQL BLOB data type to store images with PHP on Ubuntu 18.04.

      Prerequisites

      To follow along with this guide, you will need the following:

      Step 1 — Creating a Database

      You’ll start off by creating a sample database for your project. To do this, SSH in to your server and then run the following command to log in to your MySQL server as root:

      Enter the root password of your MySQL database and hit ENTER to continue.

      Then, run the following command to create a database. In this tutorial we’ll name it test_company:

      • CREATE DATABASE test_company;

      Once the database is created, you will see the following output:

      Output

      Query OK, 1 row affected (0.01 sec)

      Next, create a test_user account on the MySQL server and remember to replace PASSWORD with a strong password:

      • CREATE USER 'test_user'@'localhost' IDENTIFIED BY 'PASSWORD';

      You’ll see the following output:

      Output

      Query OK, 0 rows affected (0.01 sec)

      To grant test_user full privileges on the test_company database, run:

      • GRANT ALL PRIVILEGES ON test_company.* TO 'test_user'@'localhost';

      Make sure you get the following output:

      Output

      Query OK, 0 rows affected (0.01 sec)

      Finally, flush the privileges table in order for MySQL to reload the permissions:

      Ensure you see the following output:

      Output

      Query OK, 0 rows affected (0.01 sec)

      Now that the test_company database and test_user are ready, you’ll move on to creating a products table for storing sample products. You’ll use this table later to insert and retrieve records to demonstrate how MySQL BLOB works.

      Log out from the MySQL server:

      Then, log back in again with the credentials of the test_user that you created:

      When prompted, enter the password for the test_user and hit ENTER to continue. Next, switch to the test_company database by typing the following:

      Once the test_company database is selected, MySQL will display:

      Output

      Database changed

      Next, create a products table by running:

      • CREATE TABLE `products` (product_id BIGINT PRIMARY KEY AUTO_INCREMENT, product_name VARCHAR(50), price DOUBLE, product_image BLOB) ENGINE = InnoDB;

      This command creates a table named products. The table has four columns:

      • product_id: This column uses a BIGINT data type in order to accommodate a large list of products up to a maximum of 2⁶³-1 items. You’ve marked the column as PRIMARY KEY to uniquely identify products. In order for MySQL to handle the generation of new identifiers for inserted columns, you have used the keyword AUTO_INCREMENT.

      • product_name: This column holds the names of the products. You’ve used the VARCHAR data type since this field will generally handle alphanumerics up to a maximum of 50 characters—the limit of 50 is just a hypothetical value used for the purpose of this tutorial.

      • price: For demonstration purposes, your products table contains the price column to store the retail price of products. Since some products may have floating values (for example, 23.69, 45.36, 102.99), you’ve used the DOUBLE data type.

      • product_image: This column uses a BLOB data type to store the actual binary data of the products’ images.

      You’ve used the InnoDB storage ENGINE for the table to support a wide range of features including MySQL transactions. After executing this for creating the products table, you’ll see the following output:

      Output

      Query OK, 0 rows affected (0.03 sec)

      Log out from your MySQL server:

      You will get the following output

      Output

      Bye

      The products table is now ready to store some records including products’ images and you’ll populate it with some products in the next step.

      Step 2 — Creating PHP Scripts for Connecting and Populating the Database

      In this step, you’ll create a PHP script that will connect to the MySQL database that you created in Step 1. The script will prepare three sample products and insert them into the products table.

      To create the PHP code, open a new file with your text editor:

      • sudo nano /var/www/html/config.php

      Then, enter the following information into the file and replace PASSWORD with the test_user password that you created in Step 1:

      /var/www/html/config.php

      <?php
      
      define('DB_NAME', 'test_company');
      define('DB_USER', 'test_user');
      define('DB_PASSWORD', 'PASSWORD');
      define('DB_HOST', 'localhost');
      
      $pdo = new PDO("mysql:host=" . DB_HOST . "; dbname=" . DB_NAME, DB_USER, DB_PASSWORD);
      $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
      $pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
      
      

      Save and close the file.

      In this file, you’ve used four PHP constants to connect to the MySQL database that you created in Step 1:

      • DB_NAME : This constant holds the name of the test_company database.

      • DB_USER : This variable holds the test_user username.

      • DB_PASSWORD : This constant stores the MySQL PASSWORD of the test_user account.

      • DB_HOST: This represents the server where the database resides. In this case, you are using the localhost server.

      The following line in your file initiates a PHP Data Object (PDO) and connects to the MySQL database:

      ...
      $pdo = new PDO("mysql:host=" . DB_HOST . "; dbname=" . DB_NAME, DB_USER, DB_PASSWORD);
      ...
      

      Toward the end of the file, you’ve set a couple of PDO attributes:

      • ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION: This attribute instructs PDO to throw an exception that can be logged for debugging purposes.
      • ATTR_EMULATE_PREPARES, false: This option increases security by telling the MySQL database engine to do the prepare instead of PDO.

      You’ll include the /var/www/html/config.php file in two PHP scripts that you will create next for inserting and retrieving records respectively.

      First, create the /var/www/html/insert_products.php PHP script for inserting records to the products table:

      • sudo nano /var/www/html/insert_products.php

      Then, add the following information into the /var/www/html/insert_products.php file:

      /var/www/html/insert_products.php

      <?php
      
      require_once 'config.php';
      
      $products = [];
      
      $products[] = [
                    'product_name' => 'VIRTUAL SERVERS',
                    'price' => 5,
                    'product_image' => file_get_contents("https://i.imgur.com/VEIKbp0.png")
                    ];
      
      $products[] = [
                    'product_name' => 'MANAGED KUBERNETES',
                    'price' => 30,
                    'product_image' => file_get_contents("https://i.imgur.com/cCc9Gw9.png")
                    ];
      
      $products[] = [
                    'product_name' => 'MySQL DATABASES',
                    'price' => 15,
                    'product_image' => file_get_contents("https://i.imgur.com/UYcHkKD.png" )
                    ];
      
      $sql = "INSERT INTO products(product_name, price, product_image) VALUES (:product_name, :price, :product_image)";
      
      foreach ($products as $product) {
          $stmt = $pdo->prepare($sql);
          $stmt->execute($product);
      }
      
      echo "Records inserted successfully";
      

      Save and close the file.

      In the file, you’ve included the config.php file at the top. This is the first file you created for defining the database variables and connecting to the database. The file also initiates a PDO object and stores it in a $pdo variable.

      Next, you’ve created an array of the products’ data to be inserted into the database. Apart from the product_name and price, which are prepared as strings and numeric values respectively, the script uses PHP’s in-built file_get_contents function to read images from an external source and pass them as strings to the product_image column.

      Next, you have prepared an SQL statement and used the PHP foreach{...} statement to insert each product into the database.

      To execute the /var/www/html/insert_products.php file, run it in your browser window using the following URL. Remember to replace your-server-IP with the public IP address of your server:

      http://your-server-IP/insert_products.php
      

      After executing the file, you’ll see a success message in your browser confirming records were inserted into the database.

      A success message showing that records were inserted to database

      You have successfully inserted three records containing product images into the products table. In the next step, you’ll create a PHP script for retrieving these records and displaying them in your browser.

      Step 3 — Displaying Products’ Information From the MySQL Database

      With the products’ information and images in the database, you’re now going to code another PHP script that queries and displays the products’ information in an HTML table on your browser.

      To create the file, type the following:

      • sudo nano /var/www/html/display_products.php

      Then, enter the following information into the file:

      /var/www/html/display_products.php

      <html>
        <title>Using BLOB and MySQL</title>
        <body>
      
        <?php
      
        require_once 'config.php';
      
        $sql = "SELECT * FROM products";
        $stmt = $pdo->prepare($sql);
        $stmt->execute();
        ?>
      
        <table border = '1' align = 'center'> <caption>Products Database</caption>
          <tr>
            <th>Product Id</th>
            <th>Product Name</th>
            <th>Price</th>
            <th>Product Image</th>
          </tr>
      
        <?php
        while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
            echo '<tr>';
            echo '<td>' . $row['product_id'] . '</td>';
            echo '<td>' . $row['product_name'] . '</td>';
            echo '<td>' . $row['price'] . '</td>';
            echo '<td>' .
            '<img src = "data:image/png;base64,' . base64_encode($row['product_image']) . '" width = "50px" height = "50px"/>'
            . '</td>';
            echo '</tr>';
        }
        ?>
      
        </table>
        </body>
      </html>
      

      Save the changes to the file and close it.

      Here you’ve again included the config.php file in order to connect to the database. Then, you have prepared and executed an SQL statement using PDO to retrieve all items from the products table using the SELECT * FROM products command.

      Next, you have created an HTML table and populated it with the products’ data using the PHP while() {...} statement. The line $row = $stmt->fetch(PDO::FETCH_ASSOC) queries the database and stores the result in the $row variable as a multi-dimensional array, which you have then displayed in an HTML table column using the $row['column_name'] syntax.

      The images from the product_image column are enclosed inside the <img src = ""> tags. You’ve used the width and height attributes to resize the images to a smaller size that can fit in the HTML table column.

      In order to convert the data held by the BLOB data type back to images, you’ve used the in-built PHP base64_encode function and the following syntax for the Data URI scheme:

      data:media_type;base64, base_64_encoded_data
      

      In this case, the image/png is the media_type and the Base64 encoded string from the product_image column is the base_64_encoded_data.

      Next, execute the display_products.php file in a web browser by typing the following address:

      http://your-server-IP/display_products.php
      

      After running the display_products.php file in your browser, you will see an HTML table with a list of products and associated images.

      List of products from MySQL database

      This confirms that the PHP script for retrieving images from MySQL is working as expected.

      Conclusion

      In this guide, you used the MySQL BLOB data type to store and display images with PHP on Ubuntu 18.04. You’ve also seen the basic advantages of storing images in a database as opposed to storing them in a file system. These include portability, security, and ease of backup. If you are building an application such as a students’ portal or employees’ database that requires information and related images to be stored together, then this technology can be of great use to you.

      For more information about the supported data types in MySQL follow the MySQL Data Types guide. If you’re interested in further content relating to MySQL and PHP, check out the following tutorials:



      Source link

      9 Steps to Build an Online Store and Become Your Own Boss in 2019


      While traditional careers have their benefits, there’s something very appealing about being your own boss. You can work whenever, however, and wherever you want to while still pursuing your passion. The tricky part is knowing how to get started.

      With accessible and easy-to-use tools such as WordPress and WooCommerce, setting up shop online is relatively simple. By launching an e-commerce store, you can take your product ideas to the web and access the vast pool of customers available there.

      This article will walk you through the steps to build your online store with WordPress and WooCommerce and become your own boss in no time. Let’s go!

      Your Store Deserves WooCommerce Hosting

      Sell anything, anywhere, anytime on the world’s biggest eCommerce platform.

      9 Steps to Build an Online Store and Become Your Own Boss

      The very first thing you’ll need to start an online store is a product customers will want to buy. We can’t help you with that, unfortunately — your idea has to be all your own! You’ll also need a way to manufacture your product, either by doing it yourself, hiring a company to do it, or some combination of the two.

      Once you’re done, you’ll be ready to set up your online store and start selling your merchandise, which is where the steps below will come in handy.

      Step 1: Secure Your Web Hosting and Domain Name

      The first two things you need to start any kind of website are a hosting provider and a domain name. Your hosting provider will store your website’s files, while your domain name provides an address where customers can find your store.

      If you’re building a WordPress site (which we recommend), you might also want to consider WordPress hosting. These types of plans are explicitly geared towards the platform, and the servers they run on will be optimized.

      Our shared WordPress hosting plans, for example, are ideal for new WordPress sites. You’ll have access to our 24/7 tech support team, and plans are cost-effective, starting at just $2.59 per month for a single site.

      DreamHost’s Shared WordPress Hosting page.

      What’s more, we can also help you register your domain name. You can quickly check the availability of your desired web address, then register it once you’ve found the perfect fit.

      DreamHost’s domain name search.

      Simply fill in some information to complete the process. Domains usually start at $11.99, but if you’re also hosting your site with a shared WordPress plan, you’ll get yours for free.

      Step 2: Set Up WordPress and WooCommerce

      Regardless of your current host, a WordPress hosting plan likely comes with the platform pre-installed or with a one-click installation option. In some cases, you may need to install WordPress manually.

      Next, you’ll need to set up WooCommerce — a premiere e-commerce solution for WordPress (we’ve compared it to other competitors and think it’s the best ecommerce platform available).

      The first step is to install and activate the WooCommerce plugin.

      The WooCommerce plugin.

      Once this is complete, you’ll be prompted to configure your store using the onboarding wizard — fill in the fields as best you can now, or come back to this step later.

      Step 3: Identify Your ‘Value Proposition’

      Before you begin creating content for your e-commerce business, consider identifying and writing out your value proposition. This is simply a statement explaining the mission and value of your business and products.

      Two of the most important questions your value proposition should answer are:

      1. What problem does my product solve for customers?
      2. What makes my approach to this problem unique compared to other similar businesses?

      Establishing your value proposition now should help you create content later. Also, any copy, product, or long-form content (such as a blog post) should reflect the values you identified in your proposition.

      We’d also suggest sharing your value proposition with customers on your website. Most companies do this on an About page or as a ‘Mission Statement.’ Here’s ours as an example:

      The DreamHost About page.

      Sharing your values with customers can help demonstrate why your product is relevant to them. Plus, you might win over customers who might have otherwise purchased from your competition.

      Step 4: Create Your Product Pages

      Now you’re ready to go back to setting up your online store. Navigate to Products > Add New within WordPress to start adding your first item. There are a lot of settings to consider here, but your priority should be your product photos and description.

      Taking Quality Product Photos

      Showcasing your products in their (literal) best light is crucial. Unprofessional, low-quality photos make your site seem untrustworthy, which will discourage customers from opening their wallet.

      As such, make sure your product photos are well-lit and taken in front of a clean background. If you can, take pictures from a variety of angles, and include some close-ups of unique details to help catch customers’ eyes.

      A product photo of a throw pillow from Wayfair.

      Once you have your product photos, make sure to optimize them with a plugin such as ShortPixel or Optimole before uploading them to your site. This will help prevent large media files from slowing your site down.

      Writing Captivating Product Descriptions

      You’ll also want to craft your product descriptions carefully, to help convince site visitors to become paying customers. Keep your value proposition in mind when you’re writing, and make sure to point out information about how the product will benefit customers.

      A product description for a throw pillow from Wayfair.

      It’s vital to make your description easy to scan, as ‘skimming’ content has become more popular over the years. Keeping paragraphs short, while using formatting techniques such as bullet points and subheadings, can convey more information than a brutal wall of text.

      Specifying Product Data

      Finally, for this section, you’ll want to configure the settings in the Product Data section of the product editor. Here you’ll set your product’s price, add a SKU number and shipping information, specify if it comes in any variations (e.g., other colors or sizes), and more.

      The product data section of the WooCommerce Product Editor.

      Take your time with these, as they’re an essential aspect of your store and business. Once you have the basics down, you may want to consider setting up Linked Products to help cross-sell other store items and enable reviews to add some social proof to your site.

      Step 5: Configure Your Tax Settings

      In the U.S., each state has laws regarding sales tax for internet-based retailers. It’s not a bad idea to talk with a tax attorney before your business gets up and running, but at the very least, you should familiarize yourself with the laws in your area.

      To set up sales tax for your products in WooCommerce, navigate to WooCommerce > Settings > General within WordPress. Make sure the Enable taxes setting is checked, then save your changes.

      The Enable taxes setting in WooCommerce.

      If there wasn’t one before, you should now see a Tax setting tab at the top of your WooCommerce Settings page. Click on it, then configure the settings on the page.

      You can determine whether your prices will automatically include tax at checkout and what information WooCommerce should use to calculate tax for each product. It’s also possible to add Standard, Reduced, and Zero tax rates if needed.

      Step 6: Specify Your Shipping Methods

      Shipping is a make-or-break aspect of running a store. As such, in the Shipping settings tab, you can add practically as many options as you want to implement a delivery strategy.

      If you’re going to make your products available in a wide range of locations, you might want to create ‘shipping zones.’

      They essentially let you offer different rates to customers depending on where they’re located. If you also want to charge extra for international shipping, you can do so here.

      Step 7: Decide Which Payment Gateway to Offer

      In the Payments settings tab, you can specify how customers can pay for their products. By default, WooCommerce will set up Stripe and PayPal vendors for you.

      The Payment Methods settings in WooCommerce.

      However, you can add additional gateways — including popular solutions such as Square and Amazon Pay — with WooCommerce extensions. In addition, you can enable your customers to pay with a check, cash, or by bank transfer.

      The gateways you decide to offer are ultimately up to you, based on familiarity, ease of use, and transaction fees. However, it’s also important to consider your customers, as these criteria are also their primary concerns. As such, gateways such as PayPal are usually a given.

      Step 8: Run Through Your WooCommerce Search Engine Optimization (SEO) Checklist

      You’re almost ready to welcome customers to your store, but first, they need to be able to find it. SEO is the answer. By optimizing your content for search engines, you’ll make it more likely customers can find you while searching for products online.

      As with many site aspects, WordPress plugins can help. Yoast SEO is a highly rated and effective plugin that can help manage on-page SEO factors such as keyword usage, permalinks, and readability.

      The Yoast SEO plugin from the WordPress Plugin Directory.

      If you want something a little more specialized, you can also look into the Yoast WooCommerce SEO plugin.

      The Yoast WooCommerce SEO plugin.

      It’s better suited to WooCommerce than the free version, and can also help promote your products on social media. At $49 per year, it’s cost-effective and may be a solid investment, especially if it helps to bring in a few more organic customers via search engine.

      Step 9: Publish and Promote Your E-Commerce Website

      While you can keep refining your site, you’ll want to publish at this point — think of it as laying down a ‘marker.’ You’ll also want to make sure customers know who you are and what you do. Promoting your site on social media and through email marketing campaigns can help get you started.

      Fortunately, there are a variety of WooCommerce extensions available to help. You can choose popular services such as Drip, MailChimp, and even Instagram to promote your products to followers and subscribers.

      The WooCommerce Instagram extension.

      Marketing will be an ongoing responsibility, so investing in some tools to help you streamline your efforts will be worth it in the long run. The extensions mentioned above range from free to $79 per year. You can also search the WordPress Plugin Directory for more free solutions, although you may find functionality lacks depending on the plugin.

      Building an Online Store

      No one said becoming your own boss was easy, and there’s a lot of work that goes into starting a brand new business. However, WordPress and WooCommerce can simplify many of the tasks required to get your e-commerce site up and running.

      Ready to set up an online shop? Our WooCommerce hosting packages make it easy to sell anything, anywhere, anytime on the world’s biggest eCommerce platform.



      Source link

      11 Ways Your Online Store Can Compete with Mega-Retailers (And Win)


      It’s hard to grasp the sheer scale of mega-retailers such as Amazon. In 2018, Amazon alone was projected to take in almost 50 percent of US online sales. Plus, during the most recent holiday season, it accounted for 5 percent of the $1,002 trillion Americans spent. Launching an e-commerce store that can compete with those numbers is difficult, to put it lightly.

      Fortunately, your online store doesn’t have to beat the likes of Amazon or eBay to be successful. What it needs to do is find a share of the market for itself and learn how to thrive within that retail niche. That way, you’ll be able to scale your store and increase its earnings organically over time.

      In this article, we’re going to talk about 11 strategies you can implement to compete with e-commerce giants such as Amazon. We’re not saying you’ll end up making more money than Jeff Bezos, but every extra dollar helps, so let’s get to it!

      1. Focus on Niche Products and Services

      Wherever it is that you live, chances are there are a handful of online megastores where you can buy almost anything you want. Those types of stores excel at casting a wide net to catch as many buyers as possible. The problem is that they often can’t compete with specialized sites when it comes to offering more niche items.

      For example, while one of those mega-retailers might have hundreds of generic mugs for sale, you could offer to create custom designs, thereby filling a more specific niche.

      Personalization options are a way to differentiate products.  

      The main takeaway here is that if you’re starting out, the smart move is not to try and compete at every level. What you need to do is have a specific buyer persona in mind and focus on those buyers, offering the products and services they want. In many cases, filling a particular retail niche may even enable you to command higher prices, so it’s a win-win scenario.

      2. Offer Subscription-Based Services

      Offering subscriptions is an excellent strategy because it allows you to create consistent, recurring income. Plenty of big-box stores offer subscriptions. Amazon, for example, offers the incredibly popular Prime service.

      Amazon Prime is the world’s most famous subscription service.

      Even more niche stores, such as Humble Bundle, understand the power of subscriptions. On top of offering cheap video games, this store enables users to pay a set price each month for more stuff.

      Humble Bundle offers a set price for access to hundreds of games.

      Just because you run an online store doesn’t mean that all your income has to come from product sales. You can also offer subscriptions for monthly freebies, discounts in your store, access to exclusive deals, and more. Keep in mind, though — whatever angle you decide to take with subscriptions, it should synergize with your store’s products.

      Be Awesome on the Internet

      Join our monthly newsletter for tips and tricks to build your dream website!

      3. Provide Better and/or Cheaper Shipping Options

      Competing with massive online stores when it comes to shipping can be difficult. They move such large volumes of products that they can get access to discounts and perks small online stores can’t hope to match.

      What you can do to compete is offer better-quality shipping options for your particular region. In most cases, smaller stores will focus on specific cities or just one country. That means you have the edge over more global stores, since you may be able to offer faster shipping times and a more personalized experience throughout the process.

      In some cases, you might even have access to cheap shipping options you haven’t considered. For example, there are a lot of local startups focused around product deliveries. Partnering with them may enable you to offer ultra-fast low-cost shipping, depending on where your customers are located.

      4. Excel When It Comes to Customer Service

      The level of customer service you offer can make or break your store. People might be willing to take a chance and buy from a retailer they don’t know, but if you treat them poorly, you can be sure they won’t come back.

      Some of the most common service-related mistakes small retailers make include:

      • Taking too long to answer customer questions
      • Offering cookie-cutter answers to customers
      • Giving inaccurate shipping estimates or sending packages late

      Just to drive home how vital the customer experience is, keep in mind that happy clients are more likely to send new business your way. Likewise, retaining customers is much cheaper than collecting new leads. In other words, a little more time spent on ensuring better service can pay off for years to come.

      5. Optimize Your Online Store in Every Way You Can

      The difference between one and three seconds may seem insignificant, but it’s not — particularly if you run an online retail store. Studies show that if your website takes more than a few seconds to load, people start getting impatient. Amazon alone estimates that a one-second delay in its loading times could cost up to $1.6 billion in lost sales over the course of a year.

      In other words, your website needs to be fast. There are a lot of factors that can hurt its performance, such as:

      1. Using a hosting plan that doesn’t offer enough resources.
      2. Failing to optimize your images.
      3. Adding too many scripts to your pages.
      4. Not using browser caching.

      Reasons two through four fall under the category of poor website optimization. Still, it doesn’t matter how much effort you sink into optimization if your web host isn’t up to par. What we recommend is that you measure your site’s loading times, try to optimize them, and consider moving to a new host if you’re still not seeing the results you want.

      Shared Hosting That Powers Your Purpose

      We make sure your website is fast, secure and always up so your visitors trust you.

      6. Use Social Media to Promote Your Store and Its Products

      The largest online retailers can spend millions on advertising each day. At the same time, so many people are familiar with them that word of mouth alone is often enough to get them plenty of sales.

      ‘Mom-and-pop’ online stores, on the other hand, need to be much savvier when it comes to marketing. Since you can’t compete in terms of budget, the easiest way to get attention to your store is via social media. This involves:

      1. Being active on several social media platforms.
      2. Knowing how to engage with your audience and reach new users.
      3. Connecting with influencers who can promote your products.
      4. Using non-traditional forms of content, such as infographics, for higher engagement.

      The main takeaway is that small businesses need to make more of an effort to get online conversions. However, if you know which platforms to focus on and you have a good grasp of social media, these approaches should yield excellent results. Also, keep in mind that it might be worthwhile to hire a social media manager if you’re not as savvy in this area, as it’s essential to your store’s success.

      7. Work on Your Email Marketing Strategy

      There’s a reason almost every single website and online store wants your email address. They understand that it’s a powerful tool to drive sales and increase engagement. About half of all US internet users check their email multiple times per day, and up to 60 percent of users say that the messages they get influence their purchases.

      More importantly, email marketing is incredibly scalable, even for a small store. The more addresses you collect, the more sales you can drive via campaigns. What’s more, most email marketing platforms enable you to send an almost unlimited number of messages for a low price.

      That’s not to say that you should spam your subscribers, however. In fact, you should only contact them when you have something of value to offer, such as product discounts, important news, and so on.

      Amazon sends targeted email deals.

      If you’re already using email marketing but you want to get more out of it, then it may be time to review your strategy.

      8. Consider Streamlining Your Product Catalog

      It stands to reason that the more products you offer, the more sales you’re likely to get. The problem is that managing a huge catalog of items can be much more complicated than you’d imagine. For each product, you have to consider sourcing, storage, shipping costs, marketing materials, and more.

      For massive online stores, that isn’t a problem. They’re all about volume, and they can throw all the manpower they want at the above tasks. However, the more strapped you are for money and personnel, the more that overextension can hurt you.

      Fortunately, it’s entirely possible to run a successful online store that offers a limited catalog of products. SlimFold, for example, built an entire e-commerce experience around a handful of unique wallets.

      Alt text: SlimFold has a streamlined product offering.

      Offering a limited catalog ties in perfectly with targeting a specific niche of users. As long as you know there’s demand for the products and services you offer, you can limit them to give a feeling of exclusivity, and even test higher price points.

      9. Offer Multiple Payment Options

      When it comes to online purchases, most people rely on credit cards. However, there are a lot of payment processors you can use, including PayPal, Stripe, Amazon Pay, and many others.

      You’ve probably noticed that a lot of the major online retailers offer several payment options during their checkout processes. This enables customers to pick whichever choice they feel most comfortable with, so the store doesn’t lose out on any potential purchases.

      Large retailers offer many payment options.

      For smaller online stores, dealing with a lot of payment processors can be a hassle. It means that your earnings will come in via multiple channels, you’ll have to set up accounts for each one, and you’ll need to make sure you’re in compliance with various policies.

      However, despite those downsides, offering multiple payment options is still the way to go for most online stores. At the very least, you should enable users to pay via PayPal and the most popular credit cards — just to cover your bases.

      10. Study the Competition Within Your Niche

      So far, we’ve focused mostly on how to compete with mega-retailers. However, it’s crucial that you don’t lose track of other smaller stores within your niche since they’re also competitors.

      Studying your direct competitors so you can provide a better experience than they do is incredibly important. After all, smaller stores can be much easier to overtake than e-commerce giants. You can compete with these competitors in a number of ways, such as:

      These are similar to some of the tactics we’ve discussed so far. Only this time, you’re competing against another David instead of Goliath.

      11. Offer Only the Best-Quality Products

      Since you can’t generally compete with mega-retailers in terms of inventory, pricing, or shipment, you need to focus on quality. We’ve already talked about providing top-notch customer service, but making sure the products you offer are as good as they seem is also essential.

      These days, online megastores such as Amazon are getting overrun with cheap product knockoffs. That’s causing a real headache for the consumer, who doesn’t understand why they’re getting low-quality items from a retailer they know and trust.

      This opens up the opportunity for smaller online stores to attract those customers. In many cases, people who want high-quality items will turn to more specialized online stores. If you can guarantee that your products are the real deal, and you offer a solid return policy, this can be one of your best ways to get more sales.

      Supply Chain

      When it comes to an e-commerce business, you need to be realistic about your expectations. Competing with mega-retailers when it comes to inventory or pricing is just about impossible. However, there are plenty of e-commerce operations that manage to grow and thrive, despite all the competition they face.

      The key is to understand that although you can’t compete in some categories, there are plenty of areas where smaller stores can get a real edge. For example, smaller operations can provide much more personalized customer service or focus on product quality in a way that mega-retailers can’t.

      What do you think is the best way for online stores to compete with giants like Amazon or Walmart? Share your thoughts and ideas with us in the DreamHost Community and let’s discuss!



      Source link