Miva Merchant Custom Product Field Conundrums

One of the handiest features of Miva Merchant 5+ is the inclusion of built in custom product fields. These fields can be used for an enormous variety of purposes, from adding product specific data (author, manufacturer, dimensions, materials, etc) to acting as a boolean-style test variable for setting up conditional displays of information.

Unfortunately, custom product fields are not quite as intuitive as they are handy. So here are some tips for working with them.

First, how to set them up?

  1. In the Miva Merchant admin, in the left hand menu, click Utilities (the word, not the plus sign). Check the box beside Custom Fields and click Update.
  2. You will now see some new tabs across the top of the configuration settings. Click Custom Product Fields.
  3. Click Add. Enter a Code (see Tips & Tricks below) and a Name and click Update.

Second, you have custom product fields, now what?

To add custom field data to your products, there are two methods you can use.

Method 1:

  1. In Quick Find, select Products. In the search box, type a search term for your product and click Go.
  2. In the row for your chosen product, click Edit.
  3. In the tabs above the input boxes, you’ll see Custom Fields. Click that tab, and you’ll see your new custom field displayed, with a text box beside it.
  4. Enter your text (see Tips & Tricks below) and click Update.

Method 2:

If you have a lot of products for which you need to add custom fields, the above method isn’t very practical. Instead, you may wish to use the built in import functionality. The easiest way to do this is to start by setting up a single product with some content for your custom fields.

  1. Start by following the steps above for a single product.
  2. Then, expand Utilities (this time click on the plus sign).
  3. Expand Export Data and click Export Products to Flat File.
  4. In the custom field sections, check the box(es) beside your new custom field(s).
  5. Select your other settings, and click Export.
  6. Your export file will be in your mivadata directory, typically above the root on your server. Contact your host if you are not certain how to locate this file.
  7. Import the file into Excel or another suitable program, and enter the data for your custom field(s).
  8. Save the file as tab delimited (this has its own issues, which I’ll address in another blog post) and import to Miva Merchant.

Third, you’ve got data…now how to get it to show up on the site?

So, you have your content saved in your new custom product fields, and now you’d like to display it somewhere on a product page. Here’s where the tricky part comes in.

Custom product fields are available by default on the PROD (Product), CTGY (Category), SRCH (Search) and PLST (Product List) pages. Other pages may require the Tool Kit from Emporium Plus to access custom fields.

In order to display a custom product field on your product page, you must enable it.

  1. To start, go to Pages> PROD and click Edit.
  2. Click the Tab for Product Display Layout.
  3. If you are in Advanced Mode, you will need to switch to Point and Click mode. Look for the link near the bottom of the screen.
  4. In Point and Click mode, you will see a section for Custom Fields, with your new custom field, and a checkbox to activate it.
  5. Check the box, and click Update.

Important: If you’ve made any modifications to your template, activating the custom fields will reset the template back to its original state.

  1. In order to both recall your changes and insert your new custom fields, you will need to switch to Advanced Mode by clicking the link at the bottom of the screen.
  2. From the version history, select your most recent version prior to this update, and click recall. Then click update.
  3. Now to insert your custom product field, you will need to paste the code below into your template where you would like it to appear. You may of course modify the code as needed to suit your purposes, and do be sure to replace YourCode with your actual custom field code.
<mvt:if expr="NOT ISNULL l.settings:product:customfield_values:customfields:YourCode">

Finally, the Promised Tips and Tricks

There are some sneaky things about custom product fields that I’ve found out the hard way. If you’ve followed the steps above, and the custom fields still aren’t showing as intended, here are some things to check.

  1. Make sure the custom product field has data. Check that the product on the page you’re looking at actually has some content in its custom field.
  2. Make sure you enabled the custom field properly in the relevant template using the steps above (I know…but humor me and double check anyway).
  3. If you edited the page template to restore your customizations, make sure you correctly entered your custom field code in the store morph tokens.
  4. Check the length of the custom field code. It has been my experience (completely unverified and anecdotal though it may be) that custom field codes that are longer than 10 or so characters do not work as expected. The code seems to get truncated, which means that the store morph token doesn’t match it, and therefore it doesn’t display.
  5. Check for hyphens in your custom field code. Sometimes they work ok, but other times they create problems. If at all possible, keep your custom field codes short, and use alpha and numerical characters only.

One final word on custom fields. They have a character limit, set in the database, of 254 characters. If you’re using MySQL, you can edit the s01_CFM_ProdValues table and set the type for the Value field to tinytext or tinyblob depending on your needs. If you’re not experienced in working with MySQL, ask your host for help, or hire a professional to do this for you.

Be Sociable, Share!

12 Responses to “Miva Merchant Custom Product Field Conundrums”

  1. Anonymous says:

    Thanks! I couldn’t figure out why my customfields suddenly stopped appearing, and this was the first google hit that came up. You just saved me hours of headaches!

  2. Tiny Queen says:

    I’m so glad it was useful to you! Thanks for letting me know it helped.

  3. Matt says:

    Any idea how to get these custom fields to show up in searches on the website? I added a manufacturer custom field and when I search for the manufacturer nothing shows up. If I add it to the description that works, but I was hoping for a slicker solution.

    Any ideas?

  4. Tiny Queen says:

    Hi Matt,

    The Power Search module from Emporium Plus has the option to include custom fields, and allows you to select which specific custom fields you want to have searchable.

    If you don’t want to invest in a module, you can put the search terms in your description between html comment tags so they don’t display on the page, but you should research the search engine implications of this method before implementing it.

  5. Matt says:

    Looks like a perfect module. Thanks!

  6. Peter says:

    Got as far as step 3 under the section “First, how to set them up?” – but there is no “Add” button. How do you add the field? Thanks!

  7. Peter says:

    never mind – it’s the yellow button. However, it’s unclear what the field properties do – i.e.
    – what is the “code” and what does it do? where is it used? eg?
    – what is the “prompt” and what does it do? eg?

  8. Peter says:

    You don’t mention how to actually get to the template for the product detail page – Where is this located? Thanks!

  9. Tiny Queen says:

    Hi Peter,
    To get to the product template, in the admin panel on the left, click Pages. Locate the PROD page in the list, and beside it, click the edit button. Then from the tabs in the right panel, select Product Display Layout.

  10. Jack says:

    Very nice tutorial – thanks!

  11. Jonathan says:

    Is it possible to use the custom fields in the PROD Page layout also? I’m having success using them in the Product Display Layout, but I would like to be able to reference them also in the Page layout (Page tab) and I’m striking out there.

  12. Tiny Queen says:

    Hi Jonathan,

    Yes, you sure can use the custom fields in the PROD page layout. You do still need to assign them on the Product Display Layout tab in order to use them in other parts of the page.