Есть сниппет который берёт цену для сортировки, цена указана в евро и её нужно перевести в другую валюту, как это можно сделать с полем price в этом сниппете ?
$key_placeholder = 'show_block';
$modx->unsetPlaceholders($key_placeholder);
$params = array(
'parents' => $id,
'includeTVs' => 'price,power,overclocking,fuel_consumption,body_type,fuel_type,number_of_doors,rwd,transmission',
'select' => 'id,pagetitle',
'limit' => '20',
'depth' => '2',
'returnIds' => '1'
);
$where = array();
if(isset($_GET['price-from']) && isset($_GET['price-to'])) {
$where[] = 'price >= ' . $_GET['price-from'];
$where[] = 'price <= ' . $_GET['price-to'];
}
$where[] = 'template = 12';
$childrens = array();
$params['where'] = '["' . implode(' AND ', $where) . '"]';
$output = $modx->runSnippet('pdoResources', $params);
if (!empty($output)) {
$childrens = explode(',', $output);
foreach($childrens as $child_id) {
$all_childrens = $modx->getParentIds($child_id, 2, array());
$id_series = array_pop($all_childrens);
if ($id_series == $id) {
return $modx->setPlaceholders(array(
$key_placeholder => 1,
'child_id' => $child_id
));
}
}
return $modx->setPlaceholders(array(
$key_placeholder => 0
));
}