Skip to content

Instantly share code, notes, and snippets.

@steveosoule
steveosoule / miva-get-subdomain.html
Last active August 29, 2015 13:58
Miva - Get Current Subdomain
<mvt:assign name="g.subdomain" value="substring( s.http_host, '0', (indexof( '.', s.http_host, '1') - 1) )"/>
&mvte:global:subdomain;
@steveosoule
steveosoule / miva-generated-product-images.sql
Created April 24, 2014 19:10
Miva Merchant - Select all Generated Images For Specific Product & Image Type
SELECT * FROM s01_Products AS prod
JOIN s01_ProductImages AS pimg
ON pimg.product_id = prod.id
JOIN s01_Images AS img
ON img.id = pimg.image_id
JOIN s01_ImageTypes AS type
ON type.id = pimg.type_id
JOIN s01_GeneratedImages AS gimg
ON gimg.image_id = img.id
WHERE prod.id = '33954'
@steveosoule
steveosoule / miva-replace-special-characters.html
Last active August 29, 2015 14:00
Miva Merchant - Replace Special Characters
<mvt:assign name="l.settings:special_chars" value="miva_array_deserialize('Á,á,À,Â,à,Â,â,Ä,ä,Ã,ã,Å,å,Æ,æ,Ç,ç,Ð,ð,É,é,È,è,Ê,ê,Ë,ë,Í,í,Ì,ì,Î,î,Ï,ï,Ñ,ñ,Ó,ó,Ò,ò,Ô,ô,Ö,ö,Õ,õ,Ø,ø,ß,Þ,þ,Ú,ú,Ù,ù,Û,û,Ü,ü,Ý,ý,ÿ')" />
<mvt:assign name="l.settings:replace_chars" value="miva_array_deserialize('A,a,A,A,a,A,a,A,a,A,a,A,a,AE,ae,C,c,D,d,E,e,E,e,E,e,E,e,I,i,I,i,I,i,I,i,N,n,O,o,O,o,O,o,O,o,O,o,O,o,s,T,t,U,u,U,u,U,u,U,u,Y,y,y')" />
<mvt:assign name="g.test_string" value="'Ýó Ðüðê'" />
<mvt:assign name="g.clean_test_string" value="glosub_array( g.test_string, l.settings:special_chars, l.settings:replace_chars )" />
&mvte:global:test_string; -> &mvte:global:clean_test_string;
@steveosoule
steveosoule / miva-save-last-4digits-of-credit-card.html
Last active August 29, 2015 14:01
Miva Merchant: Save Last 4 Digits of Credit Card
<mvt:assign name="g.cc_num_clean" value="trim(glosub( glosub(g.GLOBAL_CC_NUM_VAR,'-',''), ' ', ''))" />
<mvt:assign name="g.cc_last_4" value="substring(g.cc_num_clean,len(g.cc_num_clean) - 3,4)" />
<mvt:item name="customfields" param="Write_Order(l.settings:order:id,'cc_last_4', g.cc_last_4)" />
.element{
box-shadow: 0 7px 5px -5px rgba(51, 51, 51, .3);
}
@steveosoule
steveosoule / set-cookies-in-javascript-like-php.js
Created May 29, 2014 16:51
Set Cookies in JavaScript like PHP
// FROM: http://snippetrepo.com/snippets/set-cookies-in-javascript-like-php
function set_cookie(name, value, time, path) {
var date = new Date();
date.setTime(date.getTime() + (time * 1000));
var expires = ';expires='+ date.toGMTString();
document.cookie = name +'='+ value + expires +';path='+ path;
}
$(document).on('click', '.set-cookie', function() {
@steveosoule
steveosoule / miva-file-download-http-headers.txt
Created June 3, 2014 21:09
Miva File Download HTTP Headers
Header Value
Content-Disposition attachment; filename=order-summary.xls
@steveosoule
steveosoule / miva-toolkit-mysql-datetime-format.html
Last active August 29, 2015 14:02
Miva Toolkit MySQL DATETIME Format
<mvt:item name="toolkit" param="set_time_zone|our_time|-7" />
<mvt:item name="toolkit" param="time_t_year|year|our_time" />
<mvt:item name="toolkit" param="time_t_month|month|our_time" />
<mvt:item name="toolkit" param="padl|month|month|2|0" />
<mvt:item name="toolkit" param="time_t_dayofmonth|day|our_time" />
<mvt:item name="toolkit" param="padl|day|day|2|0" />
<mvt:item name="toolkit" param="time_t_hour|hour|our_time" />
<mvt:item name="toolkit" param="padl|hour|hour|2|0" />
<mvt:item name="toolkit" param="time_t_minute|minute|our_time" />
<mvt:item name="toolkit" param="padl|minute|minute|2|0" />
@steveosoule
steveosoule / htaccess-mod-deflate-gzip-compression.txt
Created June 4, 2014 20:09
.htaccess mod_deflate gZip compression
# ----------------------------------------------------------------------
# gZip Compression with mod_deflate
# ----------------------------------------------------------------------
<ifmodule mod_deflate.c>
<FilesMatch ".(js|css|html|htm|php|xml)$">
SetOutputFilter DEFLATE
</FilesMatch>
</ifmodule>
<!-- FROM: http://googlecode.blogspot.com/2009/09/gmail-for-mobile-html5-series-reducing.html -->
<html>
...
<script id="lazy">
// Make sure you strip out (or replace) comment blocks in your JavaScript first.
/*
JavaScript of lazy module
*/
</script>