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
<select name="countries"> | |
<option value="United States">United States</option> | |
<option value="United Kingdom">United Kingdom</option> | |
<option value="Afghanistan">Afghanistan</option> | |
<option value="Albania">Albania</option> | |
<option value="Algeria">Algeria</option> | |
<option value="American Samoa">American Samoa</option> | |
<option value="Andorra">Andorra</option> | |
<option value="Angola">Angola</option> | |
<option value="Anguilla">Anguilla</option> |
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
{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]} |
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
case "msOnBeforeAddToCart": | |
if (is_array($options) && array_key_exists('gift', $options) && !empty($options['gift'])) { | |
$items = $cart->get(); | |
foreach ($items as $item) { | |
if ($item['options']['gift'] && $item['id'] == $product->get('id')) { | |
$response = array( | |
'success' => false | |
,'message' => 'Этот товар уже добавлен в качестве подарка.' | |
); | |
exit(json_encode($response)); |
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
[[!pdoPage? | |
&element=`getImageList` | |
&tvname=`fabriki` | |
&tpl=`@CODE:<div class="col-md-4"><a href="[[+link]]"><img src="http://placehold.it/350x250"></a><h4>[[+manufacturer]]</h4></div>` | |
&limit=`2` | |
&totalVar=`ImagesTotal` | |
&toPlaceholder=`ImagesResult` | |
&ajaxMode=`button` | |
]] |
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
AddDefaultCharset UTF-8 | |
<IfModule mod_expires.c> | |
ExpiresActive On | |
ExpiresDefault "access 7 days" | |
ExpiresByType application/javascript "access plus 1 year" | |
ExpiresByType text/javascript "access plus 1 year" | |
ExpiresByType text/css "access plus 1 year" | |
ExpiresByType text/html "access plus 7 day" | |
ExpiresByType text/x-javascript "access 1 year" |
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
// pug | |
ul.tabs-nav | |
li(data-tab-name="tab-1").tabs-nav__item.tabs-nav__item--active Таб 1 | |
li(data-tab-name="tab-2").tabs-nav__item Таб 2 | |
.tabs-content | |
.tabs-content__item.tab-1.tabs-content__item--active | |
p 1 | |
.tabs-content__item.tab-2 | |
p 2 |
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
Использоватние | |
{$variable | snippet} | |
Сниппет "snippet" | |
<?php | |
/** @var modX $modx */ | |
switch ($modx->event->name) { | |
case 'pdoToolsOnFenomInit': | |
/** @var Fenom $fenom | |
Мы получаем переменную $fenom при его первой инициализации и можем вызывать его методы. |
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 | |
use PHPMailer\PHPMailer\PHPMailer; | |
use PHPMailer\PHPMailer\Exception; | |
if($_POST){ | |
// Import PHPMailer classes into the global namespace | |
// These must be at the top of your script, not inside a function | |
require 'PHPMailer/src/PHPMailer.php'; | |
require 'PHPMailer/src/POP3.php'; | |
require 'PHPMailer/src/SMTP.php'; | |
require 'PHPMailer/src/Exception.php'; |
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 = $modx->resource->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); |
OlderNewer