我需要通过查询创建产品功能。我通过管理面板创建了一个产品功能,工作正常。但我需要通过查询创建产品功能。
我对创建产品功能的查询: -
$data = array(
array(
'feature_code' => 'Make1',
'company_id' => '0',
'feature_type' => 'M',
'categories_path' => '',
'parent_id' => '',
'display_on_product' => 'N',
'display_on_catalog' => 'N',
'display_on_header' => 'N',
'status' => 'A',
'position' => '0',
'comparison' => 'N')
);
db_query('INSERT INTO ?:product_features ?m', $data);
$object_id = db_get_field('SELECT LAST_INSERT_ID()');
$data = array(
array(
'feature_id' => $object_id,
'description' => 'Make1',
'full_description' => 'Make1',
'prefix' => '',
'suffix' => '',
'lang_code' => 'en'
)
);
db_query('INSERT INTO ?:product_features_descriptions ?m', $data);
但是这些字段是插入表格的。但我无法在cscart中编辑产品功能详细信息。我能怎么做。请帮帮我。
答案 0 :(得分:0)
请尝试
$data = array(
'feature_code' => 'Make1',
'company_id' => '0',
'feature_type' => 'M',
'categories_path' => '',
'display_on_product' => 'N',
'display_on_catalog' => 'N'
);
$feature_id = db_query('INSERT INTO ?:product_features ?e', $data);
$data = array(
'feature_id' => $feature_id,
'description' => 'Make1',
'full_description' => 'Make1',
'lang_code' => 'en'
);
db_query('INSERT INTO ?:product_features_descriptions ?e', $data);