Skip to content

Instantly share code, notes, and snippets.

<?php
public function change($key, $count, $options, $comment)
{
if (array_key_exists($key, $this->cart)) {
if (isset($count) && !is_null($count) && $count <= 0)
return $this->remove($key);
else if(isset($count) && !is_null($count) && $count > 0)
{
if ($count > $this->config['max_count']) {
<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="16000">
{foreach $files as $file}
<a href="{$file['url']}" target="_blank" data-rid="{$file['product_id']}" data-iid="{$file['id']}">
[[!msOptionsPrice.initialize?]]
<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">
<h3 class="msoptionsprice-name msoptionsprice-[[*id]]">[[*pagetitle]]</h3>
@vgrish
vgrish / msAll.order.tpl
Last active January 10, 2017 15:50
msAll.order
<form class="form-horizontal ms2_form" id="msOrder" method="post">
<div class="row">
<div class="col-md-6">
<h4>{'ms2_frontend_credentials' | lexicon}:</h4>
{foreach ['email','receiver','phone'] as $field}
<div class="form-group input-parent">
<label class="col-md-4 control-label" for="{$field}">
<span class="required-star">*</span> {('ms2_frontend_' ~ $field) | lexicon}
</label>
<div class="col-sm-6">
<?php
/** @var $modx modX */
if (!$modx = $object->xpdo AND !$object->xpdo instanceof modX) {
return true;
}
/** @var $options */
switch ($options[xPDOTransport::PACKAGE_ACTION]) {
case xPDOTransport::ACTION_INSTALL:
@vgrish
vgrish / yandex-pinger.php
Created May 6, 2016 10:56
yandex-pinger
<?php
/*
Plugin Name: Яндекс.ПДС Пингер
Description: Плагин оповещает сервис Яндекс.Поиск для сайта о новых и измененных документах.
Version: 1.5
*/
class YandexPinger{
private $key = '';
<div class='tm-product'>
<h1>[[*pagetitle]]</h1>
<div id='msProduct' class='row' itemtype='http://schema.org/Product' itemscope>
<meta itemprop='name' content='[[*pagetitle]]'>
<meta itemprop='description' content='[[*description:default=`[[*pagetitle]]`]]'>
<div class='span5 col-md-5 col-sm-6'>
[[!msGallery@bsMsGallery]]
</div>
<div class='span7 col-md-7 col-sm-5' itemtype='http://schema.org/AggregateOffer' itemprop='offers' itemscope>
<meta itemprop='category' content='[[#[[*parent]].pagetitle]]'>
<div class='row ms2_product col-md-4' itemtype='http://schema.org/Product' itemscope>
<meta itemprop='description' content='[[+description:default=`[[+pagetitle]]`]]'>
<div class='prev'>
<a href='[[+uri]]'>
<img src='[[+thumb:default=`[[++assets_url]]components/minishop2/img/web/ms2_small.png`]]' itemprop='image'
alt='[[+pagetitle]]' title='[[+pagetitle]]'>
</a>
</div>
<h3 class='tm-title' itemprop='name'>[[+pagetitle]]</h3>
<?php
$sets = array();
$tmp = array(
'bs' => array(
'showLog' => array(
'type' => 'combo-boolean',
'value' => false
),
@vgrish
vgrish / index.html
Created March 29, 2016 07:42 — forked from anonymous/index.html
JS Bin uikit slideshow + counts // source http://jsbin.com/pewuwi
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="uikit slideshow + counts">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/uikit/2.25.0/js/uikit.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/uikit/2.25.0/js/components/slideshow.js"></script>