View miva-nested-category-uri-301-redirects.xml
<mvt:comment>
## About
Given a store with a category/sub-category structure like this:
- appliances
- kitchen
- refrigerators
View npx-gist-test.js
'Hello World!'.split('').forEach(letter => console.log(letter));
View miva-load-custom-fields-with-mvt-do--examples.xml
<!-- Example #1: Load an order custom field and change the subject -->
<mvt:do file="g.Module_Root $ '/modules/util/customfld.mvc'" name="l.success" value="OrderFieldValue_Load_CodeAndOrder( 'phone_order', l.settings:order:id, l.customfield:field, l.customfield:value )" />
<mvt:if expr="l.customfield:value">
Your &mvt:store:name; Phone Order
<mvt:else>
Your &mvt:store:name; Online Order
</mvt:if>
<!-- Example #2: Load Business Account for different Order Confirmation Email-To -->
View miva-sort-and-update-attribute-option-display-order.xml
<mvt:do file="g.Module_Library_DB" name="l.success" value="Product_Load_Code( g.Product_Code, l.settings:product )" />
<mvt:do file="g.Module_Library_DB" name="l.success" value="AttributeList_Load_Product( l.settings:product:id, l.settings:product:attributes )" />
<mvt:foreach iterator="attribute" array="product:attributes">
<mvt:do file="g.Module_Library_DB" name="l.success" value="OptionList_Load_Attribute( l.settings:attribute:id, l.settings:attribute:options )" />
<mvt:comment>
Only Sort Length Attributes
</mvt:comment>
<mvt:if expr="l.settings:attribute:code NE 'length'">
View miva-preload-attribute-options-from-variant-part-product-code.xml
<mvt:if expr="g.Variant_Product_Code">
<mvt:comment>
Pass the Variant Part Product Code, and Load the Attributes & Options for it
/store/variant-attributes.html?Variant_Product_Code=shirt_small_red
</mvt:comment>
<mvt:do file="g.Module_Library_DB" name="l.success" value="Product_Load_Code( g.Variant_Product_Code, l.settings:variant_product )" />
<mvt:do file="g.Module_Library_DB" name="l.success" value="ProductVariantPartList_Load_Part( l.settings:variant_product:id, l.settings:variant_product:parts )" />
<mvt:foreach iterator="part" array="variant_product:parts">
<mvt:do file="g.Module_Library_DB" name="l.success" value="Product_Load_ID( l.settings:part:product_id, l.settings:part:master_product )" />
<mvt:assign name="l.settings:variant_product:adpr_data:product_code" value="l.settings:part:master_product:code" />
View miva-load-variants-attributes-and-options.xml
<mvt:if expr="g.Product_Code AND g.Variant_ID">
<mvt:comment>
Pass in a Product_Code and a Variant_ID to load that variant's attribute & option data
Example
/store/variant-attributes.html?Product_Code=shirt&Variant_ID=29522
</mvt:comment>
<mvt:do file="g.Module_Library_DB" name="l.success" value="Product_Load_Code( g.Product_Code, l.settings:product )" />
<mvt:assign name="l.settings:product:variant_id" value="g.Variant_ID" />
<mvt:do file="g.Module_Library_DB" name="l.success" value="ProductVariantList_Load_Variant( l.settings:product:id, g.variant_id, l.settings:product:variants )" />
<mvt:foreach iterator="variant" array="product:variants">
View miva-levels-menu-aim-for-tablet-alternative.js
(function Mega_Menu(){
var init = function(){
var is_mobile = $('html').hasClass('mobile');
if( is_mobile ){
$('.nav-item-2').on('click', function(e){
var item = this,
$group = get_$group_from_item(item);
if( $group.is(':visible') ){
View miva-load-product-meta-values.xml
<mvt:do file="g.Module_Library_DB" name="l.success" value="Product_Load_Code( 'miva-test_master-product', l.settings:product )" />
<mvt:do file="g.Module_Root $ '/modules/component/cmp-mv-prodctgy-meta.mvc'" name="l.success" value="METAValueList_Load_Product(l.settings:product:id, l.settings:product:meta_items)" />
<mvt:foreach iterator="meta_item" array="product:meta_items">
<mvt:if expr="l.settings:meta_item:name EQ 'keywords'">
<mvt:assign name="l.settings:product:meta_keywords" value="l.settings:meta_item:value" />
<mvt:elseif expr="l.settings:meta_item:name EQ 'description'">
<mvt:assign name="l.settings:product:meta_description" value="l.settings:meta_item:value" />
</mvt:if>
</mvt:foreach>
View Miva-AttributeMachine-on-OUSM.md

Add AttributeMachine functionality to OUSM

OUSM does not have the same ability to show/hide variants & out-of-stock products in the same way that the PROD page does. PROD is able to do it by leveraging AttributeMachine, and AttributeMachine requires certain <form/> elements & names in that don't exist on OUSM.

We can use the upsell-data on OUSM to output ADPR-style forms, add AttributeMachine to them, and then on submit/continue we can use JavaScript re-map the PROD/ADPR form-data to the OUSM/AUPM form-data's requirements.

Assign these extra items to OUSM:

Attribute Machine (code: attributemachine)
View PROD--variables-mvt.xml
<mvt:if expr="g.variant_id LE 0">
<mvt:assign name="g.variant_id" value="0" />
</mvt:if>
<script>
var variant_id = &mvtj:global:variant_id;;
var product_code = '&mvtj:product:code;';
</script>