Miva HeLp! E-commerce for the rest of us.
E-commerce for the rest of us. 

one.gif (80 bytes)
Click Here for information on the East Coast Miva User Group meetings
one.gif (80 bytes)
one.gif (80 bytes)
Miva HeLp! HomeReady, Set, Go!TutorialsResourcesReviewsContact Us
one.gif (80 bytes)

Search Miva HeLp!

one.gif (80 bytes)
one.gif (80 bytes)

one.gif (80 bytes)

Quick Links

one.gif (80 bytes)

 

         Fatal Error Page in Miva Merchant
   By Ahmed Saad,  Technology Matrix Group - Copyright 2002
 
This article involves editing Core Files so please proceed with caution.  Make sure you make a backup BEFORE you start working and that you have read the tutorial on editing the MMUI.mv file or are familiar with such things.  THIS CANNOT BE DONE ON THE COMPILED VERSION OF MIVA MERCHANT (i.e. V4.14) but can be used on any version of Merchant before V4.14.

If you have compiled Merchant you will need this module to create your custom error message.

If you have had Miva Merchant for a while you have probably seen the unsightly fatal error page that is displayed when you (or your potential customer) try to access an invalid URL (a product that you have deleted, a category that you no longer use, etc.).

Fatal Error Page in Miva Merchant

It is possible to have Merchant display your custom error page (which no matter how lousy of a designer you are will be better than this) by using the following steps:

Step 1

Create your custom page using your favorite html editor.   Make sure it is uploaded to the server.  Use absolute references to any images you have on it (i.e. do not use ../images/logo.gif but use http://yoursite/images/logo.gif instead).  We will call this page custom.htm for this tutorial.  On our page we did not put the words "error", or "bad URL", or "Oops!", but used instead words that encourage the visitor to click on the links we have placed to various active categories and products.  This is so that search engines that may have indexed an outdated product or category page will "see" a normal looking page versus a "catch all" bad URL page.    

Step 2

Download the file responsible for generating the error using FTP. The file is called util.mv and is located under the lib folder. The path will look something like Merchant2/lib/util.mv or Merchant2/4.12/lib/util.mv.

Special thanks to Pamela from DesignExtend for pointing out where the file is located.

Step 3

Open the util.mv in a text editor, just as described in the editing mmui.mv tutorial.   Locate the following text:

<HEAD>
 <TITLE>
 <MvLOCALIZED ID = "MER-UTL-00002">
  <MvLOCALIZED-TEXT LANGUAGE = "en-US">
Miva Merchant: Fatal Error</MvLOCALIZED-TEXT>
 </MvLOCALIZED>
 </TITLE>
 </HEAD>
 <!-- Title -->

Replace Miva Merchant: Fatal Error with something like "Welcome to Our Store".

Then right after <!-- Title --> insert the following:

<MvDO FILE="../../../custom.htm">

The number of ../ is dependent on where the custom.htm file you created in step 1 is located.

Step 4

If you DO NOT want the error text to show at all then you need to do one more step.  Comment out the part that comes right after the one mentioned above, i.e. put <!-- in front of it and end with -->

<!--
 <TABLE BORDER = 0 CELLPADDING = 1 CELLSPACING = 0 WIDTH = "100%">
 <TR><TD BGCOLOR = "#ffffff">
  <TABLE BORDER = 0 CELLPADDING = 5 CELLSPACING = 0 WIDTH = "100%">
  <TR><TD BGCOLOR = "#ffffff" WIDTH = "100%">
   <FONT FACE = "Arial, Helvetica">
   <MvLOCALIZED ID = "MER-UTL-00003">
    <MvLOCALIZED-TEXT LANGUAGE = "en-US">text goes here</MvLOCALIZED-TEXT>
   </MvLOCALIZED>
   </FONT>
  </TD></TR>
  </TABLE>
 </TD></TR>
 </TABLE>
 <BR>

 <TABLE BORDER = 0 CELLPADDING = 1 CELLSPACING = 0 WIDTH = "100%">
 <TR><TD BGCOLOR = "#e6d5c7">
  <TABLE BORDER = 0 CELLPADDING = 5 CELLSPACING = 0 WIDTH = "100%">
  <TR><TD BGCOLOR = "#e6d5c7">
   <FONT FACE = "Arial, Helvetica" SIZE = "-1">
   <MvLOCALIZED ID = "MER-UTL-00004">
    <MvLOCALIZED-TEXT LANGUAGE = "en-US">
    </MvLOCALIZED-TEXT>
   </MvLOCALIZED>
   <BR>
   <BR>
   <TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0>
   <TR><TD>
    &nbsp;&nbsp;
   </TD><TD ALIGN = "left" VALIGN = "middle" NOWRAP>
    <FONT FACE = "Arial, Helvetica" SIZE = "-1">
    <MvLOCALIZED ID = "MER-UTL-00005">
     <MvLOCALIZED-TEXT LANGUAGE = "en-US"></MvLOCALIZED-TEXT>
    </MvLOCALIZED>
    </FONT>
   </TD><TD ALIGN = "left" VALIGN = "middle">
    <FONT FACE = "Arial, Helvetica" SIZE = "-1">
    <MvEVAL EXPR = "{ g.Error_Code }">
    </FONT>
   </TD></TR>

   <TR><TD>
    &nbsp;&nbsp;
   </TD><TD ALIGN = "left" VALIGN = "top" NOWRAP>
    <FONT FACE = "Arial, Helvetica" SIZE = "-1">
    <MvLOCALIZED ID = "MER-UTL-00006">
     <MvLOCALIZED-TEXT LANGUAGE = "en-US"></MvLOCALIZED-TEXT>
    </MvLOCALIZED>
    </FONT>
   </TD><TD ALIGN = "left" VALIGN = "middle">
    <FONT FACE = "Arial, Helvetica" SIZE = "-1">
    <MvEVAL EXPR = "{ g.Error_Message }">
    </FONT>
   </TD></TR>
   </TABLE>
   </FONT>
  </TD></TR>
  </TABLE>
 </TD></TR>
 </TABLE>
-->

Step 5

The part we edited will look like this:  (the edits we did are in RED)

<HEAD>
 <TITLE>
 <MvLOCALIZED ID = "MER-UTL-00002">
  <MvLOCALIZED-TEXT LANGUAGE = "en-US">
Welcome to our Store</MvLOCALIZED-TEXT>
 </MvLOCALIZED>
 </TITLE>
 </HEAD>
 <!-- Title -->

<MvDO FILE="../../../custom.htm">

<!--
 <TABLE BORDER = 0 CELLPADDING = 1 CELLSPACING = 0 WIDTH = "100%">
 <TR><TD BGCOLOR = "#ffffff">
  <TABLE BORDER = 0 CELLPADDING = 5 CELLSPACING = 0 WIDTH = "100%">
  <TR><TD BGCOLOR = "#ffffff" WIDTH = "100%">
   <FONT FACE = "Arial, Helvetica">
   <MvLOCALIZED ID = "MER-UTL-00003">
    <MvLOCALIZED-TEXT LANGUAGE = "en-US">text goes here</MvLOCALIZED-TEXT>
   </MvLOCALIZED>
   </FONT>
  </TD></TR>
  </TABLE>
 </TD></TR>
 </TABLE>
 <BR>

 <TABLE BORDER = 0 CELLPADDING = 1 CELLSPACING = 0 WIDTH = "100%">
 <TR><TD BGCOLOR = "#e6d5c7">
  <TABLE BORDER = 0 CELLPADDING = 5 CELLSPACING = 0 WIDTH = "100%">
  <TR><TD BGCOLOR = "#e6d5c7">
   <FONT FACE = "Arial, Helvetica" SIZE = "-1">
   <MvLOCALIZED ID = "MER-UTL-00004">
    <MvLOCALIZED-TEXT LANGUAGE = "en-US">
    </MvLOCALIZED-TEXT>
   </MvLOCALIZED>
   <BR>
   <BR>
   <TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0>
   <TR><TD>
    &nbsp;&nbsp;
   </TD><TD ALIGN = "left" VALIGN = "middle" NOWRAP>
    <FONT FACE = "Arial, Helvetica" SIZE = "-1">
    <MvLOCALIZED ID = "MER-UTL-00005">
     <MvLOCALIZED-TEXT LANGUAGE = "en-US"></MvLOCALIZED-TEXT>
    </MvLOCALIZED>
    </FONT>
   </TD><TD ALIGN = "left" VALIGN = "middle">
    <FONT FACE = "Arial, Helvetica" SIZE = "-1">
    <MvEVAL EXPR = "{ g.Error_Code }">
    </FONT>
   </TD></TR>

   <TR><TD>
    &nbsp;&nbsp;
   </TD><TD ALIGN = "left" VALIGN = "top" NOWRAP>
    <FONT FACE = "Arial, Helvetica" SIZE = "-1">
    <MvLOCALIZED ID = "MER-UTL-00006">
     <MvLOCALIZED-TEXT LANGUAGE = "en-US"></MvLOCALIZED-TEXT>
    </MvLOCALIZED>
    </FONT>
   </TD><TD ALIGN = "left" VALIGN = "middle">
    <FONT FACE = "Arial, Helvetica" SIZE = "-1">
    <MvEVAL EXPR = "{ g.Error_Message }">
    </FONT>
   </TD></TR>
   </TABLE>
   </FONT>
  </TD></TR>
  </TABLE>
 </TD></TR>
 </TABLE>
-->

Step 6

Save the file then FTP it back to its appropriate location.   Check that it works by going to your store and checking a category or product that doesn't exist.

If you have multiple stores under the same domain (mall) you can have a custom page for each store.  You will need to put the following code instead of <MvDO FILE="../../../custom.htm"> that we put in step 3. Of course you will have to have 2 custom pages, in this example First_Store.htm and Second_Store.htm.

<MvIF EXPR = "{Stores.d.code EQ 'FirstStoreCode'}">
<MvDO FILE="../../../First_Store.htm">

 <MvELSE>

<MvIF EXPR = "{Stores.d.code EQ 'SecondStoreCode'}">
 <MvDO FILE="../../../Second_Store.htm">

</MvIF>
</MvIF>


Special thanks to William Weiland from Emporium Plus for this great tip.


Quick Tips

one.gif (80 bytes)

one.gif (80 bytes)

one.gif (80 bytes)
one.gif (80 bytes)


Fotolia
    

Miva Merchant, and the Miva blades logo are registered trademarks of
Miva Corporation.

Miva HeLp! is not affiliated with Miva Corporation.

 

 

Please e-mail site related issues to webmaster@MivaHelp.com and content corrections to content@MivaHelp.com

Copyright 2001- 2008 Technology Matrix Group Ltd.

Site Design by: A Design Elf Site