Skip to content

Instantly share code, notes, and snippets.

@tessguefen
tessguefen / 1_OCST.xml
Last active February 23, 2018 19:50
Customfields at Checkout
<mvt:comment>
If OCST was submitted, but the customer got errors, Write to the basket to save their data. Only add this is the custom order fields are displayed on OCST.
</mvt:comment>
<mvt:if expr="'ORDR' CIN g.Action">
<mvt:item name="customfields" param="Write_Basket( 'custom_order_fields', g.custom_order_fields )" />
</mvt:if>
<mvt:item name="customfields" param="Read_Basket( 'custom_order_fields', g.custom_order_fields )" />
<mvt:comment>
@tessguefen
tessguefen / export_images.xml
Created February 16, 2018 16:57
Export all Images whether they have a type or not.
<mvt:do file="g.Module_Library_DB" name="l.success" value="ProductList_Load_All( l.settings:products )" />
<table>
<tr>
<td>Product Code</td>
<td>Product Name</td>
<mvt:do file="g.Module_Library_DB" name="l.success" value="ImageTypeList_Load_All( l.settings:imagetypes )" />
<mvt:foreach iterator="type" array="imagetypes">
<td>&mvte:type:code;</td>
</mvt:foreach>
</tr>
@tessguefen
tessguefen / export_images.xml
Created February 16, 2018 16:57
Export all Images whether they have a type or not.
<mvt:do file="g.Module_Library_DB" name="l.success" value="ProductList_Load_All( l.settings:products )" />
<table>
<tr>
<td>Product Code</td>
<td>Product Name</td>
<mvt:do file="g.Module_Library_DB" name="l.success" value="ImageTypeList_Load_All( l.settings:imagetypes )" />
<mvt:foreach iterator="type" array="imagetypes">
<td>&mvte:type:code;</td>
</mvt:foreach>
</tr>

Keybase proof

I hereby claim:

  • I am tessguefen on github.
  • I am tessset (https://keybase.io/tessset) on keybase.
  • I have a public key ASC2wDFZObQz7yOUuXwNl-u4hNOae7fc0jt8UR57xe2HPwo

To claim this, I am signing this object:

@tessguefen
tessguefen / console.js
Created October 19, 2017 15:31
Searchspring console
SearchSpring.Catalog.elems.container.scope();
@tessguefen
tessguefen / critical_css.xml
Created October 17, 2017 22:14
Add critical css files to /critical_css/
<mvt:if expr="g.request_cookies:critical_css NE 1 AND g.Screen CIN '|SFNT|CTGY|PLST|PROD|'">
<script>!function(a){"use strict";var b=function(b,c,d){function j(a){return e.body?a():void setTimeout(function(){j(a)})}function l(){f.addEventListener&&f.removeEventListener("load",l),f.media=d||"all"}var g,e=a.document,f=e.createElement("link");if(c)g=c;else{var h=(e.body||e.getElementsByTagName("head")[0]).childNodes;g=h[h.length-1]}var i=e.styleSheets;f.rel="stylesheet",f.href=b,f.media="only x",j(function(){g.parentNode.insertBefore(f,c?g:g.nextSibling)});var k=function(a){for(var b=f.href,c=i.length;c--;)if(i[c].href===b)return a();setTimeout(function(){k(a)})};return f.addEventListener&&f.addEventListener("load",l),f.onloadcssdefined=k,k(l),f};"undefined"!=typeof exports?exports.loadCSS=b:a.loadCSS=b}("undefined"!=typeof global?global:this);
</script>
<noscript><link href="&mvt:global:theme_path;/css/all.min.css" rel="stylesheet" type="text/css" defer="defer"></noscript>
<mvt:if expr="g.Screen EQ 'SFNT'">
@tessguefen
tessguefen / mvtdo-upcharge.html
Created October 2, 2017 23:13
Miva mvt:do custom upcharge template
<mvt:comment>
|
|
| Efficient mvt:do custom upcharges - function similar to toolkit upcharges
| assign the 4 below variables and drop in anywhere above basket charge loop
|
|
</mvt:comment>
<mvt:assign name="g.customCharge:value" value="28" />
<mvt:assign name="g.customCharge:type" value="'CustomUpcharge'" />
@tessguefen
tessguefen / .htaccess
Created October 2, 2017 20:29
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@tessguefen
tessguefen / variant_id.xml
Last active April 21, 2017 15:01
?variant_id = in marketing feeds (variant:id is not the variant_id, it is the variant product's ID)
<mvt:if expr="NOT l.settings:record:variant:variant_id">
<mvt:do name="l.settings:record:variant:product_part_count" file="g.Module_Library_DB" value="ProductVariantPartList_Load_Part(l.settings:record:variant:id, l.settings:record:variant:productvariantparts)" />
<mvt:if expr="miva_array_elements( l.settings:record:variant:productvariantparts ) GT 0">
<mvt:foreach iterator="pvp" array="record:variant:productvariantparts">
<mvt:if expr="l.settings:pvp:product_id EQ l.settings:record:id">
<mvt:assign name="l.settings:record:variant:variant_id" value="l.settings:pvp:variant_id" />
<mvt:foreachstop />
</mvt:if>
</mvt:foreach>
</mvt:if>
@tessguefen
tessguefen / chargelist.xml
Created March 14, 2017 15:37
Update Basket Charge List
<mvt:assign name="l.settings:basket:charges" value="NULL" />
<mvt:do file="g.Module_Library_DB" name="l.success" value="BasketChargeList_Load_Basket( g.basket:basket_id, l.settings:basket:charges )" />
<mvt:foreach iterator="charge" array="basket:charges">
<mvt:do name="l.settings:charge:formatted_disp_amt" file="g.Module_Root $ g.Store:currncy_mod:module" value="CurrencyModule_AddFormatting( g.Store:currncy_mod, l.settings:charge:disp_amt )" />
</mvt:foreach>
<mvt:do file="g.Module_Library_DB" name="l.settings:basket:total" value="Basket_Total( g.Basket:basket_id )" />
<mvt:do name="l.settings:basket:formatted_total" file="g.Module_Root $ g.Store:currncy_mod:module" value="CurrencyModule_AddFormatting( g.Store:currncy_mod, l.settings:basket:total )" />