View miva-v9-emailsend-for-bcc.html
<mvt:assign name="l.settings:email:to" value="'to.someone@email.com'" />
<mvt:assign name="l.settings:email:from" value="'from.someone@email.com'" />
<mvt:assign name="l.settings:email:cc" value="'cc.someone@email.com'" />
<mvt:assign name="l.settings:email:bcc" value="'bcc.someone@email.com'" />
<mvt:assign name="l.settings:email:subject" value="'Example Subject'" />
<mvt:assign name="l.settings:email:headers" value="'Content-type: text/html; charset=utf-8'" />
<mvt:assign name="l.settings:email:content" value="'This is some sample email content'" />
<mvt:do file="g.Module_Library_Utilities" name="l.settings:email:result" value="V9_SendEmail(l.settings:email)" />
View manually-triggering-attributemachine-change.md

Manually Triggering Attribute Machine Change

Background

Changing the value of a product attribute (dropdown, radio, etc.) using JavaScript (ex: $('.dropdown').val('foo')) will not trigger the change event to fire Attribute Machine and load the new variant's information. Adding $('.dropdown').trigger('change') won't work either.

You need to use .dispatchEvent(new CustomEvent('change')) in order for Attribute maMachine to respond.

Implimentation

View jquery-get-script-cached.js
jQuery.getScriptCached = function( url, options ) {
// Allow user to set any option except for dataType, cache, and url
options = $.extend( options || {}, {
dataType: "script",
cache: true,
url: url
});
// Use $.ajax() since it is more flexible than $.getScript
View angular-firebase-bootstrap-crud-app-template.html
<!DOCTYPE html>
<html lang="en-US" ng-app="app" ng-controller="appCtrl" ng-cloak>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{title}}</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.6/css/bootstrap.min.css">
<style>
[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {
View _.debounce.js
// Returns a function, that, as long as it continues to be invoked, will not
// be triggered. The function will be called after it stops being called for
// N milliseconds. If `immediate` is passed, trigger the function on the
// leading edge, instead of the trailing.
var debounce = function(func, wait, immediate) {
var timeout;
return function() {
var context = this, args = arguments;
var later = function() {
timeout = null;
View miva-mvtdo-quick-sort-array-sort-by-two-properties.xml
<mvt:comment>
<!-- Sort Shipping Methods by Price then Name -->
</mvt:comment>
<mvt:assign name="l.comparisons[1]:subelement" value="':price'" />
<mvt:assign name="l.comparisons[1]:direction" value="1" />
<mvt:assign name="l.comparisons[2]:subelement" value="':name'" />
<mvt:assign name="l.comparisons[2]:direction" value="1" />
<mvt:do file="g.Module_Library_Utilities" name="l.success" value="QuickSortArray_Sort( l.settings:shippingmethods, 1, miva_array_elements( l.settings:shippingmethods ), l.comparisons, 2 )" />
View searchspring-prices.html
<mvt:comment>
<!--
g.Product_Codes is a comma separated list of product codes being sent as a query-string parameter
-->
</mvt:comment>
<mvt:assign name="l.settings:product_codes" value="miva_array_deserialize(g.Product_Codes)" />
<mvt:foreach iterator="code" array="product_codes">
<mvt:do name="l.result" file="g.Module_Library_DB" value="Product_Load_Code( l.settings:code, l.settings:product )" />
<mvt:do file="g.Module_Feature_TUI_UT" name="l.result" value="CommonComponentFields_Initialize_Product_Runtime( l.settings:product )" />
View miva-invc-create-account.md

Miva - INVC Create Account

Add a form to the INVC page to allow new customers to create an account by just providing a login & password. After the customer creates an account, there is some functionality to assign the customer to the order that they just placed too.

Screen shot of form on INVC page

Implimentation Steps:

  1. Create a ReadyTheme Content Section with a code of invc_create_account.
View miva-price-group.xml
<!--
~~~~~~~~~~~~~~~~
XML Template:
Change the values in the curly brackets
~~~~~~~~~~~~~~~~
-->
<PriceGroupProduct_Assign group_name="{{ Price Group Name }}" product_code="{{ Product Code }}" />
<PriceGroupQualifyingProduct_Assign group_name="{{ Price Group Name }}" product_code="{{ Product Code }}" />
<Module code="discount_saleprice" feature="discount">
View html-canvas-file-upload-local-storage.html
<!-- http://tech.pro/tutorial/1383/javascript-one-language-to-rule-them-all -->
<style>
[for=blue] { color: blue; }
[for=green] { color: green; }
[for=red] { color: red; }
</style>
<input id="uploadImage" type="file" name="photo" />
<input id="caption" type="text" name="caption" placeholder="caption" />
<label for="blue">Blue</label>