Scot's Miva Scripts News and Updates http://www.scotsscripts.com/blog/miva-merchant-miva-script-news.html Post about Miva Merchant, SEO, web development, HTML5, CSS3, javascript and jquery, and other web tidbits. Copyright 2024 www.scotsscripts.com Scots Blogger Miva Merchant Module by https://www.scotsscripts.com Wed, 16 Aug 2023 13:57:00 GMT <![CDATA[How to Use the JSON Decode Function in Mivascript]]> http://www.scotsscripts.com/blog/how-to-use-json-encode-and-decode-with-mivascript.html JSON is a great way to store and move text data. Decoding the JSON data into a usable array is also easy using Mivascript.]]> Wed, 16 Aug 2023 13:57:00 GMT http://www.scotsscripts.com/blog/how-to-use-json-encode-and-decode-with-mivascript.html Scot's Miva Scripts News and Updates The miva_json_decode(...) function in Mivascript is very easy to use. Better yet, it's wonderfully useful.

The miva json encode function is not built into Mivascript, however there is a json_encode(...) function in the Miva Merchant API that let's you use it in your modules or in template Store Morph Technology (SMT) code. We'll take a quick look at both of these and how they can be used in Miva Merchant templates.

miva_json_decode(...)

Here is a block of basic json set up in SMT code. Using MvCAPTURE is the easiest way to put the JSON into a variable because there is no need to deal with any special formatting.

<mvt:capture variable="l.settings:scientists">
{
"scientists": [
    {
        "name":"Albert Einstein",
        "ice_cream":"Vanilla",
        "idea":"Theory of Relativity"
    },
    {
        "name":"Ernest Rutherford",
        "ice_cream":"Pistacio",
        "idea":"Everything Edison Took Credit For"
    },
     {
        "name":"Stephen Hawkins",
        "ice_cream":"none",
        "idea":"Hawking radiation"
    }
]
}
</mvt:capture>

This JSON block is now stored in l.settings:ads_json - note that in a module you would use the MvCAPTURE tag.

The reason to use l.settings style variables in template coding (SMT) is that displaying the data is much easier. &mvt:variable; is faster and cleaner looking than using mvt:eval. Not everything is going to work with l.settings so use it where you can.

Make an array out of l.settings:ads_json by using the miva_json_decode(...) function and display the data in a loop:

<mvt:assign name="l.json_convert_ok" value="miva_json_decode(l.settings:scientists,l.settings:json_array)" />

<mvt:if expr="l.json_convert_ok NE 1"> <p>JSON is invalid.</p> <mvt:else> <mvt:foreach iterator="scientist" array="json_array:scientists"> <p> <b>Name:</b> &mvt:scientist:name; <br> <b>Favorite Ice Cream:</b> &mvt:scientist:ice_cream; <br> <b>Popular idea:</b> &mvt:scientist:idea; </p> </mvt:foreach> </mvt:if>

The miva_json_decode(...) function returns a 1 if the JSON is decoded successfully. It's generally good to check for things like this so the code above includes an mvt:if conditional to make sure the data is OK.

The output of the code above is:

Name: Albert Einstein
Favorite Ice Cream: Vanilla
Idea: Theory of Relativity

Name: Ernest Rutherford
Favorite Ice Cream: Pistacio
Idea: Everything Edison Took Credit For

Name: Stephen Hawkins
Favorite Ice Cream: none
Idea: Hawking radiation

]]>
<![CDATA[How To Add Modules to Miva Merchant 10]]> http://www.scotsscripts.com/blog/how-to-add-modules-to-miva-merchant-10.html Miva Merchant 10 is probably the most powerful and customizable ecommerce platform out there. Here's a streamlined discussion on adding and using new modules to your store.]]> Fri, 9 Jun 2023 13:09:00 GMT http://www.scotsscripts.com/blog/how-to-add-modules-to-miva-merchant-10.html Scot's Miva Scripts News and Updates Adding modules to Miva Merchant 10 can be tricky the first time you try it. 

The term "add module" and "install module" are treated differently in Miva 10. Adding a module means putting it into your Miva Merchant platform so it's available to "install" into one or more stores. 

Make sure you are logged into your Miva Merchant admin before going any further.

Step 1: Adding a Module

To make the module available to install we have to add it first.

A. Click on the Settings gear at the bottom of the left menu, and then click on Domains in the menu that opens up.

B. Once the Domain Settings opens, find the Modules tab and click it (mine is first, yours will probably be second), then click the blue Add Module button.

C. When the add module screen comes up click on the Upload button and upload your module.

Unzip the module first. Modules have the file extension of .mvc and if your module comes as a .zip file unzip it and get the .mvc file.

After the module has uploaded a blue Add Module button will appear. Click it to finish the process.

Updating Module Note: If you are updating a module you must check the box to overwrite the module in the upload dialogue.

Congrats! Your module is now available to install in your store.

Step 2: Installing The Module In Your Store

Now that the module has been added to your store you can install and start using it. The easiest way to install the module is to click the Settings gear at the bottom of the left menu and then click Modules at the bottom of the menu that opens.

When you click on Modules you'll get a screen of modules in your store. Some will be already installed and show green "Installed" text, others will be waiting for you to install them with blue "Install" text.

Uninstall: The three dots will open up a sub menu with a single menu item, "Uninstall". Don't ask me why it's not right there on the screen. 

Three Dots in Miva Merchant: The three dots in the Miva Merchant admin bring up all sorts of random menus and force administrators into extra clicks. If you are ever looking for something be sure to check boxes then use the three dots menus, or just try clicking any that you see so you can get to know all the hidden functions in Miva Merchant. The three dot menus are very inconsistent but that's how it goes sometimes.

Step 3: Module Administration and Misc Information

Scot's Scripts modules generally bring you to the module admin after they are installed. Some modules leave you hanging so you'll need to read the module documentation to figure out where the admin for the module is.

Various module types will have tabs for products, pages, categories, customers, and more. If you open a module in the Domains > Modules section of the store you will see all the features that the module supports. 

For example, Scot's Blogger uses component, data_store, json, scheduledtask, and a few other features. Each of these features lets the module do things in various parts of the stores.

Uninstalling and/or Removing a Module

First, and very important, do not ever remove a module by deleting the file from the server using FTP or control panel file browser. This will cause all sorts of problems in your Miva store.

Before you can remove a module you will need to uninstall it. Go to the Settings > Modules section, find the module you want to remove, and click the three dots for the remove menu item.

Possible problems will include page items that are in use in the store. Some modules can't be easily uninstalled if they are used in pages. Take Scot's Blogger for example. Scot's Blogger creates a page item named scotsblogger when the module is installed. It removes that page item when it's uninstalled, however, if the page item is in use (as it is in the blog page) then the store won't allow the module to be uninstalled.

For Scot's Blogger this is no problem- just delete the blog template and all is well. For some other modules it may be more difficult because their page items are spread all around the store in different templates. Using the Search and Replace utility module will make finding them all an easier task.

Once  you've successfully uninstalled the module from your store, or stores, then you can go to the Settings > Domains > Modules section of the admin, find your module, open the module screen, click the three dots, and then delete your module.

Deactivating a Module

The module screen will also have a checkbox for deactivating the module. Sometimes this is easier than removing a module.

Important Module Removal Related Things to Consider

Before removing a module from your store it's important to consider what the module does. If it's a shipping or payment module that has been in use you should never remove it unless advised by the developer because the module might be called on for orders that originally used it.

Remove unused modules: If you're not using it, remove it. This will save resources and keep your store fast.

How many modules can I install?

You can install as many as you want, but know that every module that is installed will make your store go slower. You might not notice it, but let's say you install a System module. System modules have functions that are called on every screen load. Even if the function doesn't do anything the system still has to open the module file and call the function.

System modules are some of the heaviest modules. So are logging modules. Component modules also call certain functions whether they are used or not. 

Component Modules: Make sure when you are adding and removing items from a page template (the ITEMS tab) that any items that are checked are actually in use. For example, the Buttons item is rarely in use in modern Miva stores, yet the page item appears to be checked in all templates, at least in Shadows 2.

Module Data: Some modules keep their data in tables, some in flat files, some in both. It's not a good idea to assume anything about module data, especially when making a dev store live. I've seen stores go live and break half their modules because the devs thought they could just copy the MySQL table over without copying directories of flat files in the Miva data directory.

Let us know if you have any questions about installing a module or general module information.

If you need a custom module that's what we like to do most! No module is too small or too large.

]]>
<![CDATA[Easy Add "Shop All Categories" to Primary Navigation in Miva Merchant]]> http://www.scotsscripts.com/blog/how-to-create-an-all-categories-primary-navigation-dropdown-with-branches.html This tutorial is for stock http://www.scotsscripts.com/blog/how-to-create-an-all-categories-primary-navigation-dropdown-with-branches.html Scot's Miva Scripts News and Updates This tutorial is for stock Shadows CSS framework developed by Miva for Miva Merchant. This will work for customized frameworks although some item names in the store admin might be different.

Miva Merchant Category Tree

The category tree in Miva Merchant is a tree style breakdown of your categories that follows the parent-child relationship set up in the category management section of your Miva Merchant administration. You see this in the sidebar of some pages of your store, but it's not present in the primary navigation bar.

The standard method of adding "all categories" to your navigation bar is tedious, and if you have a lot of categories and complicated category tree incredibly time consuming. Instead of building the "All Categories" menu item by hand, do it the easy way: automatically. The following method also automatically mirrors any changes you make to your category tree.

Take a look: Esentia Security Products asked me to put something like this in their primary nav bar. The "Shop All Categories" item is automatically created based on the category tree settings, not navigation item settings. The rest of the primary nav bar is basic navigation items, easily modified like any other navigation set in Miva Merchant.

Step 1

Optional Custom Field - Skip a Category

There may be times you want a particular category skipped in the "Shop All Categories" navigation item. The code below supports a custom category field checkbox that can be used for this. Create a custom field by going to UTILITIES > CUSTOM FIELDS

  • CODE: all_categories_filter
  • NAME: All Categories: Filter the all categories primary nav dropdown
  • GROUP: default
  • FIELDTYPE: Checkbox
  • TYPE: Category

Step 2

Open the primary navigation bar template for editing by clicking on User Interface > Theme Components > Navigation Sets >Primary Site Navigation Bar

Step 3

Update the Primary Navigation Template. The code we are adding basically mimics the code already in the template, except instead of getting the category tree from a navigation set, we load it from the store's category structure.

Find the following two lines of code. In a stock primary nav bar template they will be around line 11.

<div class="x-transfigure-navigation__content">
<ul class="c-navigation__row x-transfigure-navigation__row">

Insert the following code after the <ul class="c-navigation__row x-transfigure-navigation__row"> line. This will load and display all categories based on how categories have been set up in the stock category tree that shows up on some pages.

<mvt:comment>
#
# ALL CATEGORIES - auto create based on category heirarchy in store. Use the "filter primary nav" category custom field to keep a category out of this list
#
</mvt:comment>
<mvt:do file="g.Module_Library_DB" name="l.success" value="CategoryList_Load_Parent(l.nulll, l.settings:pcats)" /> <mvt:assign name="l.settings:has:children" value="'has-child-menu' $ asciichar(34) $ ' data-hook=' $ asciichar(34) $ 'has-drop-down has-child-menu'"/> <mvt:assign name="l.settings:show:child" value="'<span class=' $ asciichar(34) $ 'c-navigation__link-carat' $ asciichar(34) $ '><span class=' $ asciichar(34) $ 'u-icon-chevron-right' $ asciichar(34) $ ' aria-hidden=' $ asciichar(34) $ 'true' $ asciichar(34) $ ' style=' $ asciichar(34) $ 'font-weight: bold; position: relative; top: -1px;' $ asciichar(34) $ '></span></span>'"/>
<li class="c-navigation__list &mvt:has:children;"> <a class="c-navigation__link" href="/our-catalog.html"><b>Shop By Category&mvt:show:child;</b></a>
<ul class="c-navigation__row is-hidden" style="z-index: 10000;"> <li class="c-navigation__list u-hidden--l" data-hook="show-previous-menu"> <span class="c-navigation__link"><span class="u-icon-chevron-left" aria-hidden="true"> </span><span class="o-layout--grow">Main Menu</span></span> </li>
<mvt:foreach iterator="cat" array="pcats"> <mvt:comment> ### skip category if set in the custom field ### </mvt:comment> <mvt:do file="g.Module_Root $ '/modules/util/customfld.mvc'" name="l.success" value="Read_Category_Code(l.settings:module, l.nulll, l.settings:cat:code, 'all_categories_filter', l.settings:all_categories_filter)" /> <mvt:if expr="l.settings:all_categories_filter EQ 1 OR l.settings:cat:active NE 1"> <mvt:foreachcontinue /> </mvt:if> <mvt:do file="g.Module_Feature_URI_DB" name="l.success" value="URI_Load_Category_Canonical(l.settings:cat:id, l.settings:cat:uridata)" /> <mvt:assign name="l.settings:children" value="''" /> <mvt:do file="g.Module_Root $ '/modules/component/cmp-cssui-cattree.mvc'" name="l.success" value="CategoryList_Load_Tree(l.settings:cat:id, l.settings:children, 2, l.settings:urisettings)" /> <mvt:if expr="NOT ISNULL l.settings:children"> <mvt:assign name="l.settings:has:children" value="'has-child-menu' $ asciichar(34) $ ' data-hook=' $ asciichar(34) $ 'has-drop-down has-child-menu'"/> <mvt:assign name="l.settings:show:child" value="'<span class=' $ asciichar(34) $ 'c-navigation__link-carat' $ asciichar(34) $ '><span class=' $ asciichar(34) $ 'u-icon-chevron-right' $ asciichar(34) $ ' aria-hidden=' $ asciichar(34) $ 'true' $ asciichar(34) $ ' style=' $ asciichar(34) $ 'font-weight: bold; position: relative; top: -1px;' $ asciichar(34) $ '></span></span>'"/> <mvt:else> <mvt:assign name="l.settings:has:children" value="''"/> <mvt:assign name="l.settings:show:child" value="''"/> </mvt:if> <li class="c-navigation__list &mvt:has:children;"> <a class="c-navigation__link" href="&mvte:cat:uridata:uri;" target="&mvt:cat:link_targ;">&mvt:cat:name;&mvt:show:child;</a> <mvt:if expr="NOT ISNULL l.settings:children"> <ul class="c-navigation__row is-hidden"> <mvt:assign name="l.settings:has:children" value="''"/> <li class="c-navigation__list u-hidden--l" data-hook="show-previous-menu"> <span class="c-navigation__link"><span class="u-icon-chevron-left" aria-hidden="true"> </span><span class="o-layout--grow">Main Menu</span></span> </li>
<mvt:foreach iterator="child" array="children"> <mvt:assign name="l.settings:grandchildren" value="''" /> <mvt:do file="g.Module_Root $ '/modules/component/cmp-cssui-cattree.mvc'" name="l.success" value="CategoryList_Load_Tree(l.settings:child:id, l.settings:grandchildren, 2, l.settings:urisettings)" /> <mvt:if expr="NOT ISNULL l.settings:grandchildren"> <mvt:assign name="l.settings:has:children" value="'has-child-menu' $ asciichar(34) $ ' data-hook=' $ asciichar(34) $ 'has-child-menu'"/> <mvt:assign name="l.settings:show:child" value="'<span class=' $ asciichar(34) $ 'c-navigation__link-carat' $ asciichar(34) $ '><span class=' $ asciichar(34) $ 'u-icon-chevron-right' $ asciichar(34) $ '></span></span>'"/> <mvt:else> <mvt:assign name="l.settings:has:children" value="''"/> <mvt:assign name="l.settings:show:child" value="''"/> </mvt:if> <li class="c-navigation__list &mvt:has:children;"> <mvt:do file="g.Module_Feature_URI_DB" name="l.success" value="URI_Load_Category_Canonical(l.settings:child:id, l.settings:child:uridata)" /> <a class="c-navigation__link" href="&mvte:child:uridata:uri;">&mvt:child:name;&mvt:show:child;</a> <mvt:if expr="NOT ISNULL l.settings:grandchildren"> <ul class="c-navigation__row is-hidden"> <li class="c-navigation__list u-hidden--l" data-hook="show-previous-menu"> <span class="c-navigation__link"><span class="u-icon-chevron-left" aria-hidden="true"> </span><span class="o-layout--grow">Main Menu</span></span> </li> <mvt:foreach iterator="grandchild" array="grandchildren"> <mvt:do file="g.Module_Feature_URI_DB" name="l.success" value="URI_Load_Category_Canonical(l.settings:grandchild:id, l.settings:grandchild:uridata)" /> <li class="c-navigation__list"> <a class="c-navigation__link" href="&mvte:grandchild:uridata:uri;">&mvt:grandchild:name;</a> </li> </mvt:foreach> <li class="c-navigation__list u-hidden--l"> <a class="c-navigation__link" href="&mvte:navigationitem_level2:url;" target="&mvt:navigationitem_level2:link_targ;">View All &mvt:navigationitem_level2:name;</a> </li> </ul> </mvt:if> </li> </mvt:foreach>
<li class="c-navigation__list u-hidden--l"> <a class="c-navigation__link" href="&mvte:navigationitem:url;" target="&mvt:navigationitem:link_targ;">View All &mvt:navigationitem:name;</a> </li> </ul> </mvt:if> </li> </mvt:foreach>
<li class="c-navigation__list u-hidden--l"> <a class="c-navigation__link" href="&mvte:navigationitem:link;">View All &mvt:navigationitem:name;</a> </li> </ul> </li>
<mvt:comment> # # END ALL CATEGORIES # </mvt:comment>

That's all there is to it.

]]>
<![CDATA[Google Analytics 4 for Miva Merchant is Easy]]> http://www.scotsscripts.com/blog/google-analytics-4-for-miva-merchant-is-easy.html On July 1, 2023, standard Universal Analytics properties will no longer process data. Now is the time to install the Google Analytics 4 module in your Miva Merchant store.]]> Tue, 2 May 2023 18:53:19 GMT http://www.scotsscripts.com/blog/google-analytics-4-for-miva-merchant-is-easy.html Scot's Miva Scripts News and Updates Now is the time to install the Google Analytics 4 module in your store. It's easy to install, tracks everything, and doing it now saves you any stress when Universal Analytics is soon retired.

Our Google Analytics 4 module has been maturing for three years and is now easier than ever to install and use. Built in documentation and help will get you started on the right foot without any hassle or worries. When you buy the module you pay for it once. No recurring fees of any kind, ever.

Scot has done it again. This app works seamlessly. Install it. Make a few tweaks and if you have problems, Scot is quick to address them and offer recommendations. Great job! I recommend and use this for all of my projects.

James, After Dark Grafx

How is our module different than simply putting the Google Analytics 4 code in your store?

There is one major difference: Almost all browsers either natively block Google Analytics javascript or use a plugin like U-Block Origin to block that kind of javascript.

The module uses Google's REST API to send tracking data. This means that browsers can't block it because the data is behind the scenes, invisible to the browser and visitors browsing. Page load isn't affected and tracking is perfect.

In addition to tracking analytics, you can enter five measurement IDs in the module settings to track any of Google's services such as adsense or custom gtags measurements.

Custom Field Data

Some store owners use custom fields to create all sorts of tracking metrics and our Google Analytics 4 module makes including this data in your tracking a breeze. Check the boxes and you're good to go.

Installation

Installing the Google Analytics 4 module is very easy. After adding it to the store the module asks for the license code which you'll get in your purchase confirmation email. After adding the code the settings comes up. If you're just getting started the instructions will show you how to get your Google Analytics 4 measurement ID and/or create a new analytics property.

Here's a sample of the instructions page:

As usual, we have also added some extras that make things even more easy, such as built in page assignments to easily turn on/off Google Analytics 4 for any pages in your store.

Module Settings

The module settings have everything you need to get the module going the way you want.

Debugging is good. You'll also notice that you can easily debug your tracking before going live. This is a very nice feature that keeps frustration at a minimum when trying to figure out what's going on if tracking isn't doing exactly what you thought it would do.

Please contact us if you have any questions about using our Google Analytics 4 Module for your Miva Merchant store.

]]>
<![CDATA[How to Accept Donations in Miva Merchant]]> http://www.scotsscripts.com/blog/how-to-accept-donations-in-miva-merchant.html Accepting donations, tips, and other open ended dollar amounts such as invoicing in Miva Merchant has always been somewhat difficult. Those days are over.]]> Fri, 21 Jan 2022 10:00:45 GMT http://www.scotsscripts.com/blog/how-to-accept-donations-in-miva-merchant.html Scot's Miva Scripts News and Updates There are a few ways to accept donations, tips, and other custom price situations such as invoices in Miva Merchant.

Sometimes people create a donate button with PayPal or some other service. This works, but the problem is that it makes your store look bad. Your customers are wondering, "Why is there something completely different here for donating?" Your customers need to trust your store and want to go through the normal checkout process, so putting various out of context buttons in for donations could turn them off. 

Another option is an old Miva module being used for invoices. In as much as this older module works, it's also, well, very old, and hasn't been updated in years. There is no guarantee that the module will continue to work as Miva Merchant is updated.

The Easy Way

The easiest way of accepting tips, donations, and more in Miva Merchant is to use our brand new module, Custom Attribute Prices.

Ok, sure, this is a blatant marketing pitch for the module, but that doesn't mean it isn't the best solution for invoicing, tips, and donations out there for Miva Merchant.

Is Custom Attribute Prices easy to use?

Yes, it's super easy to use. Setup literally takes minutes. In fact, it will probably take longer to install the module than to set up your first donation product.

All you have to do is create a product and give it a text attribute with a few defined settings. See the product page for details.

How does reporting work for Custom Attribute Price?

Since you are using a normal store product for your donation, tip, or invoice, reporting is the same as everything else in your store. The attribute shows up in the invoice and order details so you know what the person paid for and what they paid.

Some Ways to Use Custom Attribute Price

Donations are an obvious choice, a tip jar if you're in the service industry, and for stores that need online invoice payment, this is the perfect solution.

But what else can you do?

Another way I thought might be interesting is making a product and giving it the attribute that holds the price field, but also give it a text attribute. This way the customer can enter the price they want to pay as well as entering some kind of note about why they are paying. I had a client that wanted this functionality a few years ago and we had to go through a lot of work to make it happen. With this module it could have been done in minutes.

Contact us if you have any questions about this module.

Another option could be our Get Money module which lets you send an encrypted link to your customers to populate the price and name of the service they are paying for.

]]>
<![CDATA[How to Open Task Manager in Windows 11]]> http://www.scotsscripts.com/blog/how-to-open-task-manager-in-windows-11.html If you're not using the task manager you're missing out. It's a way to see what's going on under the hood, close processes that are using too many resources, change priority in applications and games to make them more responsive, and more.

In Windows 10 I used to right click in the taskbar to get the task manager.

In Windows 11 that doesn't work. However there is still a shortcut to get the task manager up so you don't have to search through apps to bring it up: 

http://www.scotsscripts.com/blog/how-to-open-task-manager-in-windows-11.html Scot's Miva Scripts News and Updates If you're not using the task manager you're missing out. It's a way to see what's going on under the hood, close processes that are using too many resources, change priority in applications and games to make them more responsive, and more.

In Windows 10 I used to right click in the taskbar to get the task manager.

In Windows 11 that doesn't work. However there is still a shortcut to get the task manager up so you don't have to search through apps to bring it up: 

Right Click the Blue Windows Icon

Right click the blue "four squares" icon and select the Task Manager.

]]>
<![CDATA[Miva Merchant SMT / Storemorph Basics]]> http://www.scotsscripts.com/blog/miva-merchant-smt-storemorph-basics.html Miva Merchant template coding language, otherwise known as SMT or Storemorph Technology, gives you the power to do anything in your pages. Sat, 14 Aug 2021 15:26:00 GMT http://www.scotsscripts.com/blog/miva-merchant-smt-storemorph-basics.html Scot's Miva Scripts News and Updates When you want to add new code to your Miva Merchant page templates sometimes there's a learning curve, or more of a learning bump because when you get over it the rest is smooth sailing.

Resources:

1. Miva Merchant API Functions and How to Use Them

This post on Scot's Scripts explains in detail how to use Miva Merchant API Functions.

2. Miva Merchant Template API Functions

These are all functions you can use in your page templates (and your modules if you are developer.)

3. Official Miva documentation

Store Morph Template (SMT) coding reference. Reference this as go through this post.

mvt:assign 

This is used to assign a variable a value. Let's assign the value "Scot" to the variable l.settings:my_name using the code below.

<mvt:assign name="l.settings:my_name" value="'Scot'" />

l.settings: 

To use page items like &mvt:my_name; to display data you must assign the data to a variable name that starts with l.settings otherwise you will need to use  themvt:eval function (see below) to display the data.

Module Development Note: If you are writing a module and want to assign values to l.settings from the Component module API functions, you need to assign them to l.all_settings because l.all_settings gets copied to l.settings via internal Miva Merchant processes.

The example above is the most basic use of mvt:assign. What if we want to display the date where we are going to connect some internal system variable data with strings?

The system variable for the day of the week is s.stm_wday and for the month is s.stm_mon

Let's assign a variable called l.settings:hello_customer using mvt:assign and the date variables above.

<mvt:assign name="l.settings:hello_customer" value="'Hello Customer, today is ' $ s.stm_wday $ ', day ' $ s.tm_mday $ ' of ' $ s.stm_mon" />
Then we can display it anywhere below on the page like:
&mvt:hello_customer;

This would output something like: 

Hello Customer, today is Sun, day 13 of Oct

You probably noticed the $ symbols in the "value" section of the code above. In template coding and miva script coding we must distinguish between variables and strings. Strings are anything that is not a variable or a function, strings are words and symbols, such as "Hello Customer, today is" in the example above.

The basic rule is strings are surround by single quotes, and all variables and strings are separated by $ symbols.

mvt:eval 

This is used to evaluate, or output, data.

It's used in a very similar manner to mvt:assign , however instead of assigning data to a variable, you are displaying it directly on the page.

Using the variable in the example above, l.settings:hello_customer, we can display the contents of the variable like so:

<mvt:eval expr="l.settings:hello_customer" />

The output from this is identical to &mvt:hello_customer;.

We can also use mvt:eval for more complex output. Using the example above, we can mvt:eval the "hello customer" string instead of assigning it to a variable.

<mvt:eval expr="'Hello Customer, today is ' $ s.stm_wday $ ' day ' $ s.tm_mday $ ' of ' $ s.stm_mon" />

Evaluate Customer Name

If your customer is logged in and has their billing information set (for this example) you can say hello to them personally like this:

<mvt:eval expr="'Hello ' $ g.customer:bill_fname $ ' ' $ g.customer:bill_lname $ ', today is ' $ s.stm_wday $ ' day ' $ s.tm_mday $ ' of ' $ s.stm_mon" />

Remember: All literal strings, including spaces, must be enclosed with single quotes, and, we must use $ to connect (concatenate) them together.

Tip: You can also mvt:eval any of the mivascript functions. For example if you wanted to add zeros in front of a number so that there are always three digits in total (1 would turn into 001), you could use the padl(string, length, character) function like this:

<mvt:assign name="l.number" value="'1'" />
<mvt:eval expr="'This is your number: ' $ padl(l.number,3,'0')" />

This would output: 

This is your number: 001

mvt:do 

This is used to call functions that have been created in modules and mivascript files that run your store. The api function reference page lists all the functions available in stock Miva Merchant. This does not include functions in third party modules, although some third party modules might have their own api function reference (while others hide their functions.)

The mvt:do functions in the API function reference are ready to copy and paste into your templates, it's just the variable names that need changing to reflect the data you are using and loading. Here is one example to help understand how they are used. Let's look at the function that loads a product URI. The code below is copied straight from the function reference guide.

<mvt:do file="g.Module_Feature_URI_DB" name="l.success" value="URI_Load_Product_Canonical(product_id, canonical_uri var)" />

This function could be used to display a list of products manually with links. In this example, we will load product data from the product code, then load the URI into the product data.

Note: Notice the "var" after "canonical_uri" in the URI_Load_Product_Canonical function? This "var" denotes that it is a reference variable. This simply means that after the function is run, the canonical information will be stored in the reference variable rather than returned.

Some functions return their data into the "name" field (in this case the name field is "success" which will be a 1 or 0 based on if the canonical uri was found) and some load data into reference variables.

See the Miva Merchant API Functions and How to Use Them post for more details about reference variables.

Load Product Canonical URI Example

<mvt:assign name="l.product_code" value="'product_code_1'" />
<mvt:do file="g.Module_Library_DB" name="l.success" value="Product_Load_Code(l.product_code, l.settings:product)" />
<mvt:do file="g.Module_Feature_URI_DB" name="l.success" value="URI_Load_Product_Canonical(l.settings:product:id, l.settings:product:canonical_uri)" />
<mvt:if expr="l.success"> The product URI is: <mvt:eval expr="l.settings:product:canonical_uri:uri" /> <mvt:else> Error: Problem loading URI for &mvt:product:name;. </mvt:if>

In this example we arbitrarily set a product code, load the product data into l.settings:product, try to load the URI based on the product id, and if it loads we display it and if not we display an error message.

See below in the mvt:foreach section for an example of loading a list of products.

mvt:if 

This uses operators to test for conditions that we use to figure out what the next step is. Check the operators reference for a rundown of all available operators.

Operators: Operators make mvt:if work. Understanding how to use operators is required for miva scripting and template language and programming in general.

In this example we'll assign a variable an animal type and then check what kind of food it needs.

"IF" it's a cat, feed it cat food,

"ELSE" do not feed it cat food.

<mvt:assign name="l.animal_type" value="'cat'" />
<mvt:if expr="l.animal_type EQ 'cat'"> Let's feed it cat food. <mvt:else> Do not feed it cat food. </mvt:if>

In this example we'll assign the variable again and use mvt:elseif to extend the condition tests.

"IF" it's a cat, feed it cat food,

"ELSE IF" it's a dog, feed it dog food,

"ELSE" do not feed it.

<mvt:assign name="l.animal_type" value="'cat'" />
<mvt:if expr="l.animal_type EQ 'cat'"> Let's feed it cat food. <mvt:elseif expr="l.animal_type EQ 'dog'"> Let's feed it dog food. <mvt:else> Do not feed it cat food or dog food. </mvt:if>

These are basic examples, but conditionals are the life blood of coding in templates and anything else.

Did you see the EQ being used above? That's an operator. See the operator reference for a list of them all.

This is an example of using the AND operator with a more complex conditional situation where we use AND and NE

"IF" it's a calico cat feed it calico cat food,

"ELSE IF" it's a non-calico cat feed it non-calico cat food,

"ELSE IF" it's a dog, feed it dog food,

"ELSE" do not feed it.

<mvt:assign name="l.animal_type" value="'cat'" />
<mvt:assign name="l.cat_color" value="'calico'" />
<mvt:if expr="l.animal_type EQ 'cat' AND l.cat_color EQ 'calico'"> Let's feed it cat food for calico cats. <mvt:elseif expr="l.animal_type EQ 'cat' AND l.cat_color NE 'calico' "> Let's feed it cat food for not calico cats. <mvt:elseif expr="l.animal_type EQ 'dog'"> Let's feed it dog food. <mvt:else> Do not feed it cat food or dog food. </mvt:if>

mvt:foreach 

This is a way to process a list by looping through it. In coding a list is usually called an array. An array is nothing more than a bucket to hold a bunch of things that are the same, like products.

Let's use the mvt:do example from above where we loaded a canonical URI for a product based on the product code but do it for a list of product codes rather than just one.

In this case we'll assign a list of product codes to a variable, turn that into an array using miva_array_deserialize(...) and then loop through to show a product list with links.

<mvt:assign name="l.product_codes" value="'product_code_1,product_code_2,product_code_3,product_code_4'" />
<mvt:assign name="l.settings:_products" value="miva_array_deserialize(l.product_codes)" />
<mvt:foreach iterator="product" array="_products"> <mvt:do file="g.Module_Library_DB" name="l.success" value="Product_Load_Code(l.product_code, l.settings:product)" />
<mvt:do file="g.Module_Feature_URI_DB" name="l.success" value="URI_Load_Product_Canonical(l.settings:product:id, l.settings:product:canonical_uri)" />
<mvt:if expr="l.success"> <a href="&mvte:product:canonical_uri:uri;">&mvt:product:name;</a> <mvt:else> Error: Problem loading URI for &mvt:product:name;. </mvt:if> </mvt:foreach>

miva_array_deserialize(...) : this is a built in mivascript function that turns a simple list of items that are separated by commas and into an array. Note that if there are commas in the item codes/names then you'd have to do it another way, probably one at a time with the function miva_array_insert(...)

Notice that instead of using mvt:eval for the product name and uri, we used page entities (&mvt:product:name;)

Pro Tip: You may have also noticed that I named the products array l.settings:_products

I like to use an _ (underscore) to prefix variable names for my own stuff because that way I am fairly confident that I'm not going to get my variables mixed up with anything else on the page.

Keeping your template code organized by properly formatting and indenting code, putting blank lines between sections, using comments, and giving variable names that make obvious sense on the page makes it easier to update the code later and makes it much easier for developers you hire to go in and do stuff fast, which also means you don't pay them as much.

Conclusion

These are the most often used SMT tags in your Miva Merchant page templates and should help you get a grip on what's going on in that template code. Send us a message if you would like to see a tutorial on anything else.

]]>
<![CDATA[Fix Move All to Wish List "Invalid Wish List" Error in Miva Merchant]]> http://www.scotsscripts.com/blog/fix-move-all-to-wish-list-error-in-miva-merchant.html There is a bug in current Miva Merchant templates that gives you an "Invalid Wish List" error when a customer without an account tries to move all items in the basket to a wish list. Wed, 9 Jun 2021 10:16:00 GMT http://www.scotsscripts.com/blog/fix-move-all-to-wish-list-error-in-miva-merchant.html Scot's Miva Scripts News and Updates Scenario: A new customer without an account tries to move all items from their basket into a wish list while on the basket page.

Result: An error "Invalid Wish List" is displayed after they create an account.

This happens because a wish list is not being created when they create their account so there isn't anywhere for the basket items to go and the form for them to create their account is missing actions that are necessary for this to happen.

Fixing it is pretty easy.

Step 1.

Log into your Miva Merchant admin.

Step 2.

Open up the Customer Create (ACAD) page in the User Interface.

Step 3.

Find the form for creating an account. In modern stores the form tag will look something like the code below. The conditionals above the form tag set the URL based on what is going on. In this situation, the url is set to the wish list page because of g.wishlist.

<mvt:if expr="g.Order">
    <mvt:assign name="l.settings:url" value="l.settings:urls:OINF:secure" />
<mvt:elseif expr="g.Redeem">
    <mvt:assign name="l.settings:url" value="l.settings:urls:RGFT:secure" />
<mvt:elseif expr="g.WishList">
    <mvt:assign name="l.settings:url" value="l.settings:urls:WISH:secure" />
<mvt:else>
    <mvt:assign name="l.settings:url" value="l.settings:urls:ACED:secure" />
</mvt:if>

<form id="acad_form" method="post" action="&mvte:url;" autocomplete="off"> <input type="hidden" name="Action" value="ICST" />

If your template code looks different you might have an older or newer or custom setup for wish lists and will need to do something else to get it working.

Step 4.

Replace the last line in the code above, the hidden input, with:

<mvt:if expr="g.wishlist">
    <input type="hidden" name="Action" value="ICST,IWSH,MAWL">
    <input type="hidden" name="WishList_Title" id="WishList_Title" value="My Wish List">
<mvt:else>
    <input type="hidden" name="Action" value="ICST" />
</mvt:if>

What this does is set a name for a new wish list and adds the required action codes to go through the process of moving all items from the basket to the wish list when the customer is in the create a new account flow.

]]>
<![CDATA[Favorite Web Development Tools and Resources]]> http://www.scotsscripts.com/blog/favorite-web-developement-resources.html All developers have their go-to tools to make web development life easier. Here's a list of mine.

This list will grow as time goes on. If you have a resource that could be added here, let us know.

Web Utilities

Htaccess Tester: Test htaccess directives before bricking your site.

http://www.scotsscripts.com/blog/favorite-web-developement-resources.html Scot's Miva Scripts News and Updates All developers have their go-to tools to make web development life easier. Here's a list of mine.

This list will grow as time goes on. If you have a resource that could be added here, let us know.

Web Utilities

Htaccess Tester: Test htaccess directives before bricking your site.

http://htaccess.madewithlove.be/

Redirect Checker: Gives you low level information on the kinds of redirects a site page is going through.

https://www.redirect-checker.org/index.php

W3 Markup Validator: Great tool to make sure your pages all have legal HTML.

https://validator.w3.org/

HTML Formatter: Takes messy HTML and fixes it.

https://www.freeformatter.com/html-formatter.html

HTML Tidy: Similar to HTML Formatter. Sometimes you need another tool to do the same job.

https://htmltidy.net/

Online JSON Parser: Is that an error I see in your json? Json errors can kill javascript and other web apps.

http://json.parser.online.fr/

Javascript Beautifier: This also gives you hints about javascript coding errors.

https://beautifier.io/

XML Validator

https://codebeautify.org/xmlvalidator

ISO Lists: All the lists you need. Countries, states, timezones, whatever.

https://www.iso.org/obp/ui/#search

Calculators: Sometimes you just need one. Many different kinds of calculators here.

https://planetcalc.com/

Find Unclosed DIV and other tags:

https://www.aliciaramirez.com/closing-tags-checker/

REG-EX Tester: Useful for htaccess and other situations that need complex regular expressions.

https://www.regexpal.com/

Graphics, Galleries, Design

BX Slider: https://bxslider.com/ The easiest, fastest dev time, lowest overhead pro carousel/slider plugin there is. It just doesn't get easier than this. Supported by The Gallery module.

Unite Gallery: http://unitegallery.net/ Beautiful, full featured, many different galleries, and easy to use. Supported by The Gallery module. 

Favicon Generator: I've never had a client who wasn't thrilled with their new favicon (browser tab graphic)

https://realfavicongenerator.net/

https://www.favicon.cc/

Gradient Editor by Color Zilla - create css gradients (like the top header background here.)

https://www.colorzilla.com/gradient-editor/

Color Scheme Generator: Sometimes inspiration needs a kick.

https://paletton.com/

Convert PNG to Base64: Useful for embedding icons in a module.

https://onlinepngtools.com/convert-png-to-base64

Placeholder.com: Easy to use URLs for placeholder graphics.

https://placeholder.com/ - image below: via.placeholder.com/250x65

Windows/OS Utiltiies

Greenshot: My go-to screenshot generator. I like this because it's super easy to use and has an editor that I can use for arrows, text, circles, etc... 

https://getgreenshot.org/

SEO

Google Rich Results Test: Make sure your pages have the data they need.

https://search.google.com/test/rich-results

SEO One Click: The absolute best browser extension for quickly checking a web page meta and microdata.

http://www.seo-extension.com/

Schema.org is the definitive guide to microdata and includes json/ld examples for almost all situations.

https://www.schema.org

Resources

W3 Schools is where we learn how to code. HTML, CSS, JS, and everything else. 

https://www.w3schools.com/

Stack Overflow: Any coding related question answered. Most questions have already been answered.

https://stackoverflow.com/questions

PHP Sandbox: Just in case you need to get some PHP working

https://sandbox.onlinephpfunctions.com/

Dummy Text (lorem ipsum) generator. Great for filler text when creating a mockup.

https://www.blindtextgenerator.com/lorem-ipsum

Security

Project Honeypot: Find out if an IP is a spammer or worse.

https://www.projecthoneypot.org/

Miva Merchant

Check out Miva Merchant if you are looking for a flexible, powerful, top shelf ecommerce platform.

The best resource for Mivascript functions and related information:

http://www.mivascript.com/

Shadows Style Guide and other documentation:

https://docs.miva.com/readytheme-shadows/#overview-style-guide

Miva Merchant API Functions: Use these in store pages and modules. Page Template code functions. Not all functions are here, sometimes you need to look in the LSK.

https://docs.miva.com/api-functions

Module API reference guide: Want to make miva modules or need info a particular feature? Here's the file. Note that it hasn't been updated for Miva 10 as of Jan 2021.

https://www.miva.com/pdf/MM_Module_API_Ref_Guide_v45.pdf

Miva Merchat Limited Source Kit (LSK) contains source code to about 80% of Miva Merchant. Invaluable if you are learning module and miva script coding in general.

https://apps.miva.com/miva-merchant-limited-source-kit.html

]]>
<![CDATA[Content Studio Module for Miva Merchant]]> http://www.scotsscripts.com/blog/content-studio-module-for-miva-merchant.html Content Studio is a sophisticated rich content module for Miva Merchant with a next generation WYSIWYG editor, logical organization, and easy to use features.]]> Sun, 27 Dec 2020 17:38:00 GMT http://www.scotsscripts.com/blog/content-studio-module-for-miva-merchant.html Scot's Miva Scripts News and Updates We're pleased to announce the release of the Content Studio, a cutting edge WYSIWYG editor and content manager for Miva Merchant.

Take a look at the video tour:

Content Studio gives Miva Merchant store administrators a tool to easily create rich content for their stores. Creating vibrant product content has never been easier.

Differences between Content Studio and Scot's Blogger

The main differences between the two modules is that the blogger is specifically made for blogging and content management with full URL control and organization features in line with most blogging platforms whereas the Content Studio is designed for admins to create rich content blocks to use within Miva Merchant.

The editors are similar although the Content Studio editor is a bit more advanced and has more readily available options. The major difference regarding editors is that in the Content Studio, as of version 1.008, only store admins can edit and create content although this may change if enough customers request it. The blogger module uses customer accounts, editor accounts, for content creation and maintenance.

Image support is about the same, however the Content Studio does have an image selector that gives you quick access to previously used images as well as access to product images if you're creating locked product content. Locked content is nothing more than content associated with a particular product, page, or category. We call it locked because the code is locked into the product, page or category.

Another major difference is how easy it is to use Content Studio content anywhere in your store. It's possible to use blogger content anywhere in your store, and many people do it (including here on Scot's Scripts) but the Content Studio makes it much more straightforward. 

Another big difference is organizing content. In the blogger module content is organized first between different blogs, then there are codes, categories, and tags. Tags are treated as search items, codes are treated one more way to organize, and categories are, well, categories.

In the Content Studio content is organized by codes and tags, and through a simple URL parameter the Content Studio can be used as a support and documentation system, a simple blogging system, and a way to links various bits of content into seamless groups, with the content accessed much more easily than with the blog module.

In summary, if you're looking for something more like Word Press where your posts have their own URLs then the blogger module is for you. If you are looking for an easy way to add rich content in your store for pages, products, and anything else, then the Content Studio is for you.


]]>
<![CDATA[Miva Merchant Error: admin/storemod.mv]]> http://www.scotsscripts.com/blog/miva-merchant-error-adminstoremodmv.html If you are in the Miva Merchant admin and this error breaks the store:

http://www.scotsscripts.com/blog/miva-merchant-error-adminstoremodmv.html
Scot's Miva Scripts News and Updates
If you are in the Miva Merchant admin and this error breaks the store:

Runtime error in mm5/5.00/admin.mvc @ [00000332:000003d8]: admin/storemod.mv: Line 882: MvDO: No such file or directory

it means there is a module file physically missing. 

The "Line 882" will most likely change as Miva Merchant 10 is updated, but the error will probably remain the same until the developers add a routine to check for the existence of module files before trying to access them.

This error comes up if you rename, move, or delete a module manually using FTP, your hosting control panel, or some other means.

The only way to get rid of this error is to put the file back or go into PHPMyAdmin and manually edit the store tables relating to modules (which I will not explain here: If you know how, you know how, if you don't, you shouldn't do it.)

]]>
<![CDATA[Miva Merchant Custom Fields for Pages]]> http://www.scotsscripts.com/blog/miva-merchant-page-custom-fields.html The most powerful content feature in Miva Merchant is rarely used to it's full potential.

Basically, we're talking about custom fields for pages, as many as you want.

You won't find a " />Have you ever wanted custom fields for pages in Miva Merchant? Well, you already have them but they aren't called custom fields.]]> Wed, 9 Dec 2020 11:04:00 GMT http://www.scotsscripts.com/blog/miva-merchant-page-custom-fields.html Scot's Miva Scripts News and Updates The most powerful content feature in Miva Merchant is rarely used to it's full potential.

Basically, we're talking about custom fields for pages, as many as you want.

You won't find a "Custom Fields" tab when editing a page template, but you will find an "SEO" tab.

By default you will most often see options for page title, description, and key words. However, you can add as many options as you want and use them like page custom fields.

Using them is super easy.

Assign Page Item

First, check the "ITEMS" tab and make sure the "Product/Category META-Tag Settings" (prodctgy_meta) item is assigned. If it's not then all you get is the title SEO field.

Create Custom Fields for Miva Pages

Go to the "Global Settings" in the "User Interface" and then click on "META Tag Settings". 

Once you're in there click the "Add META Name" button and make a new meta tag/page custom field.

Example

Let's say you want to add a meta image (sharing image) to your pages.

You'd create a new meta tag called meta_image (or whatever you like) by clicking the "Add META Name" button, entering meta_image in the "meta name" column, something like "Meta Image" in the prompt, and then selecting text area or text field from the dropdown and saving changes.

Select text field for small items such as headline and titles and whatnot. Select text area for larger blocks of code.

Customize the new meta image field by opening a page to edit and clicking on the "SEO" tab.

Using Page Meta Fields

All page meta fields are accessed the same way.

l.settings:page_metafields:meta_name

For the example above, the meta_image data is available in l.settings:page_metafields:meta_image and can be displayed using mvt:eval or with a page entity:

Why is all this useful?

It makes it easy to customize the data on a page the same way product custom fields make it easy to customize product data.

If you want to override the default "seo title" that a page is using, you can make a meta field called title_override, go to the "SEO" tab of the page and enter an alternate title, then in the head of the page or your global header and footer use code like this to see if there is an alternate title and if so, display it. This example has a final fallback to the page name.

<mvt:if expr="l.settings:page_metafields:title_override">
    <h1>&mvt:page_metafields:title_override;</h1>
<mvt:elseif expr="l.settings:page:title">
    <h1>&mvt:page:title;</h1>
<mvt:else>
    <h1>&mvt:page:name;</h1>
</mvt:if>
]]>
<![CDATA[Solution for Thunderbird 78 Taking a Long Time to Preview Message]]> http://www.scotsscripts.com/blog/solution-for-thunderbird-taking-a-long-time-to-preview-message.html Thunderbird (http://www.scotsscripts.com/blog/solution-for-thunderbird-taking-a-long-time-to-preview-message.html Scot's Miva Scripts News and Updates Thunderbird (https://www.thunderbird.net/en-US/download/) is an amazing email client because it does whatever I want. My emails are on my computer so it's fast and convenient. I'm currently running version 78.4.0, 32bit.

Sometimes, however, Thunderbird is not fast and in my case it always had problems loading up long messages for viewing. Sometimes I have long emails because a I'm going back and forth with a client about something, and as that message gets larger and larger, sometimes over 100k, Thunderbird gets slower and slower.

This isn't a new problem. I've been dealing with it on and off for years. Today I found a solution, and it changed my Thunderbird world.

Speed Up Thunderbird Message Loading

  • Go to the "View" menu item.
  • Find the "Message Body As" option.
  • Select the "Plain Text" option.

If the screenshot below doesn't look like your Thunderbird it might be because I turned off the fly-out menu and and use the old style menu.

Once I selected "Plain Text" method of viewing the message body, all those huge message threads that took forever to load started loading up hundreds of times faster.

What is the downside? You don't see images or any other kinds of graphics, which doesn't matter one bit because you can install this addon to give you a button that loads the html version of a message if you want it:

https://addons.thunderbird.net/en-us/thunderbird/addon/allow-html-temp/

To install this addon in Thunderbird, click on TOOLS then ADD-ONS then search for "Allow HTML Temp"

Quick Privacy Tip

Turn graphics off in Thunderbird. Do it now.

Did you know that it's super easy to track if you opened an email simply by loading the graphics? You will notice that sometimes when an image is loaded in an email it won't just be src="some_image.jpg", it  might be src="some_image.jpg?some_variable=some_value"

When that image is loaded, the back end software can track it because of the url parameters/variables attached to the image call.

Turn off Thunderbird graphics in message by going to OPTIONS and search for "remote"

]]>
<![CDATA[How to Disable Double Click on Submit Button]]> http://www.scotsscripts.com/blog/how-to-disable-double-click-on-submit-button.html Prevent double clicks on form buttons. Thu, 16 Jan 2020 14:27:00 GMT http://www.scotsscripts.com/blog/how-to-disable-double-click-on-submit-button.html Scot's Miva Scripts News and Updates A lot of web users double click links and form buttons. 

I've watched over the shoulder of friends, normally older friends who haven't grown up with computers, who do this and when I ask them why, the answer is basically the same. They didn't know that you could click links and buttons once. They thought it was like their computer.

The problem isn't that they click form buttons twice, the problem is whatever server side processing is going on doesn't know how to handle a double submit. 

This is a bug in the server side processing system and the developer should have taken double submits into consideration when creating their Miva Module, php script, or whatever.

The main issue with that? Often you can't get the original developer to fix the issue or if they do it takes a long time for them to get around to it or figure out a solution.

In the meantime, you can add a very simple bit of javascript to any button to disable more than one click.

The Prevent Double Form Submit Fix

<button type="submit" id="submitbutton" onclick="document.getElementById('submitbutton').disabled = true;">Click Me</button>

Normal button:

Single click button:

That disabled any further clicking of the button but it doesn't really show the user they clicked, so they might hurt themselves clicking over and over again while the form is being processed. 

Fade the Button After Click

Let's add one more bit of js to fade the button out a bit so users have a visual cue that they clicked the button.

<button type="submit" id="submitbutton" onclick="document.getElementById('submitbutton').disabled = true;document.getElementById('submitbutton').style.opacity='0.5';">Click Me</button>

Single click button that fades out:

Now it's apparent that the button was clicked.

Jquery

Doing this with Jquery lets you get more creative with less work than doing it in pure javascript. You may want to replace the button with a spinner, or change the button text, or any number of creative options. The easiest is to hide the button and show something else, like a message (or hide the active button and replace it with an inactive button.) 

These kinds of things are done using Jquery hide() and show() functions. Check out w3schools jquery show and hide tutorial on this for more information.

]]>
<![CDATA[Make the "Select" Form Element Easy with Mivascript]]> http://www.scotsscripts.com/blog/make-the-select-form-element-easy-with-mivascript.html Using shortcut functions makes your mivascript projects go faster. This function takes the hassle out of the select form element. Thu, 21 Nov 2019 10:05:00 GMT http://www.scotsscripts.com/blog/make-the-select-form-element-easy-with-mivascript.html Scot's Miva Scripts News and Updates The "select" form element let's people select from a list of options. The only real problem with it is when the data is being edited there may be a lot of MvIF's to contend with and if there are a lot of "select" form elements, populating the form data with the right selection can get messy with a lot of extra code.

Here's a mivascript function that makes this super easy and removes the mess.

<MvFUNCTION NAME = "select" PARAMETERS = "class,default,name,condition,options" STANDARDOUTPUTLEVEL="compresswhitespace,text,html" >
    <MvASSIGN NAME = "l.options" VALUE = "{ miva_array_deserialize( l.options ) }" />
    <select class="{ l.class } name="{ l.name }">
        <option value=""><MvEVAL EXPR = "{ l.default }"></option>
        <MvFOREACH ITERATOR = "l.option" INDEX = "l.pos" ARRAY = "l.options">
            <MvIF EXPR = "{ gettoken(l.option,'-',1) EQ l.condition }">
                <option value="{ gettoken(l.option,'-',1) }" selected><MvEVAL EXPR = "{ gettoken(l.option,'-',2) }"></option>
            <MvELSE>
                <option value="{ gettoken(l.option,'-',1) }"><MvEVAL EXPR = "{ gettoken(l.option,'-',2) }"></option>
            </MvIF>
        </MvFOREACH>
    </select>
</MvFUNCTION>
  • The class parameter sets the "select" form element class.
  • The defaultparameter sets the no-value option (like, "Select one...")
  • The name parameter is the name of the variable for the "select" form element.
  • The condition parameter is the what has to match in order to make an option selected.
  • The options parameter is a list of option values and labels.

The options parameter is set up in a deserialized array style and we also use a dash to separate the value from the option label:

<MvASSIGN NAME = "l.options" VALUE = "{ 'value1-Option Label One,value2-Option Label Two,value3-Option Label Three,value4-Option Label Four' }" />

Here's a basic call to list the above options without anything selected. This would be used for a fresh form for a new record.

<MvASSIGN NAME = "l.ok" VALUE = "{ select(l.null,'Select one...','selected_value',l.null,l.options) }" />

When you're populating the form for editing you would set the condition that needs to be matched so the proper "option" is preselected. In this example we'll set the condition to  'value2' so it's automatically selected:

<MvASSIGN NAME = "l.condition" VALUE = "{ 'value2' }" />
<MvASSIGN NAME = "l.ok" VALUE = "{ select(l.null,'Select one...','selected_value',l.condition,l.options) }" />

This sets the value2 option as selected:

I'm using the bootstrap framework here so I could include the form-control class:

<MvASSIGN NAME = "l.condition" VALUE = "{ 'value2' }" />
<MvASSIGN NAME = "l.ok" VALUE = "{ select('form-control','Select one...','selected_value',l.condition,l.options) }" />

This will evaluate to:

<select class="form-control" name="selected_value">
    <option value="">Select one...</option>
    <option value="value1">Option Label One</option>
    <option value="value2" selected>Option Label Two</option>
    <option value="value3">Option Label Three</option>
    <option value="value4">Option Label Four</option>
</select>
]]>
<![CDATA[Mivascript: The Wide World of Arrays]]> http://www.scotsscripts.com/blog/mivascript-the-wide-world-of-arrays.html Arrays are indispensable in the world of coding. Mivascript arrays are easy to use and follow the same basic array principles you'll find in any coding language. Fri, 26 Jul 2019 16:21:00 GMT http://www.scotsscripts.com/blog/mivascript-the-wide-world-of-arrays.html Scot's Miva Scripts News and Updates Mivascript Arrays on a basic level are a list of items organized in a way that makes them easy to access. All programming languages have some sort of array support and Mivascript is no different.

Filling an Array

Here are a few ways you can add items to an array. For this example we'll use a simple array (list) of names.

The first example is how to create the array manually.

<mvassign name="l.myarray" index="1" value="{ 'Isaac Asimov' }">
<mvassign name="l.myarray" index="2" value="{ 'Ursala K. Leguin' }">
<mvassign name="l.myarray" index="3" value="{ 'Fritz Leiber' }">
<mvassign name="l.myarray" index="4" value="{ 'Andre Norton' }">
<mvassign name="l.myarray" index="5" value="{ 'Fredrich Pohl' }">

The name of the array is l.myarray and we're putting names of sci-fi/fantasy authors into it. The index is what position the array item is in.

Display the Array

One of the most basic things to do with an array is display the array contents. We'll use the built in MvFOREACH Mivascript tag to do this.

<mvforeach iterator="l.arrayitem" index="l.pos" array="l.myarray">
    <mveval expr="{ l.arrayitem }"><br>
</mvforeach>

This displays:

Isaac Asimov
Ursala K. Leguin
Fritz Leiber
Andre Norton
Fredrich Pohl

A more dynamic way of loading an array is to use the miva_array_insert(...) function. It's quite useful while template coding in Miva Merchant templates.

<mvassign name="l.ok" value="{ miva_array_insert(l.myarray,'Isaac Asimov',-1) }">
<mvassign name="l.ok" value="{ miva_array_insert(l.myarray,'Ursala K. Leguin',-1) }">
<mvassign name="l.ok" value="{ miva_array_insert(l.myarray,'Fritz Leiber',-1) }">
<mvassign name="l.ok" value="{ miva_array_insert(l.myarray,'Andre Norton',-1) }">
<mvassign name="l.ok" value="{ miva_array_insert(l.myarray,'Fredrich Pohl',-1) }">

This assigns each name to the end of the array. Instead of -1 you can also manually set a position, however the usefulness of this function is that you don't need to know the position to fill the array. This array will display using the same MvFOREACH code above.

These are the most simple arrays. But what if you want to add more data, for example, specify if the author is a male or female, or the author's favorite ice cream?

Arrays of Structures

This is where structures come in, and it's also quite easy.

Fill the array:

<mvassign name="l.author:name" value="{ 'Isaac Asimov' }">
<mvassign name="l.author:gender" value="{ 'male' }">
<mvassign name="l.author:icecream" value="{ 'Vanilla' }">
<mvassign name="l.ok" value="{ miva_array_insert(l.authors,l.author,-1) }">

<mvassign name="l.author:name" value="{ 'Ursala K. Leguin' }"> <mvassign name="l.author:gender" value="{ 'female' }"> <mvassign name="l.author:icecream" value="{ 'Doomsday Swirl' }"> <mvassign name="l.ok" value="{ miva_array_insert(l.authors,l.author,-1) }">
<mvassign name="l.author:name" value="{ 'Fritz Leiber' }"> <mvassign name="l.author:gender" value="{ 'male' }"> <mvassign name="l.author:icecream" value="{ 'Lankhmar Special' }"> <mvassign name="l.ok" value="{ miva_array_insert(l.authors,l.author,-1) }">
<mvassign name="l.author:name" value="{ 'Andre Norton' }"> <mvassign name="l.author:gender" value="{ 'female' }"> <mvassign name="l.author:icecream" value="{ 'Mint Chocolate' }"> <mvassign name="l.ok" value="{ miva_array_insert(l.authors,l.author,-1) }">
<mvassign name="l.author:name" value="{ 'Fredrich Pohl' }"> <mvassign name="l.author:gender" value="{ 'male' }"> <mvassign name="l.author:icecream" value="{ 'Strawberry' }"> <mvassign name="l.ok" value="{ miva_array_insert(l.authors,l.author,-1) }">

Now each item in the array contains multiple pieces of information. Here's how we display that:

<mvforeach iterator="l.author" index="l.pos" array="l.authors">
    <p>
        Name: <mveval expr="{ l.author:name }"><br>
        Gender: <mveval expr="{ l.author:gender }"><br>
        Ice Cream: <mveval expr="{ l.author:icecream }">
    </p>
</mvforeach>

The output for this is:

Name: Isaac Asimov
Gender: male
Ice Cream: Vanilla

Name: Ursala K. Leguin Gender: female Ice Cream: Doomsday Swirl
Name: Fritz Leiber Gender: male Ice Cream: Lankhmar Special
Name: Andre Norton Gender: female Ice Cream: Mint Chocolate
Name: Fredrich Pohl Gender: male Ice Cream: Strawberry

Bonus: Sorting the Array

Sorting the array should be a basic function of Mivascript, but instead it's a little bit tricky. Not that tricky once you get the hang of it, though. 

Let's sort the above list of authors by their names before we display the data. 

The miva_array_sort( aggregate var, callback, data var) function requires a callback function to do the heavy lifting. I'm not going to get into what this is all about, but this particular callback function will sort on the name. Add this function to the bottom of your script.

<mvfunction name="Sort_Callback" parameters="left var, right var, data var" standardoutputlevel="">
    <mvassign name="l.left_name" value="{ tolower( l.left:name ) }">
    <mvassign name="l.right_name" value="{ tolower( l.right:name ) }">

<mvif expr="{ l.left_name LT l.right_name }"> <mvfunctionreturn value="-1"> <mvelseif expr="{ l.left_name GT l.right_name }"> <mvfunctionreturn value="1"> </mvif>
<mvfunctionreturn value=""> </mvfunction>

Sort the array:

<mvassign name="l.ok" value="{ miva_array_sort(l.authors,'Sort_Callback',l.data) }">

Now when we display the data using the same MvFOREACH loop as above the names will be in alphabetical order.

Full Script

Here's an outline of what the script would look like:

  1. Fill the array
  2. Sort the array
  3. Display the array data
  4. Include callback function
<mvcomment>
|
| fill up array
|
</mvcomment>

<mvassign name="l.author:name" value="{ 'Isaac Asimov' }"> <mvassign name="l.author:gender" value="{ 'male' }"> <mvassign name="l.author:icecream" value="{ 'Vanilla' }"> <mvassign name="l.ok" value="{ miva_array_insert(l.authors,l.author,-1) }">
<mvassign name="l.author:name" value="{ 'Ursala K. Leguin' }"> <mvassign name="l.author:gender" value="{ 'female' }"> <mvassign name="l.author:icecream" value="{ 'Doomsday Swirl' }"> <mvassign name="l.ok" value="{ miva_array_insert(l.authors,l.author,-1) }">
<mvassign name="l.author:name" value="{ 'Fritz Leiber' }"> <mvassign name="l.author:gender" value="{ 'male' }"> <mvassign name="l.author:icecream" value="{ 'Lankhmar Special' }"> <mvassign name="l.ok" value="{ miva_array_insert(l.authors,l.author,-1) }">
<mvassign name="l.author:name" value="{ 'Andre Norton' }"> <mvassign name="l.author:gender" value="{ 'female' }"> <mvassign name="l.author:icecream" value="{ 'Mint Chocolate' }"> <mvassign name="l.ok" value="{ miva_array_insert(l.authors,l.author,-1) }">
<mvassign name="l.author:name" value="{ 'Fredrich Pohl' }"> <mvassign name="l.author:gender" value="{ 'male' }"> <mvassign name="l.author:icecream" value="{ 'Strawberry' }"> <mvassign name="l.ok" value="{ miva_array_insert(l.authors,l.author,-1) }">
<mvcomment> | | sort array | </mvcomment>
<mvassign name="l.ok" value="{ miva_array_sort(l.authors,'Sort_Callback',l.data) }">
<mvcomment> | | display array data | </mvcomment>
<mvforeach iterator="l.author" index="l.pos" array="l.authors"> <p> Name: <mveval expr="{ l.author:name }"><br> Gender: <mveval expr="{ l.author:gender }"><br> Ice Cream: <mveval expr="{ l.author:icecream }"> </p> </mvforeach>
<mvcomment> | | callback function | </mvcomment>
<mvfunction name="Sort_Callback" parameters="left var, right var, data var" standardoutputlevel=""> <mvassign name="l.left_name" value="{ tolower( l.left:name ) }"> <mvassign name="l.right_name" value="{ tolower( l.right:name ) }">
<mvif expr="{ l.left_name LT l.right_name }"> <mvfunctionreturn value="-1"> <mvelseif expr="{ l.left_name GT l.right_name }"> <mvfunctionreturn value="1"> </mvif>
<mvfunctionreturn value=""> </mvfunction>
]]>
<![CDATA[How to Set a "Master" Parent Category for a Product in Miva Merchant]]> http://www.scotsscripts.com/blog/how-to-set-a-master-parent-category-for-a-product-in-miva-merchant.html For this example let's say you are selling a baseball hat and in your store you have several categories that the hat belongs to, such as athletic wear, hats, and summer clothing.

Let's also say that when someone clicks on the hat you always want your breadcrumbs to reflect the hats category rather then the athletic wear or summer clothing.

Normally in Miva Merchant when a customer opens a category in the store and then clicks through to a product, the breadcrumbs will always show the categories the customer clicked in from. If they were in the athletic wear category and click on the baseball hat, the breadcrumbs will reflect athletic wear.

The way to make it so baseball hats always reflect the hats category is to set a Canonical Category.

Step 1

Open the product in the Miva Merchant admin.

Step 2

Assign the " />Normally a product breadcrumbs will show the category the customer "clicked in" from, however what if you want to show a different category in the breadcrumbs?]]> Wed, 19 Jun 2019 13:07:35 GMT http://www.scotsscripts.com/blog/how-to-set-a-master-parent-category-for-a-product-in-miva-merchant.html Scot's Miva Scripts News and Updates For this example let's say you are selling a baseball hat and in your store you have several categories that the hat belongs to, such as athletic wear, hats, and summer clothing.

Let's also say that when someone clicks on the hat you always want your breadcrumbs to reflect the hats category rather then the athletic wear or summer clothing.

Normally in Miva Merchant when a customer opens a category in the store and then clicks through to a product, the breadcrumbs will always show the categories the customer clicked in from. If they were in the athletic wear category and click on the baseball hat, the breadcrumbs will reflect athletic wear.

The way to make it so baseball hats always reflect the hats category is to set a Canonical Category.

Step 1

Open the product in the Miva Merchant admin.

Step 2

Assign the "master category" (for this example "hats") to the Canonical Category field.

If you don't know the category code, click the "LOOK UP" button (note that I selected "Category 2" below, but it is the same process if I were to select "hats".) 

That's all there is to it. If you set the canonical category for a product, every time someone visits that product it will always show the canonical category in the breadcrumbs as well as in the meta and SEO information if you have it set up that way.

]]>
<![CDATA[Make a JSON Configuration file in Miva Script]]> http://www.scotsscripts.com/blog/make-a-json-configuration-file-in-miva-script.html The Miva Scripting language has a fantastic JSON parser that makes it easy to use JSON files for configurations and other plain text settings. Tue, 18 Jun 2019 11:18:00 GMT http://www.scotsscripts.com/blog/make-a-json-configuration-file-in-miva-script.html Scot's Miva Scripts News and Updates JSON is a very nice way to store data in plain text format. This is useful because you can edit it in a text area in your web app or Miva Merchant module, or simply edit it in a text editor.

Let's say your json file is called config.json and you want load the settings you've saved in it. 

Let's say this is what the json file looks like:

{
    "name":"Scot Ranney",
    "website_name":"Scot's Scripts",
    "city":"Bellingham",
    "state":"Washington"
}

The code below reads that file and puts the data into a structure you can use in your Miva script. This example assumes the json file is in the same directory as the script or module.

<mvif expr="{ sexists('config.json') }">
    <mvassign name="l.ok" value="{ file_read('config.json','script',l.json) }" />
    <mvassign name="l.ok" value="{ miva_json_decode(l.json,l.config) }" />
</mvif>

1. Use the built in Mivascript function sexists(...)  to see if the file exists. This way we don't get any error messages if the file isn't there.

2. Use the built in Mivascript function file_read(...) to load the data into a variable. In this case I decided to use l.json to hold the data from the json file.

3. Use the built in Mivascript function miva_json_decode(...)  to convert the json data into a structure. In this case the data would be available like this:

l.config:name
l.config:website_name
l.config:city
l.config:state

You could display it in any way, such as a welcome message:

Hello <MvEVAL EXPR= "{ l.config:name }">, how is the weather in <MvEVAL EXPR= "{ l.config:city $ ', ' $ l.config:state }">?

This would display as:

Hello Scot, how is the weather in Bellingham, Washington?
]]>
<![CDATA[The Number One Miva Merchant SEO Tip]]> http://www.scotsscripts.com/blog/the-number-one-miva-merchant-seo-tip.html http://www.scotsscripts.com/blog/the-number-one-miva-merchant-seo-tip.html Scot's Miva Scripts News and Updates Miva Merchant is a fantastic eCommerce platform that is used by businesses that don't want to deal with the inconsistencies, bugs, and security hassles that various other eCommerce platforms deal with. 

However, once you have your Miva Merchant store set up, your product catalog finished, some custom images on the home page, what's next?

Most new Miva Merchant stores have similar SEO issues when they go online, and if you are interested in fixing all of them, check out our Miva Merchant Checklist (with an infographic you can print out for reference): 

https://www.scotsscripts.com/blog/seo-checklist-by-scots-scripts.html

The First SEO Task for New Miva Merchant Stores: Category Descriptions

Your product categories are important for SEO but Miva Merchant does not come with built in category description fields. That means you need to manually set category descriptions in your SEO tab.

Move Your SEO Tab

The SEO tab is sometimes hidden or at the end of the tab list. Let's move it to the beginning so you are reminded to use the SEO tab every time you create a category.

First open up a category in the Miva Merchant admin and see if the SEO tab is visible. If not, click the More button and select the Edit Tab Display Order option.

After you click on that, find the SEO tab and drag it up until it's under the Category tab.

When you're done, the SEO tab will be right where you need it. Do this in the product edit screen and the page edit screen because SEO is a habit and everything you do in your store should have some SEO value, and this makes it much easier to remind yourself of that.

After you have moved the SEO tab to an easy to access location, click on it to bring up the Category meta data.

First, fill in the description. This will be used as the meta description. Normally it will never be shown on the page, so stuff it full of keywords and phrases.

Don't worry so much about the keywords since the majority of serious search engines don't use them (content is key, not key words.)

For example, this example category is "bedroom". A good SEO description does not include a lot of adjectives. Search engines don't care if you are writing a poem. This might look good to a human, but for SEO it's useless:

"Visit our beautiful bedroom collection where you'll find the most modern designs to help you create the bedroom of your dreams. Don't wait, supplies are limited."

This is a fairly basic description, but better used somewhere in the product description, not in category SEO. For category SEO the description should use more key terms and phrases. 

"Fashionable bedroom furniture, end tables, beds, mattresses, mirrors, vanities, and closet organizers and lighting to help you create a comfortable and modern bedroom."

How do you find key terms and phrases?

If you're just getting started with SEO you'll be happy to know there is a VERY easy way to create the best descriptions you can: Steal from competitors. 

Search for your product online and go to the first non-sponsored site that comes up and check the meta data on the page and use it. Edit it so it's not word for word, but use it as a base for your own. 

How do I see meta data?

You can use the inspector (right click on the page and find the "inspector" option) but that's mainly a developer tool. To make is super easy, I use a Chrome plugin called SEO Meta: 

https://chrome.google.com/webstore/detail/seo-meta-in-1-click/bjogjfinolnhfhkbipphpdlldadpnmhc/

This plugin puts a button in my browser that opens up a box with all the meta information you could want. Here's an example from the home page on this site. If you scroll down you see all the other meta, plus other information.


 Miva Merchant SEO Extra Tip 

Another issue with Miva Merchant out of the box is the page titles. They are called things like "Storefront" and "About Us". Who will ever visit a page called "Storefront" or a page called "About Us"?

Open the SEO tab in all your storefront (SFNT) page and you'll see that the page title is blank.

Is the front page of your site being called "Storefront" good SEO? Not exactly.

So for example, if your store is called, "Best Tires", change the SEO page title to something like, "Best Tires Storefront". In this case, I'll change it to, "Scot's Scripts Development Store"

I will also change the regular page title to match the SEO title. Now when I open the page it looks like:

When you visit the page, the browser tab will now say, "Scot's Scripts Development Store" instead of "Storefront"

Go through all the important pages on your site. You can skip the Product (PROD) and Category (CTGY) pages because their SEO will be derived form the product or category that the customer is visiting.

Schema Microdata SEO

This is important too. It's not something I can explain in a post, but we offer a services that creates dynamic schema microdata for every page on your site. It usually takes about an hour to install, including any customizations necessary for how your site is put together. Contact us for more information or if you have any questions about anything you've seen here.

Good luck, and remember, SEO is a habit. Work on it every day to increase sales and search engine visibility.

]]>
<![CDATA[Powerful Utlility to Rename Multiple Files in Windows]]> http://www.scotsscripts.com/blog/rename-multiple-files-in-windows.html How do I handle complex bulk file renaming tasks in windows?

The most useful utility I've ever used for bulk file renaming is Bulk Rename Utility. You might not even know you need this tool until after you use it.

http://www.scotsscripts.com/blog/rename-multiple-files-in-windows.html Scot's Miva Scripts News and Updates How do I handle complex bulk file renaming tasks in windows?

The most useful utility I've ever used for bulk file renaming is Bulk Rename Utility. You might not even know you need this tool until after you use it.

https://www.bulkrenameutility.co.uk/Main_Intro.php

The utility is donation-ware, so if you use it a few times send them $10 to show your appreciation for the developers hard work.

In addition to a large array of built in filename manipulation tools such as "ignore the first # characters in the selected files", this Bulk Rename Utility can also use regular expressions to make renaming rules for a group of files.

Features: Instead of me listing what this utility can do, check out the features page:

https://www.bulkrenameutility.co.uk/Features.php

Actually I do need to mention one of the best features which is new filenames are shown in a preview column ("New Name" column in the image below) and this by itself makes this utility worth using.

A picture is worth a thousand words:

]]>
<![CDATA[Miva Merchant API: How to Test if a Product is in a Category]]> http://www.scotsscripts.com/blog/miva-merchant-api-how-to-test-if-a-product-is-in-a-category.html Have you ever wanted to find out if a product is in a particular category? Here's how you can do that using the ever so nifty Miva Merchant API. Fri, 3 May 2019 16:46:00 GMT http://www.scotsscripts.com/blog/miva-merchant-api-how-to-test-if-a-product-is-in-a-category.html Scot's Miva Scripts News and Updates The Miva Merchant API has a set of functions that start with CategoryXProduct that deal with handling what categories products are assigned to.

If you want to quickly find out if a product is assigned to a category, use the

<mvt:do file="g.Module_Library_DB" name="l.success" value="CategoryXProduct_Load(cat_id, product_id, categoryxproduct var)" />

function.

The cat_id is the category id, product_id is the product id, and categoryxproduct is the structure the data will be loaded into if the product exists in the category.

For example, if you've loaded some product data into l.settings:product and some category data into l.settings:category, you could check to see if the product is in the category this way:

<mvt:do file="g.Module_Library_DB" name="l.success" value="CategoryXProduct_Load(l.settings:category:id, l.settings:product:id, l.settings:_catproduct)" />

Once you call this, you can check l.settings:_catproduct to see if the product was found in the category.

<mvt:if expr="l.settings:_catproduct:cat_id">
    do something here because the product was found in the category
<mvt:else>
    do something here because the product was not found in the category
</mvt:if>

If the product is found in the category, the l.settings:_catproduct structure will contain:

l._catproduct:cat_id
l._catproduct:product_id
l._catproduct:disp_order

What if you don't know the product or category id?

If you know the product code and the category code then use these category and product lookup via code functions. Put them above the CategoryXProduct_Load(...) function so the product and category data is available.

<mvt:assign name="l.product_code" value="'my_product_code'" />
<mvt:do file="g.Module_Library_DB" name="l.success" value="Product_Load_Code(l.product_code, l.settings:product)" />

<mvt:assign name="l.category_code" value="'my_category_code'" /> <mvt:do file="g.Module_Library_DB" name="l.success" value="Category_Load_Code(l.category_code, l.settings:category)" />

If you used a product code that exists in your store the product data will be in l.settings:product and the product id would be l.settings:product:id

Same thing goes for the category lookup.

]]>
<![CDATA[How to Get Around HSTS Chrome Security Errors]]> http://www.scotsscripts.com/blog/How-to-Get-Around-HSTS-Chrome-Page-Errors.html You searched the web, finally found an answer, and now Chrome won't let you into the site because the page is not secure and there is some kind of HSTS error.

You might see messages like " />It's super frustrating to visit a page and then because of heavy handed Chrome browser https rules you can't get in. Here's a quick fix for HSTS lock outs.]]> Thu, 11 Apr 2019 18:42:00 GMT http://www.scotsscripts.com/blog/How-to-Get-Around-HSTS-Chrome-Page-Errors.html Scot's Miva Scripts News and Updates You searched the web, finally found an answer, and now Chrome won't let you into the site because the page is not secure and there is some kind of HSTS error.

You might see messages like "Your connection is not private" or "You cannot visit..." when trying to access the page.

Basically Chrome has turned into net-mommy and wants to tell you what is good for you and what is not. Hey, if I want to play with broken glass and rusty nails, I'm going to play with broken glass and rusty nails.

Here's how you fix it.

Step 1: Open the chrome HSTS settings page

chrome://net-internals/#hsts

Step 2: Delete domain security policy

At the bottom of the hsts settings page you will find an entry for Delete domain security policies. Enter the domain of the page you are trying to view and then click the delete key.

That's it. Reload the page and go into the advanced warning options to set a security exception (checkbox) which should then let you view the page.

]]>
<![CDATA[Miva Merchant Elements CSS Cheat Sheet]]> http://www.scotsscripts.com/blog/Miva-Merchant-Elements-CSS-Cheat-Sheet.html A cheat sheet for Miva Merchant Elements CSS with all CSS elements on one page and in a mostly orderly fashion.]]> Thu, 4 Apr 2019 00:42:00 GMT http://www.scotsscripts.com/blog/Miva-Merchant-Elements-CSS-Cheat-Sheet.html Scot's Miva Scripts News and Updates This is a quick list of Elements CSS classes I put together over a couple glasses of scotch at the end of the night. Let me know if you see any problems.

Update Dec 2020: Matt Zimmerman has updated the online style guide which is now a great resource: https://docs.miva.com/readytheme-shadows/#overview-style-guide

CSS Objects

CSS Layout

Breakpoints for grid items for the most part seems to happen automatically in the Elements CSS framework. If a class has known breakpoint modifiers, they ( --s --m --l --w ) can be added to the end of the class name.

Simple layout example. The widths can be 1-12 and can be mixed and matched. Columns will wrap if the widths in a layout add up to more than 12. More information on widths at the bottom of the components section.

### two columns

<div class="o-layout"> <div class="o-layout__item u-width-6"> </div> <div class="o-layout__item u-width-6"> </div> </div>

Layout classes:

o-layout
o-layout__item
o-layout o-layout--row-reverse
o-layout o-layout--column --m --l --w
o-layout o-layout--column-reverse --m --l --w
o-layout o-layhout--full
o-layout o-layout--narrow
o-layout o-layout--wide
o-layout o-layout--flush
o-layout o-layout--spaced

### vertical alignment
o-layout o-layout--align-top o-layout o-layout--align-center o-layout o-layout--align-bottom o-layout o-layout--align-baseline o-layout o-layout--align-stretch
### horizontal alignment
o-layout o-layout--justify-start o-layout o-layout--justify-center o-layout o-layout--justify-end o-layout o-layout--justify-around o-layout o-layout--justify-between
### flex ordering
o-layout o-layout__first --s --m --l --w o-layout o-layout__last
### growth control
o-layout--grow o-layout--no-grow o-layout--shrink o-layout--no-shrink
### wrap
o-layout--no-wrap o-layout--wrap o-layout--wrap-reverse

Lists

o-list-bare
o-list-block
o-list-inline
o-list-inline o-list-inline--narrow
o-list-inline o-list-inline--wide

Tables (see below in the components section for code example)

o-table
o-table o-table--fixed
o-table o-table--narrow
o-table o-table--wide
o-table o-table-borderless

    Wrapper

    o-wrapper
    o-site-wrapper
    o-wrapper o-wrapper--full
    o-wrapper--flush
    

    Components

    Buttons

    c-button c-button--tiny
    c-button c-button--small
    c-button
    c-button c-button--large
    c-button c-button--huge
    
    c-button c-button--full
    c-button c-button--hollow c-button c-button--clear c-button disabled="" c-button is-error c-button c-button--glossy c-button-primary

    Control Groups: make button groups

    <div class="c-control-group">
        <button class="c-button c-control-group__button">Button 1</button>
        <button class="c-button c-control-group__button">Button 2</button>
        <button class="c-button c-control-group__button">Button 3</button>
    </div>
    
    ### Modifiers: <div class="c-control-group c-control-group--rounded">...</div>
    c-button c-control-group--rounded c-button c-control-group--rounded-right c-button c-control-group--rounded-left c-button c-control-group--stacked

    Divider

    c-divider
    c-divider c-divider--top

    Forms

    <form>
        <fieldset>
            <legend>Example</legend>
            <ul class="c-form-list">
                <li class="c-form-list__item">
                    <label class="c-form-label" for="example1">Example</label>
                    <input id="example1" class="c-form-input" type="text" placeholder="something">
                    <button class="c-button c-control-group__button">Submit</button>
                </li>
            </ul>
        </fieldset>
    </form>
    
    ### select
    <select id="example2" class="c-form-select"> <option value="abc">Option ABC</option> <option value="def">Option DEF</option> </select>
    ### textarea
    <textarea id="example3" class="c-form-input c-form-input--long" placeholder="something here"></textarea>
    ### checkbox
    <label class="c-form-checkbox"> <input class="c-form-checkbox__input" type="checkbox"> <span class="c-form-checkbox__caption">Check Me</span> </label>
    ### inline checkbox
    <li class="c-form-list__item"> <label class="c-form-checkbox c-form-checkbox--inline"> <input class="c-form-checkbox__input" type="checkbox"> <span class="c-form-checkbox__caption">Inline 1</span> </label> <label>...</label> etc </li>
    ### radio
    <label class="c-form-checkbox c-form-checkbox--radio"> <input class="c-form-checkbox__input" type="radio" name="agree" value="yes"> <span class="c-form-checkbox__caption">Yes</span> </label>
    ### inline radio
    <li class="c-form-list__item"> <label class="c-form-checkbox c-form-checkbox--radio c-form-checkbox--inline"> <input class="c-form-checkbox__input" type="radio" name="inline-radio" value="1"> <span class="c-form-checkbox__caption">Radio 1</span> </label> <label>...</label> etc... </li>
    ### inline/grid form
    <ul class="c-form-list o-layout"> <li class="c-form-list__item o-layout__item">...</li> </ul>

    Keyline

    c-keyline
    c-keyline--thick
    c-keyline--small

    Menu

    <nav class="c-menu">
        <h5 class="c-menu__title u-text-uppercase">Quick Links</h5>
        <ul class="c-menu__list u-text-uppercase">
            <li><a class="c-menu__link" href="">About Us</a></li>
            <li><a class="c-menu__link" href="">FAQs</a></li>
            <li><a class="c-menu__link" href="">Contact Us</a></li>
            <li><a class="c-menu__link" href="">Become an Affiliate</a></li>
        </ul>
    </nav>

    Mini-Modal

    <a data-mini-modal="" href="LARGE_IMAGE_URL" title="image">
        <img src="IMAGE_URL">
    </a>
    

    Navigation

    <nav class="u-text-uppercase c-navigation">
        <input id="mainNavButton" class="c-navigation__trigger" type="checkbox">
        <label class="c-navigation__label" for="mainNavButton">Menu</label>
        <ul class="c-navigation__row">
            <li class="c-navigation__list"><a class="c-navigation__link" href="#">All Products</a></li>
            <li class="c-navigation__list"><a class="c-navigation__link" href="#">Category 1</a></li>
            <li class="c-navigation__list"><a class="c-navigation__link" href="#">Category 2</a></li>
            <li class="c-navigation__list"><a class="c-navigation__link" href="#">Category 3</a></li>
            <li class="c-navigation__list"><a class="c-navigation__link" href="#">More</a></li>
        </ul>
    </nav>

    Tables

    <table class="c-table-simple">
        <thead>
        <tr class="c-table-simple__row">
            <th class="c-table-simple__cell">Name</th>
            <th class="c-table-simple__cell">Age</th>
            <th class="c-table-simple__cell">Feet</th>
            </tr>
        </thead>
        <tbody>
            <tr class="c-table-simple__row">
                <td class="c-table-simple__cell">Tim Smith</td>
                <td class="c-table-simple__cell">25</td>
                <td class="c-table-simple__cell">2</td>
            </tr>
        </tbody>
    </table>
    
    ### striped
    <table class="c-table-stripped">...</table>
    <table class="c-table-responsive">...</table>

    Headings

    <h1 class="c-heading-alpha">Heading Alpha <span class="c-heading--subheading">Subheading</span></h1>
    
    <h1 class="c-heading-alpha">...</h1> <h2 class="c-heading-bravo">...</h2> <h3 class="c-heading-charlie">...</h3> <h4 class="c-heading-delta">...</h4> <h5 class="c-heading-echo">...</h5> <h6 class="c-heading-foxtrot">...</h6>
    <p class="c-text-body">...</p>
    <h1 class="c-heading-alpha c-heading--keyline">...</h1> (adds a little divider under the heading)

    Utilities

    Borders: Borders can be used on any element. The example below shows border classes being used on buttons.

    u-border-none
    u-border-thick
    u-border-rounded
    u-border-square
    
    ### border color classes: these are based on theme, so try other color names as well as those below.
    u-border-red u-border-yellow u-border-blue u-border-green u-border-black
    ### button examples
    <button class="c-button u-border-none">No Border</button> <button class="c-button u-border-thick">Thick Border</button> <button class="c-button u-border-rounded">Rounded Border</button> <button class="c-button u-border-square">Square Border</button>

    Clear Fix

    u-clear-fix

    Colors

    Background colors:

    u-bg-red
    u-bg-yellow
    u-bg-blue
    u-bg-green
    u-bg-black
    u-bg-gray-50
    u-bg-gray-40
    u-bg-gray-30-gray-10
    u-bg-gray-20
    u-bg-gray-10
    u-bg-white
    u-bg-primary
    u-bg-secondary
    u-bg-tertiary
    u-bg-accent
    u-bg-highlight
    

    Text colors:

    u-color-red
    u-color-yellow
    u-color-blue
    u-color-green
    u-color-black
    u-color-gray-50
    u-color-gray-40
    u-color-gray-30
    u-color-gray-20
    u-color-gray-10
    u-color-white
    u-color-primary
    u-color-secondary
    u-color-tertiary
    u-color-accent
    u-color-highlight

    Display: These can take breakpoint modifiers. They work from small to wide. 

    If you hide on small, it will hide on everything unless you specifically tell it not to: --s --m --l --w

    u-hide-visually - hide visually but not for screen readers
    u-hidden - hide from everything
    u-invisible - visually hidden but no layout change
    u-flex
    u-block
    u-shown
    u-inline
    u-inline-block
    u-visible
    
    ### Add bBreakpoint modifiers to the class, such as:
    u-hidden--s
    ### Hide on small screen, show on all others:
    <div class="u-hidden--s u-shown--m">...</div>
    ### Hide on large and wide screen, show on small and medium:
    <div class="u-hidden--l">...</div>

    Grids: Create auto columns that wrap intelligently

    o-layout u-grids2
    o-layout u-grids3
    o-layout u-grids4
    etc...
    
    u-grids-1 u-grids-2 u-grids-3 u-grids-4 u-grids-5 u-grids-6 u-grids-7 u-grids-8 u-grids-9 u-grids-10 u-grids-11 u-grids-12
    ### Example
    <div class="o-layout u-grids-3"> <div class="o-layout__item"> </div> <div class="o-layout__item"> </div> <div class="o-layout__item"> </div> <div class="o-layout__item"> </div> <div class="o-layout__item"> </div> </div>
    ### breakpoints: all grid classes can have breakpoints added, --s --m --l --w
    ### breakpoint exmaple, show one column on small, show three on medium and up:
    o-layout u-grids-1 u-grids-3--m

    Use with breakpoints:

    o-layout u-grids-1 u-grids-3--m

    Iconography

    Go here for a list of available icons: https://docs.miva.com/elements/iconography/demo.html

    <span class="u-icon-question"></span>
    <span class="u-icon-envelope"></span>
    etc...

    Print

    Print styles are handled automatically (from HTML5 Boilerplate)

    ### only display on printout
    
    u-printable__content

    Typography

    ### font-families
    
    u-font-primary u-font-secondary
    ### alignment --s --m --l --w
    u-text-left u-text-center u-text-right u-text-justify
    ### sizing
    u-font-tiny u-font-small u-font-medium u-font-large u-font-huge
    ### weight, transformations, decorations
    u-text-light u-text-regular u-text-medium u-text-bold u-text-boldest u-text-italic u-text-lowercase u-text-uppercase u-text-caps u-text-strike u-text-underline u-text-normal u-text-revert
    u-text-constrain (max 75chars per line)

    Vertical Alignment

    u-align-baseline
    u-align-bottom
    u-align-middle
    u-align-top
    
    u-vertical-align-parent u-vertical-align-center

    Widths: These give a fluid width to whichever element they are applied to and include breakpoints --s --m --l --w

    u-width-# --s --m --l --w (# is the number of columns wide, out of 12)
    
    <div class="o-layout"> <div class="o-layout__item u-width-6"> </div> <div class="o-layout__item u-width-6"> </div> </div>
    ### with various breakpoints, can be included in one o-layout and cols will auto wrap to fit
    o-layout__item u-width-12 u-width-4--m o-layout__item u-width-6 u-width-4--m o-layout__item u-width-6 u-width-4--m
    ### width classes, each can take a breakpoint as well --s --m --l --w (width of 1 on small, width of 6 on medium and up: u-width-1--s u-width-6--m)
    u-width-1 u-width-2 u-width-3 u-width-4 u-width-5 u-width-6 u-width-7 u-width-8 u-width-9 u-width-10 u-width-11 u-width-12
    ### offset classes, also can take breakpoints --s --m --l --w
    u-offset-1 u-offset-2 u-offset-3 u-offset-4 u-offset-5 u-offset-6 u-offset-7 u-offset-8 u-offset-9 u-offset-10 u-offset-11 u-offset-12

    Z-Index

    u-below-content
    u-over-content
    u-over-control
    u-over-page
    u-over-screen
    u-over-everything

    Extensions

    These are css/html components that can be used in different readythemes, a sort of plug-n-play system.

    AJAX Add-to-Cart

    Adds a product to the basket without reloading the page.

    Breadcrumbs

    Category Tree

    Hero

    Hero Slider

    Image carousel header/section

    Messages

    Alerts, success, info, etc...

    Mini-Basket

    Mini basket that flies out from the right edge of the browser.

    Navigation

    Use dropdown, overlfow, and overlay style navigations.

    Product Carousel

    Search Preview

    Spinner

    Ajax spinner icon.

    ]]>
    <![CDATA[Miva Con 2019]]> http://www.scotsscripts.com/blog/Miva-Con-2019.html Miva Corporation puts on a very cool convention once a year and this year I thought I'd post a few notes about what they are talking about and what I've seen.]]> Wed, 3 Apr 2019 13:54:00 GMT http://www.scotsscripts.com/blog/Miva-Con-2019.html Scot's Miva Scripts News and Updates These are just some notes I took at the Miva Con. Not everything is fleshed out. Contact me if you want more details on what happened and what's coming up for Miva Merchant.

    Miva Con 2019 was hosted at a beautiful resort called San Bernardino Inn, not far from Miva headquarters. You may think all we did was party and hang out in hot tubs, but that's only mostly true. 

    The format of the con changed slightly so there were fewer choices as far as breakout sessions went (and alas, I was not invited to give my SEO presentation, however I had lengthy semi-private session on my own with about a dozen interested store owners) which actually made it easier for people to figure out what they wanted to see.

    The big deal of course is Version 10 which is going to be a wonderful thing. If you're thinking about converting your store to a new framework, wait for version 10. Just wait for it. Once V10 rolls out we will be able to stage pages and entire frameworks from within without a dev store. So. Just. Wait.

    Hot Topics

    ShopBandit (demo is on their home page) is an amazing search solution for Miva Merchant. The guys have been around Miva Merchant forever, I know them personally, and they will install it, customize it, and you can test it out on your site before it goes live. Bottom line is if facets don't work for you, you need to check this out.

    Day 1

    There are some interesting and exciting things in store for Miva Merchant. A new fraud prevention module (the module is free, the service might not be) has been released called Signifyd.

    StoneEdge order manager is undergoing a major update so if you're frustrated with how ancient and useless StoneEdge is right now, it should be modernized in the near future.

    You will be able to use workflow queues to hold orders before processing. For example, if you have customers calling in during the first 15 minutes of an order because they want to change something, you could automatically hold all new orders for 15 minutes before processing.

    new readytheme is almost ready: Colossus. This theme has a new mega menu and appears to be based on a lot of graphic tiles to help people find what they want to buy.

    The old and very expensive Quotes module has been updated to Quote 2 and is free. It integrates nicely with miva merchant (because it's made by Miva devs).

    They are going to add Customer Loyalty points that can be used for purchases and other things.

    Staging! This is in 10.0 which should be out before the end of the year. We will be able to stage new pages and entire sites right within the miva merchant admin, and this includes version control so multiple developers can be working on a page or theme without messing each other up. Very very cool. This is a game changer.

    Day 2

    Order Workflows are a dream come true for admins who need to do js integrations to push data to metric, analytics, management and other outside sources. For the most part, integration modules are unnecessary at this point. Workflow conditions are being added all the time, such as "send an email", and if we need one all we do is ask Miva because they are looking for ideas for more trigger conditions.

    The JSON Api is another dream come true when it comes to pushing and pulling data. With the json api and workflow trigger/condition/action situation 95% of all integration modules are obsolete with the work being done within the admin.

    Wait until true checks the workflow condition on a time interval/delayed situation. You can set it for 1 minute, five minutes, whatever you like up to 60 minutes. This is useful for workflow conditions that might take a few minutes such as receiving confirmation data from shipping or supplier data. It's probably useful to have "wait enabled" for all workflows, just set it to five minutes to make sure everything has finished grinding away before sending the data.

    Json API Payment API's

    This looks pretty interesting and gives us another way to integrate with more payment solutions.

    All of this is just whiteboard material right now and there will probably be changes before anything is rolled out.

    Version 10 Upgrade Tip

    Do Not Upgrade for at least a month after the new version rolls out sometime around 2020. Seriously. Version 10 is a huge mega update on all levels and being on the bleeding edge is a great way to crash your store. Miva has said everything will be smooth, but I wouldn't bet my business on it! Be patient, wait for a few weeks, and then update.

    ]]>
    <![CDATA[How to Use Lintalist with Miva Merchant]]> http://www.scotsscripts.com/blog/How-to-Use-Lintalist-with-Miva-Merchant.html The Miva Merchant template language is super powerful and lets you do complex coding within page templates. Using Lintalist will speed this process up dramatically.]]> Mon, 25 Feb 2019 12:26:04 GMT http://www.scotsscripts.com/blog/How-to-Use-Lintalist-with-Miva-Merchant.html Scot's Miva Scripts News and Updates I just stumbled across a system where a hot key brings up code snippets that can be used while editing miva store page templates. 

    For example, if I want an mvt:if statement, all I do is click the hotkey (caps-lock in my case), type mvt:if, hit return, enter the expression, and presto, the code is inserted at cursor position. I've been using it for two days and it's already saved loads of time.

    info: https://github.com/lintalist/lintalist

    direct download link: https://github.com/lintalist/lintalist/releases/download/v1.9.8/lintalist.zip

    I made a "bundle" file for the Miva Template Language here:

    https://www.scotsscripts.com/updates/lintalist/MivaMerchant.txt

    Quick Start

    1.
    Unzip the lintalist.zip file into wherever you put your small utilities files. There is no installation, just unzip to wherever you want to run it from.

    2. Copy the MivaMerchant.txt file into the lintalist/bundles directory.

    3. Make sure lintalist is running then start editing a store page and click the caps-lock key. Click on the bundle menu item and make sure Miva Merchant is selected.

    4. Type mvt:assign in the lintalist search bar and then hit enter, then fill out the name and value just like you would normally:

    5. Once you hit OK on the value box, the mvt:assign code should be where your cursor was on the page. 

    This is a super time saver. No more minor syntax errors or tired finger errors, all the hard work is done.

    ]]>
    <![CDATA[How to Preview Customer and Other Miva Merchant Emails]]> http://www.scotsscripts.com/blog/How-to-Preview-Customer-and-Other-Miva-Merchant-Emails.html We'll get this out of the way. Here's where you can get the free module to preview your Miva Merchant emails:

    http://www.scotsscripts.com/blog/How-to-Preview-Customer-and-Other-Miva-Merchant-Emails.html Scot's Miva Scripts News and Updates We'll get this out of the way. Here's where you can get the free module to preview your Miva Merchant emails:

    https://www.scotsscripts.com/preview-miva-merchant-email-templates.html

    This is a Miva Merchant module that makes it super easy to preview Miva Merchant email templates. Install the module, enter the license (free), and then edit one of the email templates. Once you are there click the ITEMS tab and assign emailpreview to the page. Once you've done that a new tab will appear where you can preview the template.

    One of the cool things about this module is that if you are previewing a template that contains data, such as an order confirmation email template, it will populate it with order data, and you can even tell it which order to populate the preview with.

    There are two other ways to preview your emails. One is to place a test order. The other is to go to:

    MENU ORDER PROCESSING

    Once you are there, click on an order to select it, then click on the icon to open the details.

    On the order details screen there will be a series of links under the order number and date of the order. Click on the Order Emails link to send various emails relating to the order.

    When you click that, a popup will appear where you can select which emails to send. Under the selection are some fields where you can override the order email information.

    IMPORTANT: Be sure to enter your email address in the "Override To:" field so the email is sent to you and not the customer.

    ]]>
    <![CDATA[The Five Steps to Making a Website]]> http://www.scotsscripts.com/blog/the-five-steps-to-making-a-website.html Anyone can put up a website, and it doesn't have to be a cookie cutter site from places like Wix or Squarespace, either. Here are five simple steps to get you rolling with a great new website. Thu, 1 Nov 2018 02:00:00 GMT http://www.scotsscripts.com/blog/the-five-steps-to-making-a-website.html Scot's Miva Scripts News and Updates We'll get right to it. You want to put up a website. Maybe it's your first one, maybe it's not, but either way, you have to start somewhere and finish up with something you're proud of.

    [ put in graphic flow chart with questions et al ]

    Step 1: Decide on website purpose.

    If you're here, you probably already know what you want a website for. Are you going to blog? Are you selling stuff? Is it an information site? News?

    Step 2: Get a domain

    Your domain is your web address, it's where people go to find you, such as scotsscripts.com. If your site is going to be an online store, make sure your domain reflects that (if possible) because it will  help with SEO.

    Buying a domain is not difficult but it can be confusing and frustrating at times. Here are some steps to help make buying a domain easier.

    1. Write down at least five domain names that you might want to use. Make them as short as possible.
    2. Go to a reputable domain registrar - I highly recommend GoDaddy (I've been using them since they opened) - to register your domain.
    3. Do Not check domain names GoDaddy or any domain registrar until you are ready to buy. This is important. Why? If you find a cool domain that is available and do not buy it, sometimes it won't be available the next day. Or the next hour.  Or even in ten minutes.  There is some evidence that domain registrars use domain searches to hoard the domains people are searching for. If you are ready to buy and want to check a bunch of domains, add all available domains to your cart and then when you are satisfied get rid of the ones you don't want. 
    4. It's OK to use .co domains and other "different" TLDs (Top Level Domains such as .com, .net, .org, .co, etc...) because search engines pick these up the same as .com domains. Maybe you want a site that talks about good news and goodnewstoday.com is taken, but goodnewstoday.info is available. There is one caveat: it's not good web form, and sometimes not legal, to use a domain name that is already running a website, even if you have a different TLD (.co, .info, etc.) So make sure you check the browser to see if a website is active on the domain your'e thinking of.
    5. Turn on "auto-renew" when you set up your domain. There is nothing more frustrating in the web world than losing your domain because it did not auto-renew and someone else bought it before you figure out what's going on. This happened to me on LearnJazzPiano.com a long time ago, but luckily the person who bought just happened to see it was available and gave it back. That's when I switched to GoDaddy because these problems don't happen with a good domain registrar.

    Step 3: Get domain hosting

    If you're not clear on what domain hosting is, think about it like this:

    A domain host is like an apartment building and the domain is like a person renting an apartment. 

    Once that happens, your domain has it's own address and is ready for web pages.

    For non-eCommerce sites, I highly recommend Green Geeks for hosting because they are inexpensive, offer virtually every website feature a person could want, they have great real-time support and power their servers using renewable energy.

    To set your site up, go with the most proven CMS (content management system) there is: Wordpress. 

    Wordpress is supported by a huge community of programmers, is regularly updated, and gives you unlimited customization options. Wordpress is also very good when it comes SEO (Search Engine Optimization) which in a nutshell is what will put you on the first page of search engine results if done right.

    For eCommerce sites I recommend a professional eCommerce solution such as Miva Merchant

    A good online store lets you spend more time on earning revenue and less time dealing with the store. 

    The problem with free eCommerce websites is that they are, well, free. Free is good for the pocketbook at first but probably not worth the hassle as your online business grows. If you're curious, here's a Miva Merchant review I wrote with more details.

    Step 4: Phase 1

    There are really only two phases to building the website of your dreams.

    Phase 1: Going live with the bare minimum in content and design. 

    • Front page: Description and purpose of website with contact information
    • About Us: A page with a more detailed description and purpose of the business.
    • Contact: A page with a contact form and/or physical address/phone.

    Phase 2: Working for the rest of your life on trying to get your website right. Doing everything else at your own pace. This includes slideshows, pop-up contact forms, podcasts, link trading, affiliate links, and other miscellaneous stuff that isn't necessary in the robot eyes of search engines.

    The important thing is to go live as fast as you can with content and design that you are "OK" with. Websites evolve and the biggest mistake people make is waiting too long to put their site up because they want everything "perfect." 

    Don't make the mistake of waiting so long for perfection that your website is obsolete before it goes live.

    Good luck and enjoy the ride!

    ]]>
    <![CDATA[How to Make Your Editor the Same Style as Your Blog Page]]> http://www.scotsscripts.com/blog/how-to-make-your-editor-the-same-style-as-your-blog-page.html There's a simple trick to making the posts in your editor reflect how they will look in your store. This way you don't have to preview the post so much.&nbsp; Go into the module and click on the blogs tab, open your Wed, 24 Oct 2018 20:18:00 GMT http://www.scotsscripts.com/blog/how-to-make-your-editor-the-same-style-as-your-blog-page.html Scot's Miva Scripts News and Updates There's a simple trick to making the posts in your editor reflect how they will look in your store. This way you don't have to preview the post so much. 

    Go into the module and click on the blogs tab, open your blog, then open Content Extras.

    In the last section, <i>Insert the following into the Redactor JS call:</i>, add the following line:

    overrideStyles: false, 

    This will override the stock editor styles and use your store styles. It might not be 100% perfect but it will look quite close to what you'll see when you view the post in your blog.

    ]]>
    <![CDATA[Miva Merchant SEO Above the Fold]]> http://www.scotsscripts.com/blog/miva-merchant-seo-above-the-fold.html What does the term " />Good Miva Merchant SEO means doing some adjustments to your basic ReadyTheme. If you're using stock Shadows ReadyTheme, here's a small tweak that will mean a lot to your customers and for your SEO.]]> Fri, 21 Sep 2018 21:13:00 GMT http://www.scotsscripts.com/blog/miva-merchant-seo-above-the-fold.html Scot's Miva Scripts News and Updates What does the term "above the fold" mean? On a website it refers to what you first see when you visit a web page, before you scroll down to see more.

    For eCommerce sites it's important to have some kind of product description above the fold because it gives customers a quick summary of what the product is about without having to do anything, and it gives search engines content near the top of the screen. Sometimes search engines rank content near the top of the screen higher than content at the bottom of the screen. The summary is also a great place to stuff some SEO key search terms and phrases.

    Unfortunately a lot of Miva Merchant store ReadyThemes are not set up this way and stores are losing opportunities to get more SEO traktion and conversions.

    It's quite easy to do, though, follow these steps and you'll be done in less than five minutes. 

    Make a Custom Field

    Create a custom field by clicking on the UTILITIES menu item and then clicking on the CUSTOM FIELDS tab. Click on the box at the right hand side of the navbar to open up the custom fields dialog box.

    Miva Merchant SEO Above the Fold Create a Custom Field for Product Summary

    Click the ADD box to save the custom field.

    Edit a Product

    Add the new custom field and then find a product to edit in your store, click on the CUSTOM FIELDS tab, and enter a short description in space next to your new summary custom field.

    Edit the Product Display Page (PROD)

    Edit the product display page by clicking on the USER INTERFACE option in the menu and then find the Product Display Page (PROD). 

    Find the top of your product display and then put the following code in it. This code will display the summary custom field if it exists. That way there isn't a blank line.

    <mvt:if expr="NOT ISNULL l.settings:product:customfield_values:customfields:summary">
    <p>&mvt:product:customfield_values:customfields:summary;</p>
    </mvt:if>

    In the newer Miva Merchant ReadyThemes such as Shadows, you can put the code right above the product header and it will show up beautifully. Like this:

    <mvt:if expr="NOT ISNULL l.settings:product:customfield_values:customfields:summary">
    <p>&mvt:product:customfield_values:customfields:summary;</p>
    </mvt:if>
    <mvt:item name="prod_ctgy_hdft" param="prod_header"></mvt:item>

    Here is a before and after shot of the product page on a site that I added a product summary field to. The site is called Invincible Music. If you're into meditative music, mantras, celtic, and those kinds of styles, check it out.

    Before

    Here's a product page before on stock Miva Merchant Shadows ReadyTheme. Notice that there is nothing above the fold, the initial display, for search engines or customers apart from the breadcrumbs, and those aren't going to help you put in search terms and phrases.

    Miva Merchant SEO Above the Fold Problem - Scot's Scripts

    After

    Here's what the product page looks like after the summary. Not much difference, but it means a lot to your customers and for SEO to have a short product summary where they can see it without doing anything like scrolling.

    Miva Merchant SEO Above the Fold Fixed - Scot's Scripts
    ]]>
    <![CDATA[Miva Merchant SSL Connection Error]]> http://www.scotsscripts.com/blog/miva-merchant-ssl-connection-error.html http://www.scotsscripts.com/blog/miva-merchant-ssl-connection-error.html Scot's Miva Scripts News and Updates Miva Merchant is the most solid eCommerce platform out there, and like any complex system, it needs to be kept up to date.

    Miva Merchant has three levels of technology that need to be kept up to date.

    Level 1 - Miva Merchant Updates

    There's a popup box and an update button that unambiguously lets you know when it's time to update Miva Merchant. It's a hands off routine. You click the buttons and Miva Merchant updates itself. Updating the Miva Merchant software is your choice but usually the updates include enhancements, bug fixes, stability fixes, and other updates that enhance the administrative and customer experience.


    Level 2 - Miva Empressa Updates

    Miva Empressa is the engine behind your website that runs miva script files, the files that make the Miva Merchant software. Store owners are not expected to update Miva Empressa on their own. It's a complicated process that happens behind the scenes by your web host.

    Out of Date Miva Empressa Will Cause SSL Errors

    If your site is not running the latest Miva Empressa (3.32 at this time) then you will most likely experience SSL errors. It could happen when you're logging into the admin, it can also happen in modules that are doing license look ups which will give you errors like this:

     Runtime error in mm5/5.00/modules/util/amp.mvc @ [0000005b:0000007e]:
    Y:webmm55.00modulesutil_license.mv: Line 243: MvCALL: Unable to open URL 'https://www.scotsscripts.com/license/': Error establishing SSL connection: certificate verify failed

    The important part is Error establishing SSL connection: certificate verify failed

    This tells us that either the remote site has a bad secure certificate or that your site can not communicate with the most up to date secure certificates. 

    How To Debug and Fix Miva Merchant SSL Errors

    The first thing to do is check the version of Miva Empressa that you are running by clicking the "home" link in you Miva Merchant admin.  You'll see a small box in the right sidebar that will tell you what version of Miva Empressa you're using. 

    If your site is running a version of Miva Empressa that is less than 3.32, contact your host immediately and ask them to update Miva Empressa on your site to the latest version.

    In the image below, the Miva Merchant SSL problems were caused by an old version of Miva Empressa (5.24) and once the host updated to 5.32 the errors went away.


    Level Three - Module Updates

    There are times that older modules must be updated to stay current with the technology Miva Merchant is using. If your site is completely up to date and a Miva Merchant module is still giving you SSL error, or any other strange errors, then you must contact the module developer and give them a bug report. Some developers will deal with the problem quickly (like us!) and others will completely ignore you (like some I probably shouldn't name.) If you can't get a response from your module developer, let us know and we'll see what we can do to help.

    ]]>