This file contains hidden or 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 | |
switch($modx->event->name){ | |
// событие на OnEcMessageSave | |
case 'OnEcMessageSave': | |
if($object){ | |
$data = $object->toArray(); | |
$time = time(); | |
$newMessage = 5; | |
$createdon = strtotime($object->get("createdon")) + $newMessage; | |
if ($createdon > $time) { |
This file contains hidden or 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 | |
switch($modx->event->name) { | |
case 'msOnGetProductPrice': | |
$returned_values = & $modx->event->returnedValues; | |
$values = $modx->event->params['data']; | |
$returned_values['price'] = ceil($values['price']/100)*100; // округляем в большу сторону | |
break; |
This file contains hidden or 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 | |
if (empty($parent)) {$parent = $id;} | |
$pids = array_merge(array($parent), $modx->getChildIds($parent)); | |
$ids = array(); | |
$q = $modx->newQuery('msProduct'); | |
$q->where(array('class_key' => 'msProduct','parent:IN' => $pids,'published' => 1,'deleted' => 0)); | |
$q->select('`msProduct`.`id`'); | |
if ($q->prepare() && $q->stmt->execute()) { | |
$ids = $q->stmt->fetchAll(PDO::FETCH_COLUMN); |
This file contains hidden or 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 $tmp = '!msOptionsPrice.modification'|snippet:[ | |
'product' => $_modx->resource.id, | |
'tpl' => 'tpl.msOptionsPrice.modification', | |
'return' => 'data', | |
'processOptions' => 1, | |
'showZeroPrice' => 0 | |
]} | |
{if $tmp?} | |
<div class="size-row"> | |
{'!msOptionsPrice.option' | snippet : [ |
This file contains hidden or 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
на вашем хостинге нужно было создать файл .htaccess | |
с | |
RewriteCond %{HTTP:Authorization} !^$ | |
RewriteRule ^(.*)$ $1?http_auth=%{HTTP:Authorization} [QSA] |
This file contains hidden or 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 | |
// Id корня, глубина, контекст | |
$child = $modx->getChildIds(11, 10, array('context' => 'web')); | |
$q = $modx->newQuery('Ticket'); | |
$q->where(array( | |
'id:IN' => $child, | |
'published' => true, | |
'deleted' => false, | |
'searchable' => true, | |
)); |
This file contains hidden or 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 | |
// строка 32,38,39,40 создаем поля в системных и прописываем там идентификаторы | |
// ini_set('display_errors', 1); | |
// ini_set('error_reporting', -1); | |
require_once MODX_CORE_PATH . 'components/minishop2/model/minishop2/mspaymenthandler.class.php'; | |
class TinkoffCredit extends msPaymentHandler implements msPaymentInterface{ | |
public $demo; |
This file contains hidden or 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
jQuery(window).on('load', function() { | |
"use strict"; | |
history.pushState(null, '', '/?msorder'); | |
}); |
This file contains hidden or 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
$(document).on('af_complete', function (event, response) { | |
$('#getAQuoteModal').modal('hide'); | |
if (response.success) { | |
$('#thanks').modal('show'); | |
let form = $(response.form[0]); | |
form.attr('action', '-%thks'); | |
let url = window.location.href; |
This file contains hidden or 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="mt-product1 mt-paddingbottom20 ms2_product"> | |
<form method="post" class="ms2_form"> | |
<input type="hidden" name="id" value="{$id}"> | |
<input type="hidden" name="count" value="1"> | |
<input type="hidden" name="options" value="[]"> | |
<div class="box"> | |
<div class="b1"> | |
<div class="b2"> | |
<a href="{$id | url}"> | |
{if $thumb?} |
NewerOlder