MivaLearn

Public Snippets 209

Custom CTGY PageBuilder Header

Custom code added to the CTGY template to render a page with the same value as the current category custom field of `pagebuilder_code` and use that page via page builder for specific category landing pages/layouts.
<div class="o-layout__item">
<mvt:comment>
|
|	Ability to have a page with the same value as the current category custom field of `pagebuilder_code`
|	and use that page via page builder for specific category 
|	landing pages/layouts.
|
</mvt:comment>
<mvt:item name="customfields" param="Read_Category_Code( g.Category_Code, 'pagebuilder_code', l.settings:category:customfield_values:customfields:pagebuilder_code )" />
<mvt:do file="g.Module_Feature_TUI_DB" name="l.settings:Page_Load_CodeO

Page Builder Category Header

A custom layout within the Miva admin under User Interface > Templates > Layouts. This layout includes custom template code that supports adding PageBuilder Flex Components. Be sure to assign the `flex` and `sequence` items and any other items needed for the Global Header and Footer.
<mvt:assign name="l.settings:ui:global_header:omit_page_title" value="1" />

<mvt:if expr="g.Function EQ 'PageBuilderPage_Preview'">
<mvt:item name="html_profile" />
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<base href="&mvte:global:basehref;"/>
	<mvt:if expr="NOT ISNULL l.settings:page:title">
		<title>&mvt:page:title;</title>
	<mvt:else>
		<title>&mvt:store:name;: &mvt:page:name;</title>
	</mvt:if>
	<mvt:item name="head" 

precision-pricing-weight-api

{ 
    "success": 1, 
    "data": [ 
        { 
            "order_id": 8837362, 
            "line_id": 428, 
            "group_id": 428, 
            "parent_id": 0, 
            "status": 0, 
            "subscrp_id": 0, 
            "subterm_id": 0, 
            "shpmnt_id": 0, 
            "rma_id": 0, 
            "product_id": 1208, 
            "dt_instock": 0, 
            "code": "RFS01174", 
            "name": "\u002312 PROZ\u2122 SD T3 HI-LO THREADED HEX CAP ROOFING

Manage Quotes Link

<a href="&mvte:urls:QUOH:auto;">View Quote History</a>

Manage Quotes Item

<mvt:item name="request_quote" param="request_quote" />

Manage Quotes Mini Basket

<mvt:if expr="(l.settings:global_minibasket:active_quote EQ 1) AND (g.Basket:cust_id)">
	<a href="&mvte:urls:QUOH:auto;">View Your Active Quotes</a>
</mvt:if>

Manage Quotes LOGN

<mvt:if expr="NOT ISNULL g.QuoteCode">
	<mvt:assign name="l.settings:url" value="l.settings:urls:QUOT:secure" />
<mvt:elseif expr="g.Customer_Temporary_Password">
	<mvt:assign name="l.settings:url" value="l.settings:urls:CPWD:secure" />
<mvt:elseif expr="g.Order">
	<mvt:assign name="l.settings:url" value="l.settings:urls:OINF:secure" />
<mvt:else>
	<mvt:assign name="l.settings:url" value="l.settings:urls:ACLN:secure" />
</mvt:if>
<form method="post" action="&mvte:url;">
	<fieldset>
		

Manage Quotes Options Loop

<mvt:if expr="l.settings:option:attr_code EQ 'Part of Quote'">
	<mvt:assign name="l.settings:option:attr_prompt" value="l.settings:option:attr_code" />
	<mvt:assign name="g.quote_item" value="'1'" />
<mvt:else>
	<mvt:assign name="l.settings:option:attr_prompt" value="l.settings:option:attr_prompt" />
</mvt:if>

Global Footer Fragment

<mvt:if expr="ISNULL g.Session:shadows:checkout_hidden">
    <mvt:fragment code="global_footer" />
</mvt:if>

Global Header Fragment

<mvt:if expr="ISNULL g.Session:shadows:checkout_hidden">
    <mvt:fragment code="global_header" />
</mvt:if>

Affirm Configuration Version 10.10.00

<mvt:if expr="l.settings:page:code EQ 'BASK'">
	<mvt:item name="mvaffirm_aslowas" param="amount:basket:total" />
<mvt:elseif expr="NOT ISNULL l.settings:product:id">
	<mvt:item name="mvaffirm_aslowas" param="product:product" />
</mvt:if>

Affirm Configuration Version 10.09.02

<mvt:if expr="l.settings:page:code EQ 'BASK'">
	<mvt:item name="mvaffirm_aslowas" param="amount:basket:total" />
	<hr class="c-keyline">
</mvt:if>
<mvt:if expr="l.settings:page:code EQ 'CTGY'">
	<br>
	<hr class="c-keyline">
	<mvt:item name="mvaffirm_aslowas" param="product:product" />
</mvt:if>
<mvt:if expr="l.settings:page:code EQ 'PLST'">
	<br>
	<hr class="c-keyline">
	<mvt:item name="mvaffirm_aslowas" param="product:product" />
</mvt:if>
<mvt:if expr="l.settings:page:code EQ 'PR

10.09.02 Basket ID Update

<mvt:if expr="g.Basket:basket_id GT 0">
	<p class="u-color-gray-600"><span class="u-icon-cart-empty" aria-hidden="true"></span>Basket ID: &mvte:global:Basket:basket_id;</p>
</mvt:if>

MMT VS Code Snippets

MMT Snippets streamline the development process by providing quick access to commonly used commands and phrases within VS Code. These snippets are designed to enhance your efficiency and productivity when using MMT with VS Code. To use you will have to write the command in a file or VS code window, but then you can copy/paste the final command into the terminal.
{
	// Place your global snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
	// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
	// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
	// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
	// $1, $2 for tab stops, $0 for the final cursor position, and

Miva - Add & Remove Basket Charges

<mvt:if expr="g.Delete_Charge">
	<h2>Delete Charge</h2>
	<mvt:do file="g.Module_Library_DB" name="l.gone" value="BasketCharge_Delete_All_Type(g.Basket:basket_id, 'CUSTOM_CHARGE')" />
</mvt:if>


<mvt:if expr="g.Add_Charge">
	<mvt:assign name="l.basket_charge:basket_id" value="g.Basket:basket_id" />
	<mvt:assign name="l.basket_charge:module_id" value="0" />
	<mvt:assign name="l.basket_charge:type" value="'CUSTOM_CHARGE'" />
	<mvt:assign name="l.basket_charge:descrip" value="'Custom Char

Miva - Load Custom Field in URI Template

<mvt:do file="g.Module_Library_DB" name="l.loaded_module" value="Module_Load_Code_Cached( 'customfields', l.customfields_module )" />
<mvt:if expr="l.loaded_module">
	<mvt:do file="g.Module_Root $ l.customfields_module:module" name="l.settings:product:brand" value="Module_Product_Field_Value( l.customfields_module, l.settings:product:id, 'brand' )" />
</mvt:if>

<mvt:if expr="l.settings:product:brand">
	/product/&mvts:product:brand;/&mvts:product:name;.html
<mvt:else>
	/product/&mvts:pro