View miva-mvt-do-scheduled-task-update.xml
<mvt:assign name="g.xml" value="'
<Provision>
<Store code=\"' $ g.Store_Code $ '\">
<ScheduledTask_Update task=\"TASK NAME\">
<Description>TASK NAME</Description>
<Enabled>true</Enabled>
<NextRun>
<Year>' $ s.dyn_tm_year $ '</Year>
<Month>' $ s.dyn_tm_mon $ '</Month>
<Day>' $ s.dyn_tm_mday $ '</Day>
View ad-blocked-mvga-overrides.js
if( typeof ga === 'undefined' || typeof ga.create === 'undefined' ){
MVGA_Tracker.prototype.List_AddToBasketSubmit = function(e){};
MVGA_Tracker.prototype.RemoveFromBasketForms = function(e){};
MVGA_Tracker.prototype.UpdateBasketQuantity = function(e){};
MVGA_Tracker.prototype.UpsellOUS1FormSubmit = function(e){};
MVGA_Tracker.prototype.UpsellFormSubmit = function(e){};
MVGA_Tracker.prototype.OSELFormSubmit = function(e){};
MVGA_Tracker.prototype.AddToBasketSubmit = function(e){};
MVGA_Tracker.prototype.ProductLinkClick = function(e){};
MVGA_Tracker.prototype.RemoveFromBasketLinks = function(e){};
View miva-logging-into-yyyy-mm-dd-folders.xml
<mvt:comment>
| ---------------------------------------------
| LOGGING
| ---------------------------------------------
</mvt:comment>
<mvt:comment>
| Create Log Folders based on date: /YYYY/MM/DD/
</mvt:comment>
<mvt:assign name="l.settings:log:folder_path:base" value="'/logs/'" />
View ansi2html.sh
#!/bin/sh
# SOURCE: http://www.pixelbeat.org/scripts/ansi2html.sh
# Convert ANSI (terminal) colours and attributes to HTML
# Licence: LGPLv2
# Author:
# http://www.pixelbeat.org/docs/terminal_colours/
# Examples:
View template-engine.js
// http://mir.aculo.us/2011/03/09/little-helpers-a-tweet-sized-javascript-templating-engine/
function t(s,d){
for(var p in d)
s=s.replace(new RegExp('{'+p+'}','g'), d[p]);
return s;
}
t("Hello {who}! It's {time} ms since epoch.", { who: "JavaScript", time: Date.now });
// "Hello JavaScript! It's 1299680443046 ms since epoch."
View miva-module-basic-crud.xml
<MvFUNCTION NAME = "CRUD_Example_Read" PARAMETERS = "example var" STANDARDOUTPUTLEVEL = "">
<MvASSIGN NAME = "l.example:id" VALUE = "{ CRUD_Examples.d.id }">
<MvASSIGN NAME = "l.example:foo" VALUE = "{ CRUD_Examples.d.foo }">
<MvASSIGN NAME = "l.example:bar" VALUE = "{ CRUD_Examples.d.bar }">
<MvASSIGN NAME = "l.example:baz" VALUE = "{ CRUD_Examples.d.baz }">
</MvFUNCTION>
<MvFUNCTION NAME = "CRUD_Example_Load" PARAMETERS = "id, example var" STANDARDOUTPUTLEVEL = "">
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>