注意,下面中出现的文件,可能在vqcache,modification或者源文件 优先vqcache的文件 在 modification 在 源文件
一
admin/language/*/catalog/option.php
在 $_[‘text_success’] 前
添加
$_[‘text_text_price’] = ‘Text Price’;
$_[‘text_text_price_lite’] = ‘Text Price Lite’;
二
admin/controller/catalog/option.php
在 $data[‘text_choose’] 前
添加
$data[‘text_text_price’] = $this->language->get(‘text_text_price’);
$data[‘text_text_price_lite’] = $this->language->get(‘text_text_price_lite’);
在 if ($option[‘type’] == ‘select’ || $option[‘type’] == ‘radio’ || $option[‘type’] == ‘checkbox’ || $option[‘type’] == ‘image’)] 进行 替换
if ($option[‘type’] == ‘select’ || $option[‘type’] == ‘radio’ || $option[‘type’] == ‘checkbox’ || $option[‘type’] == ‘image’|| $option[‘type’] == ‘text_price’ || $option[‘type’] == ‘text_price_lite’)]
三
admin/view/template/catalog/option_form.tpl
在 前
添加
在 (this.value == ‘select’ || this.value == ‘radio’ || this.value == ‘checkbox’ || this.value == ‘image’)
进行 替换 (this.value == ‘select’ || this.value == ‘radio’ || this.value == ‘checkbox’ || this.value == ‘image’ || this.value == ‘text_price’ || this.value == ‘text_price_lite’)
四
admin/view/template/catalog/product_form.tpl
在 ($product_option[‘type’] == ‘select’ || $product_option[‘type’] == ‘radio’ || $product_option[‘type’] == ‘checkbox’ || $product_option[‘type’] == ‘image’)
进行 替换 ($product_option[‘type’] == ‘select’ || $product_option[‘type’] == ‘radio’ || $product_option[‘type’] == ‘checkbox’ || $product_option[‘type’] == ‘image’ || $product_option[‘type’] == ‘text_price’ || $product_option[‘type’] == ‘text_price_lite’)
在 (item[‘type’] == ‘select’ || item[‘type’] == ‘radio’ || item[‘type’] == ‘checkbox’ || item[‘type’] == ‘image’)
进行 替换 (item[‘type’] == ‘select’ || item[‘type’] == ‘radio’ || item[‘type’] == ‘checkbox’ || item[‘type’] == ‘image’ || item[‘type’] == ‘text_price’ || item[‘type’] == ‘text_price_lite’)
五
admin/controller/catalog/product.php
在 if ($product_option[‘type’] == ‘select’ || $product_option[‘type’] == ‘radio’ || $product_option[‘type’] == ‘checkbox’ || $product_option[‘type’] == ‘image’)
进行 替换 if ($product_option[‘type’] == ‘select’ || $product_option[‘type’] == ‘radio’ || $product_option[‘type’] == ‘checkbox’ || $product_option[‘type’] == ‘image’ || $product_option[‘type’] == ‘text_price’ || $product_option[‘type’] == ‘text_price_lite’)
六
admin/model/catalog/product.php
在 if ($product_option[‘type’] == ‘select’ || $product_option[‘type’] == ‘radio’ || $product_option[‘type’] == ‘checkbox’ || $product_option[‘type’] == ‘image’)
进行 替换 if ($product_option[‘type’] == ‘text_price’ || $product_option[‘type’] == ‘text_price_lite’ ) {
if (isset($product_option[‘product_option_value’])) {
$this->db->query(“INSERT INTO ” . DB_PREFIX . “product_option SET product_option_id = ‘” . (int)$product_option[‘product_option_id’] . “‘, product_id = ‘” . (int)$product_id . “‘, option_id = ‘” . (int)$product_option[‘option_id’] . “‘, value = ‘” . $this->db->escape($product_option[‘value’]) . “‘, required = ‘” . (int)$product_option[‘required’] . “‘”);
$product_option_id = $this->db->getLastId();
foreach ($product_option[‘product_option_value’] as $product_option_value) {
$this->db->query(“INSERT INTO ” . DB_PREFIX . “product_option_value SET product_option_value_id = ‘” . (int)$product_option_value[‘product_option_value_id’] . “‘, product_option_id = ‘” . (int)$product_option_id . “‘, product_id = ‘” . (int)$product_id . “‘, option_id = ‘” . (int)$product_option[‘option_id’] . “‘, option_value_id = ‘” . (int)$product_option_value[‘option_value_id’] . “‘, quantity = ‘” . (int)$product_option_value[‘quantity’] . “‘, subtract = ‘” . (int)$product_option_value[‘subtract’] . “‘, price = ‘” . (float)$product_option_value[‘price’] . “‘, price_prefix = ‘+’, points = ‘” . (int)$product_option_value[‘points’] . “‘, points_prefix = ‘” . $this->db->escape($product_option_value[‘points_prefix’]) . “‘, weight = ‘” . (float)$product_option_value[‘weight’] . “‘, weight_prefix = ‘” . $this->db->escape($product_option_value[‘weight_prefix’]) . “‘”);
}
}
} elseif ($product_option[‘type’] == ‘select’ || $product_option[‘type’] == ‘radio’ || $product_option[‘type’] == ‘checkbox’ || $product_option[‘type’] == ‘image’)
七
catalog/controller/product/product.php
在 public function getRecurringDescription 前
添加
public function getProductTextOptions() {
$json = array();
if (isset($this->request->get[‘product_id’])) {
$product_id = $this->request->get[‘product_id’];
}
if (isset($this->request->get[‘option_value_id’])) {
$option_value_id = $this->request->get[‘option_value_id’];
}
$product_option_value_query = $this->db->query(“SELECT * FROM ” . DB_PREFIX . “product_option_value pov LEFT JOIN ” . DB_PREFIX . “option_value ov ON (pov.option_value_id = ov.option_value_id) LEFT JOIN ” . DB_PREFIX . “option_value_description ovd ON (ov.option_value_id = ovd.option_value_id) WHERE pov.product_id = ‘” . (int)$product_id . “‘ AND pov.product_option_value_id = ‘” . (int)$option_value_id . “‘ AND ovd.language_id = ‘” . (int)$this->config->get(‘config_language_id’) . “‘ ORDER BY ov.sort_order”);
foreach ($product_option_value_query->rows as $product_option_value) {
$json[] = array(
‘product_option_value_id’ => $product_option_value[‘product_option_value_id’],
‘option_value_id’ => $product_option_value[‘option_value_id’],
‘name’ => $product_option_value[‘name’],
‘image’ => $product_option_value[‘image’],
‘quantity’ => $product_option_value[‘quantity’],
‘subtract’ => $product_option_value[‘subtract’],
‘price’ => $product_option_value[‘price’],
‘price_prefix’ => $product_option_value[‘price_prefix’],
‘weight’ => $product_option_value[‘weight’],
‘weight_prefix’ => $product_option_value[‘weight_prefix’]
);
}
$this->response->addHeader(‘Content-Type: application/json’);
$this->response->setOutput(json_encode($json));
}
八
catalog/view/theme/*/template/product/product.tpl
在 前
添加