Skip to content

Instantly share code, notes, and snippets.

View mghdotdev's full-sized avatar

Max Hegler mghdotdev

View GitHub Profile
@mghdotdev
mghdotdev / component.js
Created November 8, 2022 22:43
Lit + FormProxy
import {FormProxy} from './form-proxy.js';
class MyComponent extends FormProxy(LitElement) {
render () {
return html`
<form>
<input type="text" />
</form>
`;
@mghdotdev
mghdotdev / Example.xml
Created August 7, 2020 20:31
Charge Example
<Charges>
<Charge>
<Type>SHIPPING</Type>
<Description>Shipping: UPS Ground</Description>
<Amount>9.95</Amount>
<TaxExempt>Yes/No</TaxExempt>
</Charge>
</Charges>
@mghdotdev
mghdotdev / provisioning.xml
Last active July 25, 2018 21:20
Master/Variant Provisioning Workflow
<!-- ==================== START MASTER ==================== -->
<!-- ADD MASTER PRODUCT -->
<Product_Add>
<Code>tshirt</Code>
<!--
...
...
...
-->
<Active>Yes</Active>
@mghdotdev
mghdotdev / details.xml
Created April 10, 2018 22:40
Reel Fly Rod Custom Builder Notes
Storage:
1) Use global variables:
g.Rod = PRODUCT_CODE
g.Reel = PRODUCT_CODE
g.Line = PRODUCT_CODE
Select Button Action
1) Make the select button an anchor link using this template =>
@mghdotdev
mghdotdev / Content.xml
Last active September 1, 2017 16:45
Date-Picker Custom Batch Report
<mvt:comment>
CONFIG
</mvt:comment>
<mvt:assign name="g.CONFIG:table_name" value="''" />
<mvt:assign name="g.CONFIG:dt_column" value="''" />
<mvt:comment> ================================================================================ </mvt:comment>
<mvt:comment> Set Content Type </mvt:comment>
<mvt:assign name="l.succes" value="miva_output_header( 'Content-Type', 'application/json' )" />
@mghdotdev
mghdotdev / ReadMe.md
Last active July 27, 2020 23:59
REGEX TO FIX CRAPPY CHARS

REGEX TO FIX CRAPPY CHARS

  1. Download a .CSV file from Data Management.
  2. Open it in Sublime (or other text editor with a RegEx search).
  3. Use the RegEx to search for "non-standard" characters.
  4. Replace them with their HTML entity equivalent. (http://www.amp-what.com/)
<ProductImage_Add product_code="test" filepath="graphics/00000001/image.jpg" type_code="" />
@mghdotdev
mghdotdev / pre_load_variant.xml
Created January 6, 2016 19:56
MVT: Pre-Load Variant Information on Master Product Page
<mvt:comment>
CUSTOM Pre-Load Variant based off Passed Variant ID
</mvt:comment>
<mvt:if expr="NOT ISNULL g.v">
<mvt:item name="ry_toolbelt" param="assign|g.sql|'SELECT attr_id, attmpat_id, option_id FROM s01_ProductVariants WHERE variant_id = `' $ MySqlEscape(g.v) $ '` AND product_id = `' $ MySqlEscape(l.all_settings:product:id) $ '`'" />
<mvt:item name="ry_toolbelt" param="query|g.sql|variant_attributes" />
<mvt:do file="g.Module_Library_DB" name="l.success" value="AttributeList_Load_Product(l.settings:product:id, l.settings:loaded_attributes)" />
<mvt:foreach iterator="loaded_attribute" array="loaded_attributes">
@mghdotdev
mghdotdev / all_products_offset_custom_page.xml
Last active December 11, 2015 00:05
MVT: All Products Offset Custom Page
<mvt:if expr="ISNULL g.Per_Page">
<mvt:assign name="g.Per_Page" value="100" />
</mvt:if>
<mvt:if expr="ISNULL g.AllOffset OR g.AllOffset EQ '@offset'">
<mvt:assign name="g.AllOffset" value="0" />
</mvt:if>
<mvt:foreach iterator="product" array="all_products:products">
<mvt:comment> ==== custom logic here ==== </mvt:comment>
@mghdotdev
mghdotdev / load_category_uri.xml
Created August 31, 2015 18:57
MVT: URI Management - Load Category / Product / Page
<mvt:comment>
`Store_Category_URL`
NAME: The returned URI.
PARAMS:
[1] `category var` - The category variable (must include the category's id and code)
[2] `flag var` - Structure unknown (Supposed to return either HTTPS or HTTP version of the passed URI)
</mvt:comment>
<mvt:do file="g.Module_Feature_URI_UT" name="l.settings:category:uri" value="Store_Category_URL(l.settings:category, NULL)" />