msOptions и астомные поля товара

После добавления ряда полей, с помощью плагина, они появились в админке, заполняются и сохраняются, но не выводятся с помощью msOptions.

Вот файлы плагина(на одинаковые файлы помощи не обращайте внимания)
msproductdata.js
miniShop2.plugin.pluginname = {
	getFields: function(config) {
		return {
			availability: {xtype: 'numberfield', description: '<b></b><br />'+_('ms2_product_availability_help')},
			sostav: {xtype: 'textfield', description: '<b></b><br />'+_('ms2_product_sostav_help')},
			material: {xtype: 'textfield', description: '<b></b><br />'+_('ms2_product_pack_help')},
			pack: {xtype: 'textfield', description: '<b></b><br />'+_('ms2_product_pack_help')},
			fill: {xtype: 'textfield', description: '<b></b><br />'+_('ms2_product_pack_help')},
			inset: {xtype: 'textfield', description: '<b></b><br />'+_('ms2_product_set_help')},
			technic: {xtype: 'textfield', description: '<b></b><br />'+_('ms2_product_pack_help')},
			kanva: {xtype: 'textfield', description: '<b></b><br />'+_('ms2_product_pack_help')},
			kanva_color: {xtype: 'textfield', description: '<b></b><br />'+_('ms2_product_pack_help')},
			picture_type: {xtype: 'textfield', description: '<b></b><br />'+_('ms2_product_pack_help')},
			result: {xtype: 'textfield', description: '<b></b><br />'+_('ms2_product_result_help')},
			use: {xtype: 'textfield', description: '<b></b><br />'+_('ms2_product_use_help')},
		}
	}
	,getColumns: function() {
		return {
			availability: {width:50, sortable:true, editor: {xtype:'numberfield'}},
			sostav: {width:100, sortable:true, editor: {xtype:'textfield'}},
			material: {width:100, sortable:true, editor: {xtype:'textfield'}},
			pack: {width:100, sortable:true, editor: {xtype:'textfield'}},
			fill: {width:100, sortable:true, editor: {xtype:'textfield'}},
			inset: {width:100, sortable:true, editor: {xtype:'textfield'}},
			technic: {width:100, sortable:true, editor: {xtype:'textfield'}},
			kanva:{width:100, sortable:true, editor: {xtype:'textfield'}},
			kanva_color:{width:100, sortable:true, editor: {xtype:'textfield'}},
			picture_type:{width:100, sortable:true, editor: {xtype:'textfield'}},
			result: {width:100, sortable:true, editor: {xtype:'textfield'}},
			use: {width:100, sortable:true, editor: {xtype:'textfield'}}
		}
	}
};
msproductdata.map.inc.php
<?php

return array(
	'fields' => array(
		'availability' => 0,
		'sostav' => NULL,
		'material' => NULL,
		'pack' => NULL,
		'fill' => NULL,
		'inset' => NULL,
		'technic' => NULL,
		'kanva' => NULL,
		'kanva_color' => NULL,
		'picture_type' => NULL,
		'result' => NULL,
		'use' => NULL,
	)
	,'fieldMeta' => array(
		'availability' => array(
			'dbtype' => 'integer'
			,'precision' => '10'
			,'phptype' => 'integer'
			,'null' => true
			,'default' => 0
		),
		'sostav' => array (
      'dbtype' => 'text',
      'phptype' => 'string',
      'null' => true
	  ,'default' => NULL
    ),
		'material' => array (
      'dbtype' => 'text',
      'phptype' => 'string',
      'null' => true
      ,'default' => NULL
    ),
		'pack' => array (
      'dbtype' => 'text',
      'phptype' => 'string',
      'null' => true
      ,'default' => NULL
    ),
		'fill' => array (
      'dbtype' => 'text',
      'phptype' => 'string',
      'null' => true
      ,'default' => NULL
    ),
    'inset' => array (
      'dbtype' => 'text',
      'phptype' => 'string',
      'null' => true
      ,'default' => NULL
    ),
    'technic' => array (
      'dbtype' => 'text',
      'phptype' => 'string',
      'null' => true
      ,'default' => NULL
    ),
    'kanva' => array (
      'dbtype' => 'text',
      'phptype' => 'string',
      'null' => true
      ,'default' => NULL
    ),
    'kanva_color' => array (
      'dbtype' => 'text',
      'phptype' => 'string',
      'null' => true
      ,'default' => NULL
    ),
    'picture_type' => array (
      'dbtype' => 'text',
      'phptype' => 'string',
      'null' => true
      ,'default' => NULL
    ),
    'result' => array (
      'dbtype' => 'text',
      'phptype' => 'string',
      'null' => true
      ,'default' => NULL
    ),
    'use' => array (
      'dbtype' => 'text',
      'phptype' => 'string',
      'null' => true
      ,'default' => NULL
    )
	)
	
	
);
Никита Павлов
24 ноября 2013, 18:57
modx.pro
2 071
0

Комментарии: 5

Clean
24 ноября 2013, 23:13
0
Не смотрел корректность кода. на вскидку — если ты видишь в базе в полях сохраненные значения, значит со стороны бекенда есть профит.
Проверяй вызов MsOption, смотри showLogs, быть может там кроется ошибка?
    Василий Наумкин
    25 ноября 2013, 02:49
    0
    В msProductOption сохраняются не все поля подряд, а только типа JSON.

    Остальные можно выбирать сниппетом msProducts.
      Никита Павлов
      Никита Павлов
      25 ноября 2013, 08:27
      0
      Хм, вчера мне это показалось не кошерным =) В документации бы эти строки хотелось увидеть, конечно. Все равно, спасибо за оперативный ответ.
        Василий Наумкин
        25 ноября 2013, 11:17
        0
        bezumkin.ru/modx/minishop2/admin/742/

        А мне бы хотелось, чтобы документацию читали, но мир не совершенен.
          Никита Павлов
          Никита Павлов
          25 ноября 2013, 14:44
          0
          В документации сказано, что во фронтенде все собственные поля чудом появятся сами. Но чтобы вывести первоначальные свойства товара достаточно либо тегов [[+xxx]] либо msOptions. Поэтому, когда этими средствами вывести собственные поля не получается, начинают возникать подобные вопросы.
      Авторизуйтесь или зарегистрируйтесь, чтобы оставлять комментарии.
      5