Created
February 22, 2018 08:46
-
-
Save alexsoin/8fae68f66fd786cf71b5159c10d06aee to your computer and use it in GitHub Desktop.
создание товара miniShop2 через процессор
This file contains 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 | |
$response = $modx->runProcessor('resource/create', array( | |
'class_key' => 'msProduct', | |
'pagetitle' => 'Товар', | |
'parent' => 55, | |
'template' => 11, | |
'show_in_tree' => 1, | |
//Данные | |
'price' => 100, | |
'old_price' => 0, | |
'favorite' => 0, | |
'popular' => 0, | |
//стандартные опции товара | |
'color' => array('Синий', 'Красный'), | |
'size' => array('S', 'M'), | |
'tags' => array('Тег1', 'Тег2'), | |
//свои опции созданные в настройках | |
'options-КЛЮЧ_ОПЦИИ' => array('значение1', 'значение2'), | |
//TV - 10 это id TV | |
'tv10' => 'Значение' | |
)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@alexsoin это для создания ресурса пользователем, не для контекстов mgr. Торопился, забыл описание добавить, да и подумал и так понятно, вдруг кому пригодится. Кстати конвертер классный, респект!