Quick Tip: Easy Domain Switching for Miva Merchant Stores
August 25, 2008 by Susan Petracco · 3 Comments
Because we do a lot of redesigns and offline development, our customers usually have at least two stores operational at one time - the live store and a development platform. Sometimes that makes it hard to test, though, if links from the development site link back to the live site half of the time. You don't always notice when you navigate away from the development site.
The sessionurl and secure_sessionurl variables in Miva Merchant will automatically pick up the right domain. But any hardcoded URLs, if they are using absolute paths (and in most cases, they should) will not be as easy to manage. And if you use shortened SEO-friendly urls, you may have even more widespread URLs to manage.
Here's an easy tip for Miva Merchant users who have more than one environment: set a variable in your store that references your domain name, and then build your URLs around that. This is easy if you use the Toolkit module from Emporium Plus. Go into Miva Merchant, click the name of your store within the left frame, and then on the right side, click HTML Profile. The great thing about this field is that it's usually the first field referenced by the store's page templates. (If your site doesn't use the HTML profile, or if you are running Miva Merchant 5.0 instead of 5.5, use the head tag insert field.)
At the bottom of this box, enter the following code:
Then to change the variables for a particular environment, you just have two variables to change. Still too much work? You can use the toolkit to extract the url from your domain settlings instead:
After that, you can build your URLs using this "basedomain" global variable, and when you copy code from one site to the other, the links should still work. Here's an example link to the shopping cart page:
This little bit of work can make your life much simpler down the road!
Fulfillment Companies Ease the Shipping Burden for Ecommerce Companies
August 22, 2008 by Susan Petracco · 8 Comments
Until 2006, Glynn Gallagher's life was "really, really hectic to say the least.". She started work every morning at 8 am, printing out her previous day's orders from her website LockPickShop.com, along with a picklist, and trudged out to the makeshift warehouse building in her backyard. The rest of the day was spent answering customer service calls, packing orders for shipment, and handling returns. She skipped breakfast and allotted herself a 20-minute lunch break. After repeating the process in the afternoon for all the morning orders, she loaded all the boxes in her car and drove to the post office, waited for them to process her orders, and then drove to the UPS Store and did the same thing. She came home and dealt with emails and her website until midnight each night.
Read moreQuick Tip: Including Recent Wordpress Posts in Miva Merchant
June 30, 2008 by Susan Petracco · Leave a Comment
The great thing about having a blog for your business is that it gives customers and search engines new content to view. It can increase sales by convincing customers of your product's benefits, or teaching them how to use it, or giving them ideas for incorporating the product into the lives.
But it's essential to integrate the weblog with your storefront. If customers can't go back-and-forth between your store and your weblog, the impact of your blog is going to be less than optimal. If you are using Miva Merchant 5 and Wordpress, however, one of the simplest ways to integrate the two is to include recent blog posts right on your homepage.
To start out, you need a template that can display a very simple HTML page - one that, in this example, is no more than the title of each post, linked to the full post itself. This can be done by modifying the index.php file within your Wordpress template (located in wp-content/themes/your-theme-name). Just add this code at the top of your index.php file:
The rest of your original index.php should follow this code. Then at the very bottom, close your "if" statement like this:
At this point, you should be able to see your recent posts by going to the following URL. Be sure to replace "domain.com" with your website domain name, and replace "weblog" with the correct directory for your Wordpress installation:
At this point, you're ready to begin working in Miva Merchant. You'll need Emporium Plus's Toolkit module installed. Then, inside Miva Merchant, go to Pages and edit your Storefront (SFNT) page or your Storefront Welcome Message (under Messages). Add the following code (again, replacing the appropriate parts of the URL as specific to your site):
This will print out the list of recent posts from your weblog right on your Miva Merchant storefront.
Quick Tip: Setting a Fallback Image
June 11, 2008 by Susan Petracco · 2 Comments
Nothing looks less professional than an ecommerce site full of broken images! However, if you're running a site with a lot of products, it's bound to happen every now and then. Here's how to stop it from happening.
Most ecommerce sites use images to provide a visual representation of their product line. Product images are usually set in one of two ways - either specified in a database field provided by the shopping cart package, or specified in a template by using a file naming convention (for example, /images/PRODUCTCODE.jpg where PRODUCTCODE is replaced with the actual code for each product). Either is a convenient way for specifying product images. However, because the HTML code produced is always dependent on the existance of an image on the filesystem. there is a possibility that your site will display the dreaded "red X" or broken image icons - or in some browsers, such as Firefox, the image's alternate text.
Although it's always best to have images for every single product, it's also a good practice to configure fallback images. These are images that display whenever the specified image in the HTML output cannot be found on the server. We do this by using mod_rewrite rules in our .htaccess file.
A .htaccess file (note the dot in the front) is a method offered by Apache for setting up configuration parameters for the web site. We start by adding the following line to enable mod_rewrite if it does not already exist:
The next set of code looks for any requested files that do not exist, and if the URL has the extension .jpg and resides in the images directory, it is replaced with the image "comingsoon.jpg" located in the images directory. The browser still sees the URL specified in the HTML, but the server delivers the comingsoon.jpg image instead:
Of course, make sure you actually have an image named "comingsoon.jpg" in your /images/ directory!
This method will deliver a fallback image, one that might say "Photo Coming Soon", in place of any missing images. No more broken image links.
If your site uses multiple-sized images, such as thumbnails and full-sized images, you can have multiple copies of this code in your .htaccess file, with the appropriate changes to manipulate files in different directories or with different naming structures. Below is an example from one of our clients, whose site displays 4 sizes of images, with each size residing in a different directory:
Building a Miva Merchant Website with XHTML and CSS
April 12, 2008 by Susan Petracco · Leave a Comment

For web development purists, the holy grail of coding an ecommerce site using an off-the-shelf package is the ability to write a fully standards-compliant site. The upcoming Miva Merchant 5.5 release brings this desire into full reality for Miva Merchant developers. Version 5.5 offers a completely-open page templating system, where all aspects of the site are fully customizable at the HTML and CSS code level.
Historically it was much more difficult to code a Miva Merchant site with XHTML and CSS. We pioneered the effort, using a variety of add-on modules such as OpenUI and OpenUI Supermod templates to provide access to the code around the page elements. But the method also involved a couple of hacks of the core Miva Merchant files, to add a doctype declaration and to change the <HTML> tags from upper-case to lower-case. OpenUI Supermod templates were slow, so we often added Merchant Optimizer to speed up the site. It worked well, but building a site in this manner was akin to applying band-aid upon band-aid to force a system, never intended to allow standards-compliant code, to produce the desired effect.
The release of Miva Merchant 5.0 provided a huge step forward. With the addition of pages that can be templatized nearly from start to finish using Miva Merchant's Store Morph Technology, developers now had the ability to code almost the entire site according to modern standards for markup and layout. A few third-party modules were still needed, to gain access to "black box" code areas such as the category tree. But Miva Merchant 5.0 was already much faster, thanks to the ability to run the shopping cart on a MySQL database (instead of the older DBF files). And with native templating support, which renders quickly due to its compiled nature, several layers of complexity (and those "band-aids") were removed.
Miva Merchant 5.5 brings this all into fruition, as developers can now access all of the code that builds the site. To get started, the first thing to do is to make sure every page in the site conforms to the proper doctype. I prefer XHTML 1.0 Strict, though we've sometimes used Transitional for various reasons. A doctype paves the way for CSS positioning by bringing Internet Explorer out of quirks mode, allowing the site to look very similar in all modern browsers, when designed properly.
Next, all the tables should be removed from the pages, except when used to display actual tabular data. XHTML and CSS websites rely on CSS positioning to define their layouts, instead of putting images and content within the cells of HTML tables. Typically the only table we use on a CSS-based Miva Merchant site is the layout of the basket contents, since that is tabular data by nature. Instead of using tables, content is placed within other elements according to the nature of the content - <div> tags for block-level elements; <span> tags for inline content, <p> tags for paragraphs, etc. Elements can be assigned a class or an id so that they can be styled via the CSS stylesheet.
Larger Miva Merchant sites often need to consider the fact that the site may also include other packages or custom-coded sections that reside outside of the Miva Merchant framework. To reduce the load on the filesystem and to keep the assets organized - as well as to make it easy to switch between one client and another - we try to standardize the location of the site's assets. For example, all site-wide graphic files are stored in a /images/ path, just off the document root, and not within the /mm5/ directory tree created by Miva Merchant. (This /images/ folder may be further subdivided into subfolders such as /images/buttons/ as needed.) JavaScript code is placed in external .js files located in a /js/ directory. And the stylesheet(s) are stored in /style/, with the main site stylesheet being named style.css. Additional CSS files may be added for popup windows, printing a page, or page-specific elements, but are almost always stored in the same directory.
Once the CSS file has been created, it can be linked into Miva Merchant by adding a <style> tag into the head section of the site. This can be done on each individual page, but for a site-wide stylesheet, the easiest way to manage it is to add the style tag into the HEAD Tag Content found in the Miva Merchant administration by clicking the name of the store on the left side. The tag looks like this:
Probably the most difficult part of building a Miva Merchant website using XHTML and CSS is the addition of features from third-party modules that don't support XHTML and/or CSS. This can be hard to ascertain while shopping for modules, so one often has to ask the developer whether it can be done. If not, certain sections of the site may simply not conform to the standards in use, which occasionally causes rendering problems in some browsers, but often has no effect other than generating errors when validating a site against the doctype. However, some developers are now starting to see the benefit in allowing this, and offer more granular components that allow developers to include the data within their own HTML - for example, by providing the price breaks in a volume pricing module in an array, for display in any manner desired.
The benefits of using XHTML and CSS, and moving away from using tables for layout, is reduced code bloat and, arguably, better on-site optimization for SEO purposes. It also allows site changes to be applied to the site globally, by updating the stylesheet - one file - instead of hundreds of table and font tags across multiple pages. Although the transition to CSS-based design involves a sizeable learning curve, it's one well worth the effort.
Advanced URL Rewriting with Miva Merchant
March 26, 2008 by Susan Petracco · 1 Comment
URL Rewriting is a way of changing the URLs within a website to a more logical and/or more search engine-friendly format. The default URLs within a Miva Merchant site are long and full of querystring variables, and can easily be rewritten to cleaner formats, as described below. To find out if this is available for your website, check with your web host.
History
URL Rewriting first became popular among Miva Merchant sites when Copernicus released their Search Friendly Links module, long before the advent of Miva Merchant 5.0. At the time, Google favored URL structures that had, at most, a single name-value pair in the querystring. To understand this, one must look at the structure of a URL. A URL begins with either http:// or https://, followed by the domain name (such as www.google.com). After that comes another slash, zero or more directories separated by slashes, and a filename. For example:
In this example, www.site.com is the domain name, mm5 is a directory, and merchant.mvc is the name of the file within the mm5 directory that is being called. A querystring is appended to the URL by adding a question mark, and then one or more name-value pairs separated by ampersands. This can be seen throughout Miva Merchant, such as the URLs that define a product page:
In the above example, the querystring contains three name-value pairs: Screen=PROD, Product_Code=ABC123, and Category_Code=flowers. At the time that the Search Friendly Links module was released, since Google was devaluing links with more than one name-value pair, this type of URL clearly did a disservice to Miva Merchant site owners. Search Friendly Links changed the above URL to a directory structure:
Mod_rewrite
The mechanism that allows this to work is built into Apache, the webserver commonly used on *nix servers, and is called mod_rewrite. To turn on mod_rewrite for your site, you need to edit (or add) the .htaccess file in your root directory. Note that on *nix servers, files that begin with a period ("dot files") are hidden by default, so you may need to set your FTP client to show hidden files or dot files in order to see the .htaccess file in the list. Within the .htaccess file, add this command above any rewrite rules:
This command turns on the rewriting engine. Specific rewrite rules can be added based on the format chosen below.
"Supershort" or "Jedi-style" Links
Although Search Friendly Links is no longer needed with Miva Merchant 5.0 and above, mod_rewrite can still be used to generate shorter URLs that offer an advantage among the search engines, and offer the customer a more logical set of URLs for the website.
One common URL format is to add a "c-" to designate category page URLs, and a "p-" to distinguish product page URLs. Using our example above, these URLs would become:
The URLs within the pages inside of Miva Merchant 5 can be changed to this format in the following manner:
And to allow these URLs to work, the following Rewrite Rules should be added to the .htaccess file below the "RewriteEngine On" line:
"Store" directory - Miva Merchant within a larger site
Sites that include a Miva Merchant store within a larger framework of pages or applications might want all shopping cart pages to appear in the /store/ directory, for example. Using this in combination with the "supershort" link format above produces:
The SMT code looks like this:
And the rewrite rules might look something like this:
Smart Links - The Shortest Possible Links
By adding the Smart Links for SEO™ module, it is also possible to create even shorter links. This module takes the string after the domain name, and looks within the Miva Merchant database to determine whether the string represents a category code, a product code, or a page code. (Note that when using this module, a store should NOT have product codes, category codes, and screen codes that overlap each other; they should all be unique.) This module allows a store to display these type of URLs:
In the first URL, "flowers" refers to a category code. In the second one, "ABC123" refers to a product, and in the final URL, "aboutus" is the code for a custom page. The rewrite rule for this format is simple, as it redirects the user to a single URL controlled by the Smart Links for SEO module. The rule looks like this:
Summary
No matter which rewriting method you choose, be consistent with your URLs. Google in particular frowns on duplicate content, and although they are great at determining canonical URLs (the primary URL to reach a given page), you don't want to take any chances. And just in case, it might be a good idea to block robots from your /mm5/ directory using your robots.txt file. Do your planning up front, so you don't have to change your URL format down the road (which might cause your search engine rankings to drop). Figure out how you intend to optimize your URLs, formulate a plan, and stick with it, for ultimate success.
Weblogs for Ecommerce Sites
February 28, 2008 by Susan Petracco · Leave a Comment
To get sales, your website has to get visitors. And one of the best ways to get visitors to your website is to rank well within the search engines. That is an entirely different subject, but one of the easiest things to consider is implementing a weblog for your business.
Read moreUsing Order Management Software
February 27, 2008 by Susan Petracco · 2 Comments
As ecommerce stores grow, the process of filling orders becomes increasingly tedious without software to help. Some shopping carts have some of the features needed to fill orders, such as the ability to print packing slips, track order history as well as packages, and so forth. But bringing an order management package online is often one of the best things a business owner can do to streamline this process.
Read moreHow to Write Great Product Descriptions
January 16, 2008 by Susan Petracco · 1 Comment
There's no doubt that, on the web, a thousand words is worth quite a bit more than a picture! At least, that maxim holds true when one things of search engine optimization. While shoppers love images, search engines love words. The problem is that writing good product copy is time-consuming, and, for some of us, downright difficult.
Many of us sell products that aren't unique to our website. The products you sell - toys, kitchen supplies, home decor, etc. - may also be carried by a number of other retailers. Often, the manufacturers of these products offer canned product descriptions for use on the web. Although the quality of the writing of these descriptions may range from poor to excellent, keep in mind that even the most well-written descriptions, if used by other sites, may have less value to the search engines than copywriting that is both unique and compelling.
Remember that the best product descriptions have the following values:
- They are unique to your website
- They are keyword-dense for SEO purposes, but above all, read well for human visitors
- They are long enough to convey the information needed to make a purchase decision
- They are simple enough for people to understand without thinking too hard
One of the resources we love is 73 Ways to Describe a Widget. This ebook helps jump-start your brain when you need to figure out how to describe what you're selling. For example:
- What occasion is the item appropriate for?
- How will the buyer feel when using your product?
- How long has this item been selling selling?
Another website that has a lot of useful information about copywriting is Marketing Words. In fact, that's how I found out about the 73 widgets ebook. There's also a nice article at Vitamin.
However, it helps to also keep it simple. Don't forget the basics: color, size, weight, texture, materials, skills required to use the product, advantages, and uses. Remember that it's the words on your site that attract the search engines and also convince users to make a purchase.
Choosing Product Codes or Item Numbers
January 16, 2008 by Susan Petracco · Leave a Comment
If you're building your first ecommerce site, the idea of choosing a convention for your product codes may seem like a trivial task. After all, the product code is typically something that is primarily internal to your business, so what difference does the format make to your customers? The answer is, probably none. But it could make a huge difference on how you manage your stock, your customer service, your sales, and your marketing.
One of the first considerations is whether your shopping cart builds URLs based on your product codes. For example, Miva Merchant's default urls to product pages contain the product code as part of the querystring. Consider this example:
Note the last part of the URL - "ABC123". That is the code for our hypothetical product. Now, consider what the URL might look like if you employ URL-rewriting strategies as part of your SEO work:
Although SEO experts still heavily debate the benefit of having keywords in your URLs, you can see how replacing "ABC123" with a keyword-based product code, such as "coiled-garden-hose" could give you a search engine boost!
That's how we started life with our toy store WonderBrains. Our product codes included "4-childrens-card-games","magnetic-poetry-original-kit", and other keyword-based product codes along those same lines. This gave WonderBrains a search engine boost at the time (and I feel they still have some positive effect now). However, we quickly ran up against filename limits. Miva Merchant supports 50 characters for its product codes, but QuickBooks only supports 31. That caused some issues when we tried to synchronize inventory levels between the two systems, because Quickbooks truncated any product codes longer than 31 characters. Later, we introduced Photoshop actions to batch-process images, and discovered a 27-character limit when saving files (until we discovered the value of unchecking the Mac OS compatibility flag).
Another consideration we had was the fact that we wanted to introduce a catalog in 2008. That meant phone orders. It didn't make sense for customers to call in and ask to order item "calico dash critters dash deluxe dash village dash house"! This was another justification for shorter product codes. We decided to go ahead and bite the bullet and change the product codes on over 2000 items.
We settled on a format consisting of a two-letter prefix followed by 6 digits. The two characters uniquely represent a vendor. Putting these first allow us to sort our picklist by product code, and end up with a picklist where items from each vendor are grouped together (based on that 2-letter prefix). Since our warehouse is organized by vendor, that made picking items much quicker - an immediate payoff. The new format also solved the problem of synchronizing inventory levels between Miva Merchant and Quickbooks, and we switched to Easy Inventory Update to make that task go a lot smoother. The new format will also allow customers to more easily order an item by phone when the catalog is released later this year.
Whatever format you choose, there can be a lot of effects down the road among the various systems you will need to run your business. Consider not only your shopping cart, but also your fulfillment software, your CRM package, your customer needs, your warehouse, or anything else that could be affected by the format. It's easiest to get it right the first time, then it is to change it after your catalog has grown to a large size and your site has taken a firm hold in the search engines!


