This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
$(document).ready(function() { | |
AjaxForm.Message.success = function() {}; | |
}); | |
$(document).on('af_complete', function(event,res) { | |
if(res.success) $('.fancybox-close-small').click(); | |
if (res.success) { | |
// показываем сообщение об успехе | |
$.fancybox.close(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{set $rows = 1 | resource : 'partner' | fromJSON} | |
<div> | |
<ul class="partners"> | |
{foreach $rows as $row index=$idx} | |
<li><a href="{$row.url}"><img src="{$row.image}" alt=""></a>{$idx}</li> | |
{if ($idx+1) % 3 == 0 && count($rows) > $idx+1 } | |
</ul> </div> <div> <ul class="partners"> | |
{/if} | |
{/foreach} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{if $_modx->getPlaceholder('mf2_total') != 0} | |
<div class="row msearch2" id="mse2_mfilter"> | |
<div class="filters"> | |
<form action="[[~[[*id]]]]" method="post" id="mse2_filters"> | |
<div class="left"> | |
[[+mf2_ms|vendor:vendors]] | |
<div class="for_hid"> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width"> | |
<meta name="format-detection" content="telephone=no"> | |
<meta http-equiv="x-rim-auto-match" content="none"> | |
<base href="{$_modx->config.site_url}" /> | |
{if $_modx->resource.titl} | |
<title>{$_modx->resource.titl| ereplace:'/\"([^\"]*)\"/':'«$1»'}{if $city_name_conjugate} {$city_name_conjugate}{/if}</title> | |
{elseif $_modx->resource.template in [7]} | |
<title>{$_modx->resource.pagetitle| ereplace:'/\"([^\"]*)\"/':'«$1»'}{if $city_name_conjugate} - купить оптом {$city_name_conjugate}{/if}</title> | |
{elseif $_modx->resource.id in [4]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://github.com/bezumkin/miniShop2/blob/master/core/components/minishop2/processors/mgr/product/getlist.class.php#L69 | |
// начиная с 68 строки | |
if (!empty($query)) { | |
//if (is_numeric($query)) { | |
// $c->where(array( | |
// 'msProduct.id' => $query, | |
// 'OR:Data.article:=' => $query, | |
// )); | |
//} else { | |
$c->where(array( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
в чанке формы пишем | |
<div class="form-group"> | |
<input type="text" name="product" value="[[!+fi.product]]" class="form-control" readonly="readonly"> | |
</div> | |
JS вешаем на кнопку | |
{ignore} | |
<script> | |
$(document).ready(function() { | |
$('a.theme-btn.btn-style-five').on('click', function(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class msOrder extends xPDOSimpleObject | |
{ | |
public function updateProducts() | |
{ | |
$originalContext = $this->xpdo->context->get('key'); | |
$this->xpdo->switchContext($this->get('context')); | |
$originalMiniShop = isset($this->xpdo->services['minishop2']) ? $this->xpdo->services['minishop2'] : null; | |
$cart = array(); | |
foreach ($this->getMany('Products') as $product) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"formtabs":[ | |
{ | |
"MIGX_id":2, | |
"caption":"\u0412\u043a\u043b\u0430\u0434\u043a\u0430", | |
"print_before_tabs":"0", | |
"fields":[ | |
{ | |
"MIGX_id":4, | |
"field":"tab_name", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
в head | |
<script src="//code.jquery.com/jquery-1.11.3.min.js"></script> | |
<script src="https://maps.google.com/maps/api/js?language=ru&key=AIzaSyBkYlYr9e5MXFICXWBIxDZgg8N53X_WiSU"></script> | |
<script src="/assets/js/infobox.min.js"></script> | |
<script src="/assets/js/markerclusterer.js"></script> | |
======================================================= | |
вызов в шаблоне | |
{if $.get.tpl == '0' || $.get.tpl == ''} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$catid = array($modx->resource->id); | |
$in_id = implode(",", $catid) ; | |
$sql = "SELECT msc.category_id, msc.option_id, mso.key, mso.type | |
FROM {$modx->getTableName('msCategoryOption')} msc | |
LEFT JOIN {$modx->getTableName('msOption')} mso ON msc.option_id = mso.id | |
WHERE msc.category_id IN ($in_id) AND mso.filtr=1 ORDER BY mso.category, mso.id ASC"; | |
$q = $modx->prepare($sql); | |
$q->execute(); | |
$options = $q->fetchAll(PDO::FETCH_ASSOC); |