24/7 Support: 800.608.6482

Videos

Developer Videos

Videos | Using Miva’s Tokenlist Feature

ver. 9.0 and later

Video Transcript

So today we’re going to talk about Tokenlist. I’ve hinted about Tokenlist in a few videos. Tokenlist is a built-in Miva Merchant tool which will show you all the variables which are available on each page. It’s incredibly powerful and a great resource when you’re developing Miva Merchant stores. Let’s dive in and see how it works. So here, I’m at the Miva Merchant Admin and Tokenlist first needs to be turned on in the store. In order to that you can come here to Menu, scroll down to Utilities, or if I wanted to use the search I could just search for Utilities and come down here to Utility Settings and then I want to come to Add/Remove Modules. So this screen will show me all of the available modules I have that I can assign. If I come down below it will show me modules that are currently installed. So here you’ll see the Tokenlist module. It gives you a short description of what it does and we’re going to come down and click Install. Now if I scroll back down, I see up here it was installed and now I see under installed modules it’s now in this list. Let’s see how to use it.

So Tokenlist attaches itself to every page of the Miva Merchant store. I’m going to go to Storefront and on this storefront page you’ll see this “More” link here. When you click this More link Tokenlist is now an option. So when I click it it brings up this modal window. This has three columns, one for variable, entity and value. If you look it has l.settings which we’ve seen, l.settings:page, what this is showing us is all of the available variables on the storefront page. Now, I come up here to Visible Variables and there’s three different types; Local, Global and System. Now these are three variables types available to Miva Merchant. So what Tokenlist allows you to do is view one or all of these variables.

Tokenlist has great search functionality. Say I wanted to find a specific variable g.domain, Tokenlist will automatically filter the results in real time to show you all the variables that start with g.domain. So what we’re looking at here is the global domain structure. Now if you remember in the previous videos when we were talking about structures there were a couple code based ways to visualize a structure. Well, this is a third way to visualize a structure. It’s actually much easier than using code examples because everything’s available right here at your fingertips. So if I wanted to see what variables available within the main structure I can search for g.domain here and scroll through this and see a nice list of every available variable within that g.domain structure. Not only did it show me the variable of g.domain, but it also shows me the entity which is the syntax I would use to output it to the page and then it also shows me the value of these variables which is very important. So i can easily see what the value of these variables are on the current page which is the storefront page. Because tokenlist gives you access to all the variables in the page, you can use it to see global, local and system variables.

Let’s take a look at the system variables that are available. So here we can either search for s. Which all system variables start with and it will jump to them, or up in this list we can turn off Local and Global variables and just view System. So here this will show you all the System variables that are available within this page. There’s actually quite a few. The ones we were looking at previously were the referer and s.remote_addr, which is the ip address of the user.

So let’s take a look at some of the other features of Tokenlist. I’m going to close this and I’m going to go to the product page and I’m going to pull up Tokenlist. You’ll see here on the Product page, there’s actually two new fields. One for product code and one for category code. What these do is allow you to load in a particular product or load in a particular category and based off that information all the variables and tokenlist will change depending on the product or category that you chose to load in. So if I search for product: it will give me all of the information about that particular product; the name, the price, the image, the description and this is all the same data that would be available if I was viewing the product on the front end.

One other really nice feature of Tokenlist is that it gives you a visual representation of where the tokens are on the page, where these variables are being used. That’s done by this “View All Tokens” button. So when I click it, it’s going to open up a whole new window that will show the front end of the web site, however, I can hover over certain things and it will show me what variables are actually being used. So here we have the product code, the product formatted price, product weight, product description, so this is a great visual way to see what variables are used on the page and where they are placed.

One last great feature of Tokenlist that you’ll use quite a bit is the ability to preview the invoice page. Now, why would you need to do that? Well, as a developer if you’re making customizations or changes to invoice page the only way to do it on the front end is to actually add a product to your cart and place and order. Tokenlist gives you a great easy way to view the invoice page without having to go through the process of having to add a product to your cart and go through the whole checkout process. Let’s take a look at how that’s done. So I’m going to close this and come back up to search and I’ll go to invoice. Now on the invoice page I’m going to pull up Tokenlist and you’ll see the invoice doesn't have product or category up here, instead it has an order number. So you can load a particular order number and have and it would populate all the variables for that order. So here I have order number 1000 and it has all the information, so if I go to order: it’s going to give me the order id, the order date, the order time and all the information about that order, which is awesome. However, to be able to preview the invoice page I can use this View All Tokens button again, it will load the invoice page, with all the order information, so this is exactly what the customer saw. This is a great tool for testing. This allows you to view tracking scripts, like javascript, that you can view the source and see what tracking script is output. You can make sure the formatting of this page is correct in terms of the style, the html, the css to make sure there’s no issues. Or just text new functionality that you’ve implemented on the invoice page. This is a great powerful feature of Tokenlist and you’ll use it quite a bit.

Tokenlist is a fantastic developer tool and once you start using it it will become a go to resource for troubleshooting, testing and identifying variables on a page.






Looking for Developer Docs?

We have a whole section for that, including: Developer Training Series, Template Language docs, Module Development tutorials and much, much more.

Head to the Developer Section

This website uses cookies to identify visitors, track visitors to our website, store login session information and to remember your user preferences. By continuing to use this site you agree to our use of cookies. Learn More.

This website uses cookies. By continuing to use this site you agree to our use of cookies. Learn More.

Accept

Copyright © 1997 – 2024 Miva®, Miva Merchant®, MivaPay®, MivaCon®, Camp Miva®, Miva Connect®, Miva, Inc. All Rights Reserved.