View miva-get-variant-info-on-variant-change.js
// Copied from @RubenMarin's implimentation
// Add to existing cornerstoneUX.sharedFunctions object...
cornerstoneUX.sharedFunctions.getVariantInfoOnChangegetVariantInfoOnChange = function(fn) {
if (AttributeMachine instanceof Object) { //we first check if AttributeMachine is available
MivaEvents.SubscribeToEvent('variant_changed', function(product_data) {
let self = this;
setTimeout(function() {
let variantId = product_data.variant_id;
View miva-PROD-Attribute-Machine-generate-discount-savings-percent.html
<script>
AttributeMachine.prototype.Generate_Discount = function( discount )
{
var discount_div;
var msrp = Number(document.getElementById('price-value-additional').innerHTML.replace(/[\$,]/, '')),
savings_percent = Math.round(discount.discount / msrp * 100),
savings_percent_formatted = savings_percent + '%';
// console.log('Generate_Discount', discount, msrp, savings_percent, savings_percent_formatted );
View controller.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Sandbox extends CI_Controller {
public function __construct()
{
parent::__construct();
}
public function table_form($table, $id)
View miva-ocst-login-ajax.html
<div id="js-ocst-login" class="row mfp-hide forgot-password">
<form method="post" action="&mvte:urls:_self:auto;" autocomplete="off" class="column whole js-ocst-login-form">
<input type="hidden" name="Action" value="LOGN" />
<input type="hidden" name="Store_Code" value="&mvte:global:Store_Code;" />
<h4 class="fields-heading">Account Login:</h4>
<div class="form-row">
<div class="floating-placeholder">
<input type="text" name="Customer_Login" value="&mvte:global:Customer_Login;" id="l-Customer_Login" autocomplete="off" class="input">
<label for="l-Customer_Login">Email Address</label>
</div>
View miva-9-7-productvariantlist_load_product.md

ProductVariantList_Load_Product

<mvt:do file="g.Module_Library_DB" name="l.settings:product:variant_count" value="ProductVariantList_Load_Product(l.settings:product:id, l.settings:product:variants)" />

Sample Data Structure

:active=1
View alternative-approach.js
ImageMachine.prototype.oninitialize = function (data) {
gallery.length = 0;
mainImageZoom.attr('data-index', 0);
thumbnailIndex = 0;
this.Initialize(data);
if (data) {
updateThumbs();
$('#js-thumbnails .thumbnail-wrap:not(.slick-cloned)').first().click();
}
}
View miva-field-validation.js
/*
/mm5/5.00/lib/util_public.mv
<MvFUNCTION NAME = "Phone_Validate" PARAMETERS = "phone, country" STANDARDOUTPUTLEVEL = "">
*/
function validate_phone(phone, country){
if( country === 'US' || country === 'DE' ){
phone = String(phone).replace(/[\+\/\(\)\-\x\.\s]/g, '');
if ( !/^\d+$/.test(phone) ) {
return false;
View miva-osel-create-account-iframe.xml
<mvt:if expr="g.CustomerCreate">
<iframe name="processCreate" id="js-process-create" class="all-hidden"></iframe>
<form action="&mvt:global:secure_sessionurl;" method="post" target="processCreate" id="js-create-account" class="all-hidden">
<input type="hidden" name="Store_Code" value="&mvte:global:Store_Code;" />
<input type="hidden" name="Action" value="ICST" />
<input type="hidden" name="Screen" value="ACED" />
<input type="hidden" name="PrevPage" value="INVC" />
<input type="hidden" name="Customer_LoginEmail" value="&mvte:global:Basket:ship_email;" />
<input type="password" name="Customer_Password" value="&mvte:global:CustomerCreate;" />
<input type="password" name="Customer_VerifyPassword" value="&mvte:global:CustomerCreate;" />
View miva-uri-management-templates.md

Page URIs

/<mvt:if expr="l.settings:page:code NE 'SFNT'"><mvt:if expr="NOT ISNULL l.settings:page:slugified_title"><mvt:eval expr="tolower( l.settings:page:slugified_title )" /><mvt:else><mvt:eval expr="tolower( l.settings:page:slugified_name )" /></mvt:if>.html</mvt:if>

Category URIs

/<mvt:if expr="NOT ISNULL l.settings:category:slugified_page_title"><mvt:eval expr="tolower( l.settings:category:slugified_page_title )" /><mvt:else><mvt:eval expr="tolower( l.settings:category:slugified_name )" /></mvt:if>.html
View sync-css-and-js-breakpoint-values--ress.js
RESS = {};
RESS.resize = function() {
var a;
return function() {
clearTimeout(a);
a = setTimeout(function() {
a = null;
RESS.storeSizes();
}, 250);
};