Skip to content

Instantly share code, notes, and snippets.

Steven Soule steveosoule

Block or report user

Report or block steveosoule

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View miva-basket-item-sku-and-variant_id-fix.xml
<mvt:comment>
| ------------------------------------------------
| Basket Item SKU & variant_id Fix
| ------------------------------------------------
|
| ## Description:
|
| Update the sNN_BasketItems sku & variant_id fields when they are missing
| This is normally only needed when an item has been added from a:
| 1. Wishlist?
@steveosoule
steveosoule / miva-render-all-readytheme-items.xml
Last active Dec 2, 2019
Miva - Render all ReadyTheme Items
View miva-render-all-readytheme-items.xml
<mvt:do file="g.Module_Library_DB" name="l.success" value="Module_Load_Code( 'readytheme', l.settings:readytheme )" />
<mvt:assign name="l.settings:readytheme:full_path" value="g.Module_Root $ l.settings:readytheme:module" />
<mvt:do file="l.settings:readytheme:full_path" name="l.success" value="ReadyTheme_ImageList_Load(l.settings:readytheme:images)" />
<mvt:foreach iterator="image" array="readytheme:images">
<h2 class="c-heading-bravo c-heading-bravo u-bg-black u-color-white">ReadyTheme Image: &mvt:image:name; (&mvt:image:code;)</h2>
<mvt:assign name="g.Code" value="l.settings:image:code" />
<mvt:item name="readytheme" param="image( g.Code )" />
</mvt:foreach>
@steveosoule
steveosoule / 01_page-template.xml
Last active Dec 20, 2019
Miva - Headless JSON API
View 01_page-template.xml
<mvt:comment>
<!-- Add this to the top of all of the pages you want to create an api out of (ex: CTGY, SRCH, PROD, PLST, BASK, etc.) -->
</mvt:comment>
<mvt:if expr="'json' CIN s.http_accept">
<mvt:item name="readytheme" param="Load_ContentSection( 'json' )" />
<mvt:do name="l.result" file="g.Module_Feature_TUI_DB" value="ManagedTemplate_Load_ID( l.settings:readytheme:loaded:templ_id, l.loaded_template )" />
<mvt:do name="l.result" file="g.Store_Template_Path $ l.loaded_template:filename" value="Template_Render( l.null, l.settings )" />
<mvt:exit />
</mvt:if>
<mvt:item name="html_profile" />
@steveosoule
steveosoule / 1_feed-template.xml
Last active Oct 25, 2019
Miva - Google Merchant Center Product Review Feed from tgreviews content
View 1_feed-template.xml
<mvt:comment>
<!--
## Resources:
- https://developers.google.com/product-review-feeds
- https://developers.google.com/product-review-feeds/sample/
- https://www.google.com/shopping/reviews/schema/product/2.2/product_reviews.xsd
## Installation:
View miva_customer_template_email.xml
<mvt:comment>
Overrides if needed
</mvt:comment>
<mvt:assign name="l.run:on_cust" value="1" />
<mvt:assign name="l.run:override_from" value="''" />
<mvt:assign name="l.run:override_reply_to" value="''" />
<mvt:assign name="l.run:override_to" value="''" />
<mvt:assign name="l.run:override_cc" value="''" />
<mvt:assign name="l.run:override_bcc" value="''" />
<mvt:assign name="l.run:override_subject" value="''" />
@steveosoule
steveosoule / prod-microdata-itteration.xml
Last active Nov 21, 2019
PROD microdata itteration
View prod-microdata-itteration.xml
<mvt:item name="html_profile"/>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<base href="&mvt:global:basehref;">
<mvt:if expr="NOT ISNULL l.settings:product:page_title">
<title>&mvt:product:page_title;</title>
<mvt:elseif expr="NOT ISNULL l.settings:page:title">
<title>&mvt:page:title;</title>
@steveosoule
steveosoule / miva-remove-order-from-order-workflow-through-xml-provisioning.xml
Created Sep 3, 2019
Miva - Remove Order from Order Workflow through XML provisioning
View miva-remove-order-from-order-workflow-through-xml-provisioning.xml
<Order_Customfield module="orderworkflow" feature="fields_ordr" order_id="123456789" field="new_and_updated">0</Order_Customfield>
@steveosoule
steveosoule / miva-json-api-set-custom-field-and-acknowledge-order.json
Last active Sep 12, 2019
Miva - JSON API: Set Custom Field & Acknowledge Order
View miva-json-api-set-custom-field-and-acknowledge-order.json
{
"Operations": [
{
"Store_Code": "ABC",
"Function": "OrderCustomFields_Update",
"Order_ID": 111111,
"CustomField_Values": {
"customfields": {
"order_received_by_acme_co": "1"
}
@steveosoule
steveosoule / parseYoutubeURL.js
Created Aug 27, 2019
JavaScript - parseYoutubeURL
View parseYoutubeURL.js
// thanks to: https://github.com/rubenmarin
function parseYoutubeURL(youtubeURL) {
var videoOptions = {},
youtubeURLRegex = /(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/ ]{11})/i,
httpTestRegex = new RegExp(':\/\/', 'i'),
parts = [];
if (httpTestRegex.test(youtubeURL) === false) {
@steveosoule
steveosoule / lazyAny.jquery.js
Created Aug 8, 2019
Lazyload thing with jQuery
View lazyAny.jquery.js
var lazyAny = function(selector, callback, offset){
offset = isNaN(offset) ? 250 : offset;
var init = function(){
debouncedCheck();
$(window).on('load scroll resize', debouncedCheck);
};
var check = function(){
You can’t perform that action at this time.