Skip to content

Instantly share code, notes, and snippets.

@OlegShchavelev
Last active May 6, 2020 21:27
Show Gist options
  • Save OlegShchavelev/0b697f5b00ba20ac4fc26a86827cc33e to your computer and use it in GitHub Desktop.
Save OlegShchavelev/0b697f5b00ba20ac4fc26a86827cc33e to your computer and use it in GitHub Desktop.
Получаем опции и тв и работает над выводом.
<?php
$tv_prod_coffee_ids = (explode(',' , $modx->resource->getTVValue('prod_coffee_ids')));
$tv_prod_coffee_sprecial = (explode(',' , $modx->resource->getTVValue('prod_coffee_sprecial')));
$option_coffee_total = explode(',' , $modx->getOption('coffee_total'));
$output = $tv_prod_coffee_sprecial
? $tv_prod_coffee_sprecial
: array_filter(array_unique(array_merge($tv_prod_coffee_ids,$option_coffee_total)));
return (implode(',' , $output));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment