1.在表products中添加需要定义的字段:products_moq , products_price_term , products_payment_term , products_delivery , products_port ALTER TABLE`products`ADD`products_moq` VARCHAR ( 100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'Negotiable'; ALTER TABLE`products`ADD`products_price_term` VARCHAR ( 100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'FOB / CNF / CIF / Ex-work'; ALTER TABLE`products`ADD`products_payment_term` VARCHAR ( 100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'T/T. / LC / Western Union / Paypal'; ALTER TABLE`products`ADD`products_delivery` VARCHAR ( 100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'Negotiable'; ALTER TABLE`products`ADD`products_port` VARCHAR ( 100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'China Mainland';
2.编辑文件 [collect_info.php](在目录/admin/includes/modules/product/collect_info.php) 'products_moq' => '', 'products_price_term' => '', 'products_payment_term' => '', 'products_delivery' => '', 'products_port' => '' ); 当然,上面1中定义了默认属性,但是并不会在新增商品的时候显示出来,所有需要在此处定义一下,上面的代码修改为: 'products_moq' => 'Negotiable', 'products_price_term' => 'FOB/CNF/CIF/Ex-work', 'products_payment_term' => 'T/T./LC/Western Union/Paypal', 'products_delivery' => 'Negotiable', 'products_port' => 'China Mainland'); 这样默认值就会显示出来. (2)在下边有一个数据库查询: $product = $db->Execute(" 添加你的字段在 [from …] 部分的前边,并且字段前添加[p.]: p.products_moq, p.products_price_term, p.products_payment_term, p.products_delivery, p.products_port from " . TABLE_PRODUCTS ....... (3)现在添加输入框到产品表单中,具体位置自己看情况定,本人添加在了产品型号下面,可以搜索 TEXT_PRODUCTS_MODEL,然后在下面接着添加即可: <tr> <td class="main"><?php echo TEXT_PRODUCTS_MOQ; ?></td> <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_input_field('products_moq', htmlspecialchars(stripslashes($pInfo->products_moq), ENT_COMPAT, CHARSET, TRUE), zen_set_field_length(TABLE_PRODUCTS, 'products_moq')); ?></td>
</tr> <td class="main"><?php echo TEXT_PRODUCTS_Price_Term; ?></td> <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_input_field('products_price_term', htmlspecialchars(stripslashes($pInfo->products_price_term), ENT_COMPAT, CHARSET, TRUE), zen_set_field_length(TABLE_PRODUCTS, 'products_price_term')); ?></td>
</tr> <td class="main"><?php echo TEXT_PRODUCTS_Payment_Term; ?></td> <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_input_field('products_payment_term', htmlspecialchars(stripslashes($pInfo->products_payment_term), ENT_COMPAT, CHARSET, TRUE), zen_set_field_length(TABLE_PRODUCTS, 'products_payment_term')); ?></td>
</tr> <td class="main"><?php echo TEXT_PRODUCTS_Delivery_Lead_Time; ?></td> <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_input_field('products_delivery', htmlspecialchars(stripslashes($pInfo->products_delivery), ENT_COMPAT, CHARSET, TRUE), zen_set_field_length(TABLE_PRODUCTS, 'products_delivery')); ?></td>
</tr> <td class="main"><?php echo TEXT_PRODUCTS_Place_of_Origin; ?></td> <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_input_field('products_port', htmlspecialchars(stripslashes($pInfo->products_port), ENT_COMPAT, CHARSET, TRUE), zen_set_field_length(TABLE_PRODUCTS, 'products_port')); ?></td> </tr> 注意上面用到的TEXT_PRODUCTS_MOQ等等这些常量需要在语言文件中自己定义,语言文件位置:/admin/includes/languages/schinese/product.php和 /admin/includes/languages/english/product.php) 3.编辑文件 [preview_info.php] (在目录 /admin/includes/modules/product/preview_info.php) 找到变量[$product]的定义. 像上边2.2中的一样添加查询字段.
4.编辑 [update_product.php] (在目录/admin/includes/modules/update_product.php)
'products_moq' => zen_db_prepare_input($_POST['products_moq']),
5.编辑 [main_template_vars.php] (在目录/includes/modules/pages/product_info/main_template_vars.php)
6.最后一步:在产品信息中显示。
echo '<li>' . TEXT_PRODUCT_MOQ . $product_info->fields['products_moq'] . '</li>\n'; 其中用到的TEXT_PRODUCT_MOQ等等这些变量,需要在/includes/languages/english/product_info.php以及/includes/languages/schinese/product_info.php中自己定义:
define('TEXT_PRODUCT_MOQ', 'Mimimum order quantity: '); (责任编辑:好模板) |