Skip to content

Instantly share code, notes, and snippets.

Steven Soule steveosoule

View GitHub Profile
View miva-truthy-falsy.xml
<mvt:if expr="'Yes'">
'Yes' is Truthy
'Yes' is Falsy
<mvt:if expr="'No'">
steveosoule / .gitlab-ci.yml
Last active Mar 15, 2019
GitLab CI to FTP deploy
View .gitlab-ci.yml
stage: deploy
- master
- apt-get update -qq && apt-get install -y -qq lftp
- lftp -c "set ftp:ssl-allow no; open -u $USERNAME,$PASSWORD $HOST; mirror -Rev dist/ ./ --ignore-time --parallel=10 --exclude-glob .git* --exclude .git/"
View mvt-while-pos-examples.xml
<h2>Nested mvt:whiles</h2>
<mvt:while expr="g.my_counter_1 LT 3">
<mvt:assign name="g.my_counter_1" value="g.my_counter_1 + 1" />
<mvt:assign name="g.my_counter_2" value="0" />
<mvt:while expr="g.my_counter_2 LT 3">
<mvt:assign name="g.my_counter_2" value="g.my_counter_2 + 1" />
my_counter_1=&mvte:global:my_counter_1;, my_counter_2=&mvte:global:my_counter_2;, pos1=<mvt:eval expr="l.pos1" />, pos2=<mvt:eval expr="l.pos2" /><br>


When developing a new feature for a mive-store. Ideally perform it in on a dev-store/environment until it is finalized & ready for implementation. Then once it is read for implementation, it may take updating several page-templates, global-templates, and other misc. places in order to activate the new feature.

To test the new-feature on the live-store in a seamless & safe manor we can prepare all the changes underneath a series of conditionals that will evaluate to true when a single-global variable is set. This is sometimes called Staging Changes Before Going Live.

This allows us to set the global variable by various methods, and it also allows us to launch the changes to the public across various page templates by setting a single variable value to a truthy value.


View miva-common-provisioning.xml
<!-- Category Add -->
<Name><![CDATA[Espresso Machines]]></Name>
steveosoule / replace-broken-invalid-characters-latin-iso-8859-1-to-utf-8-charset.php
Last active Jan 18, 2019
Replace Broken/Invalid Characters (Latin ISO-8859-1 to UTF-8 charset)
View replace-broken-invalid-characters-latin-iso-8859-1-to-utf-8-charset.php
// Load Posts
$query = $dbh->query("SELECT * FROM `Posts`");
$posts = $query->fetchAll();
// Update Posts
foreach($posts as $post)
$query = $dbh->prepare("UPDATE `Posts` SET content = :content WHERE id = :id");
View miva-array-filter-ref-to-sum-totals.xml
<mvt:foreach iterator="item" array="order:items">
<mvt:if expr="l.settings:item:skip">
<mvt:foreachcontinue />
<mvt:assign name="l.record_found" value="miva_array_filter_ref( l.settings:totals, 1, l.item, 'l.item:code EQ l.settings:item:code', l.record )" />
<mvt:if expr="l.record_found">
<mvt:comment> sum </mvt:comment>
steveosoule / marketing-feed.xml
Last active Jan 10, 2019
Product & Category URI Cascades
View marketing-feed.xml
<mvt:do file="g.Module_Library_DB" name="l.success" value="CategoryList_Load_All( l.settings:categories )" />
<mvt:foreach iterator="category" array="categories">
<mvt:do file="g.Module_Root $ '/modules/component/cmp-mv-prodctgy-meta.mvc'" name="l.settings:category:cascade_count" value="CategoryCascadeList_Load_Category( l.settings:category, l.settings:category:cascade )" />
<mvt:if expr="l.settings:category:cascade_count EQ 1">
<uri_add category_code="&mvte:category:code;" status="200" uri="/&mvte:category:code;.html" />
steveosoule / default-miva-page-code-list.txt
Last active Dec 17, 2018
Miva - Default Miva Page Code List
View default-miva-page-code-list.txt
steveosoule / LoadOrdersExample.php
Created Dec 17, 2018
Example mivaecommerce/api-sdk-php/examples/ListQueryExample.php
View LoadOrdersExample.php
* This file is part of the MerchantAPI package.
* (c) Miva Inc <>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
* $Id: LoadOrdersExample.php 71893 2018-12-07 23:26:05Z gidriss $
You can’t perform that action at this time.