Skip to content

Instantly share code, notes, and snippets.

{foreach $options as $name => $values}
<div class="sm-text"><b>{('ms2_product_' ~ $name) | lexicon}</b></div>
{foreach $values as $value index=$index}
<label>
<input type="radio" value="{$values[$index]}" name="options[{$name}]" {if $index == 0}checked="checked"{/if}/>
{$values[$index]}
@vgrish
vgrish / default.js
Created November 26, 2016 06:21
quickview
/** v 1.1.0 */
var quickview = {
config: {},
defaults: {
selectors: {
view: 'quickview-view',
close: 'quickview-close btn-danger',
next: 'quickview-next btn-info',
prev: 'quickview-prev btn-info'
<h1>[[*pagetitle]]</h1>
<div id="msProduct" class="row">
<div class="col-md-6">
[[!msGallery]]
</div>
<div class="col-md-6">
<form class="form-horizontal ms2_form msoptionsprice-product" method="post">
<input type="hidden" name="id" value="[[*id]]"/>
<div class="form-group">
<label class="col-md-2 control-label">[[%ms2_product_article]]:</label>
<div class="row ms2_product">
<div class="col-md-2">
{if $thumb?}
<img src="{$thumb}" alt="{$pagetitle}" title="{$pagetitle}"/>
{else}
<img src="{'assets_url' | option}components/minishop2/img/web/ms2_small.png"
srcset="{'assets_url' | option}components/minishop2/img/web/[email protected] 2x"
alt="{$pagetitle}" title="{$pagetitle}"/>
{/if}
@vgrish
vgrish / msAddLinked.js
Created November 23, 2016 08:05
msAddLinked
/**
* Created by mvoevodskiy on 20.07.16.
*/
$(document).on('ready', function() {
msal.orig_price = 0;
msal.additional_price = 0;
if (msal.price_target === undefined) {
msal.price_target = '#price';
}
if (msal.price_orig_target === undefined) {
@vgrish
vgrish / tpl.msCart
Created November 10, 2016 06:28
tpl.msCart modification
{$_modx->lexicon->load('minishop2:product')}
<div id="msCart">
{if !count($products)}
{'ms2_cart_is_empty' | lexicon}
{else}
<div class="table-responsive">
<table class="table table-striped">
<tr class="header">
<th class="image">&nbsp;</th>
#!/bin/sh
cd
cd www/name
git pull
<?php
define('MODX_API_MODE', true);
require dirname(dirname(__FILE__)) . '/index.php';
// sh
$hookfile = MODX_BASE_PATH . '.hooks/gitlab-pull.sh';
$buildfile = MODX_BASE_PATH . 'name/_build/build.transport.php';
// refs
$ref = 'refs/heads/master';
@vgrish
vgrish / my.cnf
Created October 26, 2016 08:43
nano /etc/mysql/my.cnf
[mysqld]
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
<div id="msGallery" class="msoptionsprice-gallery">
{if $files?}
<div class="fotorama"
data-nav="thumbs"
data-thumbheight="45"
data-allowfullscreen="true"
data-swipe="true"
data-autoplay="160000">
{foreach $files as $file}
<a href="{$file['url']}" target="_blank" data-rid="{$file['product_id']}" data-iid="{$file['id']}">