switch ($modx->event->name) {
case 'OnDocFormSave':
if(in_array($resource->get('template'),array(5,17))){
if($resource->get('class_key') == 'modSymLink'){
if(is_numeric($resource->get('content'))){
$resTVS = $modx->getCollection('modTemplateVarResource',array(
'contentid' => $resource->get('content')
));
$TVS = array(8,18,19,105,106,107,108,109,110,111,112,113,114,115,116,117);
foreach($resTVS as $resTV) {
if(in_array($resTV->get('tmplvarid'),$TVS)){
$resource->setTVValue($resTV->get('tmplvarid'), $resTV->get('value'));
}
}
}
}
break;
}
if($componentPage == "section")
{
if (isset($arVariables["SECTION_ID"]))
$b404 |= (intval($arVariables["SECTION_ID"])."" !== $arVariables["SECTION_ID"]);
else
$b404 |= !isset($arVariables["SECTION_CODE"]);
}
/*####*/
if(CSite::InDir('/projects/filter/')){
$b404 = false;
}
$("#submit").click(function(){
if(a1!='0'){
jQuery.post("/shop/add/",{"product_id":"380","quantity":a1}).complete(function(){
if(a2!='0'){ jQuery.post("/shop/add/",{"product_id":"381","quantity":a2});}
if(a3!='0'){ jQuery.post("/shop/add/",{"product_id":"382","quantity":a3});}
}).error(function() { console.log('Ошибка выполнения') });;
}
});