Skip to content

Instantly share code, notes, and snippets.

@Tramp1357
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tramp1357/4513865895f198aad588 to your computer and use it in GitHub Desktop.
Save Tramp1357/4513865895f198aad588 to your computer and use it in GitHub Desktop.
// $r - объект категории
$res=$r->getMany('Goods'); //получаем товары категории
foreach($res as $r){
$options=[
'class_key'=>'ShopmodxResourceProduct',
'parent'=>$n,
'pagetitle'=>$r->get('name'),
'published'=>1,
'template'=>3,
'content'=>$content,
'sm_currency'=>79,
'sm_price'=>$r->get('price'),
'tv7'=>$r->get('image'),
];
$modx->runProcessor('resource/create', $options);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment