Перейти до вмісту
Пошук в
  • Детальніше...
Шукати результати, які ...
Шукати результати в ...

[Решено] Error No: 1062 при добавлении новых товаров


stadol

Recommended Posts

Установлено: ocStore-1.5.5.1.2 

 

 

При добавлении новых товаров начала появляться ошибка. Даже если удалить все товары, то при добавлении первых появляется.

 

Notice: Error: Duplicate entry '1862-83' for key 'PRIMARY'
Error No: 1062
INSERT INTO oc_product_to_category SET `product_id` = '1862', `category_id` = '83', `main_category` = 0 in /home/c/comfor2m/zdessvet.ru/public_html/system/database/mysql.php on line 50

 

Надіслати
Поділитися на інших сайтах


Удалил товары в Админ панели в меню Товары.

Расскажите подробнее, пожалуйста, как выполнить:

TRUNCATE TABLE oc_product_to_category. Насколько понимаю, выполняется в БД.

А также как выполнить вот это?

" напишите под спойлером функцию public function addProduct($data) { файла модели: admin\model\catalog\product.php"

 что есть спойлер?

Извиняюсь, но я пока совсем в этом чайник))). Спасибо 

Надіслати
Поділитися на інших сайтах


Вот теперь все ясно

 

да в phpmyadnin выполнить такую SQL

 

или

oc_product_to_category

product_to_category

 

Есть там такая функция очистить таблицу...

 

Только не спрашивайте откуда взялась проблема :)

Надіслати
Поділитися на інших сайтах

Вот функция под спойлером моего файла:

public function addProduct($data) {
		$this->db->query("INSERT INTO " . DB_PREFIX . "product SET model = '" . $this->db->escape($data['model']) . "', sku = '" . $this->db->escape($data['sku']) . "', upc = '" . $this->db->escape($data['upc']) . "', ean = '" . $this->db->escape($data['ean']) . "', jan = '" . $this->db->escape($data['jan']) . "', isbn = '" . $this->db->escape($data['isbn']) . "', mpn = '" . $this->db->escape($data['mpn']) . "', location = '" . $this->db->escape($data['location']) . "', quantity = '" . (int)$data['quantity'] . "', minimum = '" . (int)$data['minimum'] . "', subtract = '" . (int)$data['subtract'] . "', stock_status_id = '" . (int)$data['stock_status_id'] . "', date_available = '" . $this->db->escape($data['date_available']) . "', manufacturer_id = '" . (int)$data['manufacturer_id'] . "', shipping = '" . (int)$data['shipping'] . "', price = '" . (float)$data['price'] . "', points = '" . (int)$data['points'] . "', weight = '" . (float)$data['weight'] . "', weight_class_id = '" . (int)$data['weight_class_id'] . "', length = '" . (float)$data['length'] . "', width = '" . (float)$data['width'] . "', height = '" . (float)$data['height'] . "', length_class_id = '" . (int)$data['length_class_id'] . "', status = '" . (int)$data['status'] . "', tax_class_id = '" . $this->db->escape($data['tax_class_id']) . "', sort_order = '" . (int)$data['sort_order'] . "', date_added = NOW()");
		
		$product_id = $this->db->getLastId();
		
		if (isset($data['image'])) {
			$this->db->query("UPDATE " . DB_PREFIX . "product SET image = '" . $this->db->escape(html_entity_decode($data['image'], ENT_QUOTES, 'UTF-8')) . "' WHERE product_id = '" . (int)$product_id . "'");
		}
		
		foreach ($data['product_description'] as $language_id => $value) {
			$this->db->query("INSERT INTO " . DB_PREFIX . "product_description SET product_id = '" . (int)$product_id . "', language_id = '" . (int)$language_id . "', name = '" . $this->db->escape($value['name']) . "', meta_keyword = '" . $this->db->escape($value['meta_keyword']) . "', meta_description = '" . $this->db->escape($value['meta_description']) . "', description = '" . $this->db->escape($value['description']) . "', tag = '" . $this->db->escape($value['tag']) . "'");
		}
		
		foreach ($data['product_description'] as $language_id => $value) { 
			$this->db->query("UPDATE " . DB_PREFIX . "product_description SET u_title = '" . $this->db->escape($value['u_title']) . "', u_h1 = '". $this->db->escape($value['u_h1']) ."',u_h2 = '". $this->db->escape($value['u_h2']) ."' WHERE product_id = '". (int)$product_id ."' AND language_id = '". (int)$language_id ."'");
		}
		
		if (isset($data['product_store'])) {
			foreach ($data['product_store'] as $store_id) {
				$this->db->query("INSERT INTO " . DB_PREFIX . "product_to_store SET product_id = '" . (int)$product_id . "', store_id = '" . (int)$store_id . "'");
			}
		}

		if (isset($data['product_attribute'])) {
			foreach ($data['product_attribute'] as $product_attribute) {
				if ($product_attribute['attribute_id']) {
					$this->db->query("DELETE FROM " . DB_PREFIX . "product_attribute WHERE product_id = '" . (int)$product_id . "' AND attribute_id = '" . (int)$product_attribute['attribute_id'] . "'");
					
					foreach ($product_attribute['product_attribute_description'] as $language_id => $product_attribute_description) {				
						$this->db->query("INSERT INTO " . DB_PREFIX . "product_attribute SET product_id = '" . (int)$product_id . "', attribute_id = '" . (int)$product_attribute['attribute_id'] . "', language_id = '" . (int)$language_id . "', text = '" .  $this->db->escape($product_attribute_description['text']) . "'");
					}
				}
			}
		}
	
		if (isset($data['product_option'])) {
			foreach ($data['product_option'] as $product_option) {
				if ($product_option['type'] == 'select' || $product_option['type'] == 'radio' || $product_option['type'] == 'checkbox' || $product_option['type'] == 'image') {
					$this->db->query("INSERT INTO " . DB_PREFIX . "product_option SET product_id = '" . (int)$product_id . "', option_id = '" . (int)$product_option['option_id'] . "', required = '" . (int)$product_option['required'] . "'");
				
					$product_option_id = $this->db->getLastId();
				
					if (isset($product_option['product_option_value']) && count($product_option['product_option_value']) > 0 ) {
						foreach ($product_option['product_option_value'] as $product_option_value) {
							$this->db->query("INSERT INTO " . DB_PREFIX . "product_option_value SET 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 = '" . $this->db->escape($product_option_value['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']) . "'");
						} 
					}else{
						$this->db->query("DELETE FROM " . DB_PREFIX . "product_option WHERE product_option_id = '".$product_option_id."'");
					}
				} else { 
					$this->db->query("INSERT INTO " . DB_PREFIX . "product_option SET product_id = '" . (int)$product_id . "', option_id = '" . (int)$product_option['option_id'] . "', option_value = '" . $this->db->escape($product_option['option_value']) . "', required = '" . (int)$product_option['required'] . "'");
				}
			}
		}
		
		if (isset($data['product_discount'])) {
			foreach ($data['product_discount'] as $product_discount) {
				$this->db->query("INSERT INTO " . DB_PREFIX . "product_discount SET product_id = '" . (int)$product_id . "', customer_group_id = '" . (int)$product_discount['customer_group_id'] . "', quantity = '" . (int)$product_discount['quantity'] . "', priority = '" . (int)$product_discount['priority'] . "', price = '" . (float)$product_discount['price'] . "', date_start = '" . $this->db->escape($product_discount['date_start']) . "', date_end = '" . $this->db->escape($product_discount['date_end']) . "'");
			}
		}

		if (isset($data['product_special'])) {
			foreach ($data['product_special'] as $product_special) {
				$this->db->query("INSERT INTO " . DB_PREFIX . "product_special SET product_id = '" . (int)$product_id . "', customer_group_id = '" . (int)$product_special['customer_group_id'] . "', priority = '" . (int)$product_special['priority'] . "', price = '" . (float)$product_special['price'] . "', date_start = '" . $this->db->escape($product_special['date_start']) . "', date_end = '" . $this->db->escape($product_special['date_end']) . "'");
			}
		}
		
		if (isset($data['product_image'])) {
			foreach ($data['product_image'] as $product_image) {
				$this->db->query("INSERT INTO " . DB_PREFIX . "product_image SET product_id = '" . (int)$product_id . "', image = '" . $this->db->escape(html_entity_decode($product_image['image'], ENT_QUOTES, 'UTF-8')) . "', sort_order = '" . (int)$product_image['sort_order'] . "'");
			}
		}
		
		if (isset($data['product_download'])) {
			foreach ($data['product_download'] as $download_id) {
				$this->db->query("INSERT INTO " . DB_PREFIX . "product_to_download SET product_id = '" . (int)$product_id . "', download_id = '" . (int)$download_id . "'");
			}
		}
		
		if (isset($data['product_category'])) {
			foreach ($data['product_category'] as $category_id) {
				$this->db->query("INSERT INTO " . DB_PREFIX . "product_to_category SET product_id = '" . (int)$product_id . "', category_id = '" . (int)$category_id . "'");
			}
		}
		
		if (isset($data['product_filter'])) {
			foreach ($data['product_filter'] as $filter_id) {
				$this->db->query("INSERT INTO " . DB_PREFIX . "product_filter SET product_id = '" . (int)$product_id . "', filter_id = '" . (int)$filter_id . "'");
			}
		}
		
		if (isset($data['main_category_id']) && $data['main_category_id'] > 0) {
			$this->db->query("DELETE FROM " . DB_PREFIX . "product_to_category WHERE product_id = '" . (int)$product_id . "' AND category_id = '" . (int)$data['main_category_id'] . "'");
			$this->db->query("INSERT INTO " . DB_PREFIX . "product_to_category SET product_id = '" . (int)$product_id . "', category_id = '" . (int)$data['main_category_id'] . "', main_category = 1");
		} elseif (isset($data['product_category'][0])) {
			$this->db->query("UPDATE " . DB_PREFIX . "product_to_category SET main_category = 1 WHERE product_id = '" . (int)$product_id . "' AND category_id = '" . (int)$data['product_category'][0] . "'");
		}
		
		if (isset($data['product_related'])) {
			foreach ($data['product_related'] as $related_id) {
				$this->db->query("DELETE FROM " . DB_PREFIX . "product_related WHERE product_id = '" . (int)$product_id . "' AND related_id = '" . (int)$related_id . "'");
				$this->db->query("INSERT INTO " . DB_PREFIX . "product_related SET product_id = '" . (int)$product_id . "', related_id = '" . (int)$related_id . "'");
				$this->db->query("DELETE FROM " . DB_PREFIX . "product_related WHERE product_id = '" . (int)$related_id . "' AND related_id = '" . (int)$product_id . "'");
				$this->db->query("INSERT INTO " . DB_PREFIX . "product_related SET product_id = '" . (int)$related_id . "', related_id = '" . (int)$product_id . "'");
			}
		}

		if (isset($data['product_reward'])) {
			foreach ($data['product_reward'] as $customer_group_id => $product_reward) {
				$this->db->query("INSERT INTO " . DB_PREFIX . "product_reward SET product_id = '" . (int)$product_id . "', customer_group_id = '" . (int)$customer_group_id . "', points = '" . (int)$product_reward['points'] . "'");
			}
		}

		if (isset($data['product_layout'])) {
			foreach ($data['product_layout'] as $store_id => $layout) {
				if ($layout['layout_id']) {
					$this->db->query("INSERT INTO " . DB_PREFIX . "product_to_layout SET product_id = '" . (int)$product_id . "', store_id = '" . (int)$store_id . "', layout_id = '" . (int)$layout['layout_id'] . "'");
				}
			}
		}
						
		if ($data['keyword']) {
			$this->db->query("INSERT INTO " . DB_PREFIX . "url_alias SET query = 'product_id=" . (int)$product_id . "', keyword = '" . $this->db->escape($data['keyword']) . "'");
		}
		$this->cache->delete('url.alias');
		$this->cache->delete('seo_url');				
		$this->cache->delete('product');
		return $product_id;
	}
Надіслати
Поділитися на інших сайтах

Вот теперь все ясно

 

да в phpmyadnin выполнить такую SQL

 

или

oc_product_to_category

product_to_category

 

Есть там такая функция очистить таблицу...

 

Только не спрашивайте откуда взялась проблема :)

Спасибо, буду разбираться))) Подскажите, в итоге, как удалять товары, всегда через БД , как Вы и указали или еще как-то? 

Надіслати
Поділитися на інших сайтах


В SQL выполнил запрос , нажал ок. д

TRUNCATE TABLE oc_product_to_category
Выполнить SQL-запрос(ы) к базе данных comfor2m_87dot.gif
1
 
TRUNCATE TABLE oc_product_to_category
Столбцы  product_id category_id main_category 
 
 
 
[ Разделитель  ]  Показать данный запрос снова Оставить поле запроса
 
 
Дальше зашел в admin\model\catalog\product.php. Вот он:
 
<?php
class ModelCatalogProduct extends Model {
public function addProduct($data) {
$this->db->query("INSERT INTO " . DB_PREFIX . "product SET model = '" . $this->db->escape($data['model']) . "', sku = '" . $this->db->escape($data['sku']) . "', upc = '" . $this->db->escape($data['upc']) . "', ean = '" . $this->db->escape($data['ean']) . "', jan = '" . $this->db->escape($data['jan']) . "', isbn = '" . $this->db->escape($data['isbn']) . "', mpn = '" . $this->db->escape($data['mpn']) . "', location = '" . $this->db->escape($data['location']) . "', quantity = '" . (int)$data['quantity'] . "', minimum = '" . (int)$data['minimum'] . "', subtract = '" . (int)$data['subtract'] . "', stock_status_id = '" . (int)$data['stock_status_id'] . "', date_available = '" . $this->db->escape($data['date_available']) . "', manufacturer_id = '" . (int)$data['manufacturer_id'] . "', shipping = '" . (int)$data['shipping'] . "', price = '" . (float)$data['price'] . "', points = '" . (int)$data['points'] . "', weight = '" . (float)$data['weight'] . "', weight_class_id = '" . (int)$data['weight_class_id'] . "', length = '" . (float)$data['length'] . "', width = '" . (float)$data['width'] . "', height = '" . (float)$data['height'] . "', length_class_id = '" . (int)$data['length_class_id'] . "', status = '" . (int)$data['status'] . "', tax_class_id = '" . $this->db->escape($data['tax_class_id']) . "', sort_order = '" . (int)$data['sort_order'] . "', date_added = NOW()");
 
$product_id = $this->db->getLastId();
 
if (isset($data['image'])) {
$this->db->query("UPDATE " . DB_PREFIX . "product SET image = '" . $this->db->escape(html_entity_decode($data['image'], ENT_QUOTES, 'UTF-8')) . "' WHERE product_id = '" . (int)$product_id . "'");
}
 
foreach ($data['product_description'] as $language_id => $value) {
$this->db->query("INSERT INTO " . DB_PREFIX . "product_description SET product_id = '" . (int)$product_id . "', language_id = '" . (int)$language_id . "', name = '" . $this->db->escape($value['name']) . "', meta_keyword = '" . $this->db->escape($value['meta_keyword']) . "', meta_description = '" . $this->db->escape($value['meta_description']) . "', description = '" . $this->db->escape($value['description']) . "', tag = '" . $this->db->escape($value['tag']) . "', seo_title = '" . $this->db->escape($value['seo_title']) . "', seo_h1 = '" . $this->db->escape($value['seo_h1']) . "'");
}
 
if (isset($data['product_store'])) {
foreach ($data['product_store'] as $store_id) {
$this->db->query("INSERT INTO " . DB_PREFIX . "product_to_store SET product_id = '" . (int)$product_id . "', store_id = '" . (int)$store_id . "'");
}
}
 
if (isset($data['product_attribute'])) {
foreach ($data['product_attribute'] as $product_attribute) {
if ($product_attribute['attribute_id']) {
$this->db->query("DELETE FROM " . DB_PREFIX . "product_attribute WHERE product_id = '" . (int)$product_id . "' AND attribute_id = '" . (int)$product_attribute['attribute_id'] . "'");
 
foreach ($product_attribute['product_attribute_description'] as $language_id => $product_attribute_description) {
$this->db->query("INSERT INTO " . DB_PREFIX . "product_attribute SET product_id = '" . (int)$product_id . "', attribute_id = '" . (int)$product_attribute['attribute_id'] . "', language_id = '" . (int)$language_id . "', text = '" .  $this->db->escape($product_attribute_description['text']) . "'");
}
}
}
}
 
if (isset($data['product_option'])) {
foreach ($data['product_option'] as $product_option) {
if ($product_option['type'] == 'select' || $product_option['type'] == 'radio' || $product_option['type'] == 'checkbox' || $product_option['type'] == 'image') {
$this->db->query("INSERT INTO " . DB_PREFIX . "product_option SET product_id = '" . (int)$product_id . "', option_id = '" . (int)$product_option['option_id'] . "', required = '" . (int)$product_option['required'] . "'");
 
$product_option_id = $this->db->getLastId();
 
if (isset($product_option['product_option_value']) && count($product_option['product_option_value']) > 0 ) {
foreach ($product_option['product_option_value'] as $product_option_value) {
$this->db->query("INSERT INTO " . DB_PREFIX . "product_option_value SET 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 = '" . $this->db->escape($product_option_value['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']) . "'");
}else{
$this->db->query("DELETE FROM " . DB_PREFIX . "product_option WHERE product_option_id = '".$product_option_id."'");
}
} else { 
$this->db->query("INSERT INTO " . DB_PREFIX . "product_option SET product_id = '" . (int)$product_id . "', option_id = '" . (int)$product_option['option_id'] . "', option_value = '" . $this->db->escape($product_option['option_value']) . "', required = '" . (int)$product_option['required'] . "'");
}
}
}
 
 
 
 
 
Вперед вставляю public function addProduct($data) {
сохраняю, открываю, а он в прежнем виде как и был.
 
В общем ничего не изменилось, ошибка та же.
Надіслати
Поділитися на інших сайтах


Очистил таблицу  oc_product_to_category   и  oc _category

выдает теперь такую ошибку:

 

 

Notice: Error: Duplicate entry '1-1' for key 'PRIMARY'
Error No: 1062
INSERT INTO oc_product_description SET `product_id` = '1', `language_id` = '1', `name` = 'Бра BRIZZI 8888/1 AB Leaf crystal', `description` = '', `seo_h1` = 'Бра BRIZZI 8888/1 AB Leaf crystal', `meta_keyword` = '' in /home/c/comfor2m/zdessvet.ru/public_html/system/database/mysql.php on line 50

Надіслати
Поділитися на інших сайтах


интересно в журнал ошибок глянуть или модифицированный возможно вкмодом и там дублирует или же некорректно функция удаления зачищает все таблицы ...

Надіслати
Поділитися на інших сайтах

интересно в журнал ошибок глянуть или модифицированный возможно вкмодом и там дублирует или же некорректно функция удаления зачищает все таблицы ...

В файле admin/uploads/errors.tmp вот что:
The Product passed: Row ~= 1 SKU = Артикул Invalid price of product = МРЦ
 The Product passed: Row ~= 2 SKU =  Invalid price of product = 
 Download main photo fails. Url: http://www.mantra-opt.ru/upload/iblock/ac3/8878-5 PB H-60 D-50 E-14 Leaf crystal.jpg Row ~= 3 SKU = 8878/5 PB Leaf crystal Product passed 
 Main photo not found in price-list.  Row ~= 3 SKU = 8878/5 PB Leaf crystal err = 12 Product passed 
 Download main photo fails. Url: http://www.mantra-opt.ru/upload/iblock/ad6/8878-6 PB H-60 D-55 E-14 Leaf crystal.jpg Row ~= 5 SKU = 8878/6 PB Leaf crystal  Product passed 
 Main photo not found in price-list.  Row ~= 5 SKU = 8878/6 PB Leaf crystal  err = 12 Product passed 
Надіслати
Поділитися на інших сайтах


Раз пошла такая пьянка

 

 

очистить все таблицы

 

oc_product

oc_product_....

 

 

 

oc_category_*

 

 

Ничего не забыл?

Надіслати
Поділитися на інших сайтах

это последние:

 

 in /home/c/comfor2m/zdessvet.ru/public_html/vqmod/vqcache/vq2-admin_model_catalog_suppler.php on line 5629
2014-06-20 17:29:11 - PHP Notice:  Error: Duplicate entry '1860-83' for key 'PRIMARY'<br />Error No: 1062<br />INSERT INTO oc_product_to_category SET `product_id` = '1860', `category_id` = '83', `main_category` = 0 in /home/c/comfor2m/zdessvet.ru/public_html/system/database/mysql.php on line 50
2014-06-20 17:29:15 - PHP Notice:  Error: Duplicate entry '1861-83' for key 'PRIMARY'<br />Error No: 1062<br />INSERT INTO oc_product_to_category SET `product_id` = '1861', `category_id` = '83', `main_category` = 0 in /home/c/comfor2m/zdessvet.ru/public_html/system/database/mysql.php on line 50
2014-06-20 17:29:16 - PHP Notice:  Error: Duplicate entry '1862-83' for key 'PRIMARY'<br />Error No: 1062<br />INSERT INTO oc_product_to_category SET `product_id` = '1862', `category_id` = '83', `main_category` = 0 in /home/c/comfor2m/zdessvet.ru/public_html/system/database/mysql.php on line 50
2014-06-20 19:43:00 - PHP Warning:  file_get_contents(http://www.mantra-opt.ru/upload/iblock/ac3/8878-5 PB H-60 D-50 E-14 Leaf crystal.jpg): failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request
 in /home/c/comfor2m/zdessvet.ru/public_html/vqmod/vqcache/vq2-admin_model_catalog_suppler.php on line 5629
2014-06-20 19:43:00 - PHP Warning:  file_get_contents(http://www.mantra-opt.ru/upload/iblock/ad6/8878-6 PB H-60 D-55 E-14 Leaf crystal.jpg): failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request
 in /home/c/comfor2m/zdessvet.ru/public_html/vqmod/vqcache/vq2-admin_model_catalog_suppler.php on line 5629
2014-06-20 19:43:00 - PHP Notice:  Error: Duplicate entry '1865-83' for key 'PRIMARY'<br />Error No: 1062<br />INSERT INTO oc_product_to_category SET `product_id` = '1865', `category_id` = '83', `main_category` = 0 in /home/c/comfor2m/zdessvet.ru/public_html/system/database/mysql.php on line 50
2014-06-20 19:43:02 - PHP Notice:  Error: Duplicate entry '1866-83' for key 'PRIMARY'<br />Error No: 1062<br />INSERT INTO oc_product_to_category SET `product_id` = '1866', `category_id` = '83', `main_category` = 0 in /home/c/comfor2m/zdessvet.ru/public_html/system/database/mysql.php on line 50
2014-06-20 20:10:24 - PHP Notice:  Error: Duplicate entry '1867-83' for key 'PRIMARY'<br />Error No: 1062<br />INSERT INTO oc_product_to_category SET `product_id` = '1867', `category_id` = '83', `main_category` = 0 in /home/c/comfor2m/zdessvet.ru/public_html/system/database/mysql.php on line 50
2014-06-20 20:35:46 - PHP Notice:  Error: Duplicate entry '1868-83' for key 'PRIMARY'<br />Error No: 1062<br />INSERT INTO oc_product_to_category SET `product_id` = '1868', `category_id` = '83', `main_category` = 0 in /home/c/comfor2m/zdessvet.ru/public_html/system/database/mysql.php on line 50
2014-06-20 20:42:38 - PHP Notice:  Error: Duplicate entry '1869-83' for key 'PRIMARY'<br />Error No: 1062<br />INSERT INTO oc_product_to_category SET `product_id` = '1869', `category_id` = '83', `main_category` = 0 in /home/c/comfor2m/zdessvet.ru/public_html/system/database/mysql.php on line 50
2014-06-20 20:53:30 - PHP Notice:  Error: Duplicate entry '1870-83' for key 'PRIMARY'<br />Error No: 1062<br />INSERT INTO oc_product_to_category SET `product_id` = '1870', `category_id` = '83', `main_category` = 0 in /home/c/comfor2m/zdessvet.ru/public_html/system/database/mysql.php on line 50
2014-06-20 21:04:40 - PHP Notice:  Error: Duplicate entry '1871-83' for key 'PRIMARY'<br />Error No: 1062<br />INSERT INTO oc_product_to_category SET `product_id` = '1871', `category_id` = '83', `main_category` = 0 in /home/c/comfor2m/zdessvet.ru/public_html/system/database/mysql.php on line 50
2014-06-20 21:40:47 - PHP Notice:  Error: Duplicate entry '1872-83' for key 'PRIMARY'<br />Error No: 1062<br />INSERT INTO oc_product_to_category SET `product_id` = '1872', `category_id` = '83', `main_category` = 0 in /home/c/comfor2m/zdessvet.ru/public_html/system/database/mysql.php on line 50
2014-06-20 21:46:50 - PHP Notice:  Error: Duplicate entry '1-83' for key 'PRIMARY'<br />Error No: 1062<br />INSERT INTO oc_product_to_category SET `product_id` = '1', `category_id` = '83', `main_category` = 0 in /home/c/comfor2m/zdessvet.ru/public_html/system/database/mysql.php on line 50
2014-06-20 21:50:56 - PHP Notice:  Error: Duplicate entry '1-1' for key 'PRIMARY'<br />Error No: 1062<br />INSERT INTO oc_product_description SET `product_id` = '1', `language_id` = '1', `name` = 'Бра BRIZZI 8888/1 AB Leaf crystal', `description` = '', `seo_h1` = 'Бра BRIZZI 8888/1 AB Leaf crystal', `meta_keyword` = '' in /home/c/comfor2m/zdessvet.ru/public_html/system/database/mysql.php on line 50
2014-06-20 22:09:06 - PHP Notice:  Error: Duplicate entry '2-83' for key 'PRIMARY'<br />Error No: 1062<br />INSERT INTO oc_product_to_category SET `product_id` = '2', `category_id` = '83', `main_category` = 0 in /home/c/comfor2m/zdessvet.ru/public_html/system/database/mysql.php on line 50
2014-06-20 22:09:09 - PHP Notice:  Error: Duplicate entry '3-83' for key 'PRIMARY'<br />Error No: 1062<br />INSERT INTO oc_product_to_category SET `product_id` = '3', `category_id` = '83', `main_category` = 0 in /home/c/comfor2m/zdessvet.ru/public_html/system/database/mysql.php on line 50
2014-06-20 22:09:14 - PHP Notice:  Error: Duplicate entry '4-83' for key 'PRIMARY'<br />Error No: 1062<br />INSERT INTO oc_product_to_category SET `product_id` = '4', `category_id` = '83', `main_category` = 0 in /home/c/comfor2m/zdessvet.ru/public_html/system/database/mysql.php on line 50
2014-06-20 22:09:15 - PHP Notice:  Error: Duplicate entry '5-83' for key 'PRIMARY'<br />Error No: 1062<br />INSERT INTO oc_product_to_category SET `product_id` = '5', `category_id` = '83', `main_category` = 0 in /home/c/comfor2m/zdessvet.ru/public_html/system/database/mysql.php on line 50
2014-06-20 22:09:15 - PHP Notice:  Error: Duplicate entry '6-83' for key 'PRIMARY'<br />Error No: 1062<br />INSERT INTO oc_product_to_category SET `product_id` = '6', `category_id` = '83', `main_category` = 0 in /home/c/comfor2m/zdessvet.ru/public_html/system/database/mysql.php on line 50
2014-06-20 22:09:16 - PHP Notice:  Error: Duplicate entry '7-83' for key 'PRIMARY'<br />Error No: 1062<br />INSERT INTO oc_product_to_category SET `product_id` = '7', `category_id` = '83', `main_category` = 0 in /home/c/comfor2m/zdessvet.ru/public_html/system/database/mysql.php on line 50
2014-06-20 22:09:17 - PHP Notice:  Error: Duplicate entry '8-83' for key 'PRIMARY'<br />Error No: 1062<br />INSERT INTO oc_product_to_category SET `product_id` = '8', `category_id` = '83', `main_category` = 0 in /home/c/comfor2m/zdessvet.ru/public_html/system/database/mysql.php on line 50
2014-06-20 22:09:17 - PHP Notice:  Error: Duplicate entry '9-83' for key 'PRIMARY'<br />Error No: 1062<br />INSERT INTO oc_product_to_category SET `product_id` = '9', `category_id` = '83', `main_category` = 0 in /home/c/comfor2m/zdessvet.ru/public_html/system/database/mysql.php on line 50
2014-06-20 22:09:18 - PHP Notice:  Error: Duplicate entry '10-83' for key 'PRIMARY'<br />Error No: 1062<br />INSERT INTO oc_product_to_category SET `product_id` = '10', `category_id` = '83', `main_category` = 0 in /home/c/comfor2m/zdessvet.ru/public_html/system/database/mysql.php on line 50
2014-06-20 22:09:18 - PHP Notice:  Error: Duplicate entry '11-83' for key 'PRIMARY'<br />Error No: 1062<br />INSERT INTO oc_product_to_category SET `product_id` = '11', `category_id` = '83', `main_category` = 0 in /home/c/comfor2m/zdessvet.ru/public_html/system/database/mysql.php on line 50
2014-06-20 22:09:19 - PHP Notice:  Error: Duplicate entry '12-83' for key 'PRIMARY'<br />Error No: 1062<br />INSERT INTO oc_product_to_category SET `product_id` = '12', `category_id` = '83', `main_category` = 0 in /home/c/comfor2m/zdessvet.ru/public_html/system/database/mysql.php on line 50
2014-06-20 22:09:20 - PHP Notice:  Error: Duplicate entry '13-83' for key 'PRIMARY'<br />Error No: 1062<br />INSERT INTO oc_product_to_category SET `product_id` = '13', `category_id` = '83', `main_category` = 0 in /home/c/comfor2m/zdessvet.ru/public_html/system/database/mysql.php on line 50
2014-06-20 22:09:20 - PHP Notice:  Error: Duplicate entry '14-83' for key 'PRIMARY'<br />Error No: 1062<br />INSERT INTO oc_product_to_category SET `product_id` = '14', `category_id` = '83', `main_category` = 0 in /home/c/comfor2m/zdessvet.ru/public_html/system/database/mysql.php on line 50
2014-06-20 22:11:10 - PHP Notice:  Undefined index: name in /home/c/comfor2m/zdessvet.ru/public_html/admin/view/template/catalog/product_list.tpl on line 113
2014-06-20 22:11:10 - PHP Notice:  Undefined index: name in /home/c/comfor2m/zdessvet.ru/public_html/admin/view/template/catalog/product_list.tpl on line 113
2014-06-20 22:11:10 - PHP Notice:  Undefined index: name in /home/c/comfor2m/zdessvet.ru/public_html/admin/view/template/catalog/product_list.tpl on line 113
2014-06-20 22:11:10 - PHP Notice:  Undefined index: name in /home/c/comfor2m/zdessvet.ru/public_html/admin/view/template/catalog/product_list.tpl on line 113
2014-06-20 22:11:10 - PHP Notice:  Undefined index: name in /home/c/comfor2m/zdessvet.ru/public_html/admin/view/template/catalog/product_list.tpl on line 113
2014-06-20 22:11:10 - PHP Notice:  Undefined index: name in /home/c/comfor2m/zdessvet.ru/public_html/admin/view/template/catalog/product_list.tpl on line 113
2014-06-20 22:11:10 - PHP Notice:  Undefined index: name in /home/c/comfor2m/zdessvet.ru/public_html/admin/view/template/catalog/product_list.tpl on line 113
2014-06-20 22:11:10 - PHP Notice:  Undefined index: name in /home/c/comfor2m/zdessvet.ru/public_html/admin/view/template/catalog/product_list.tpl on line 113
2014-06-20 22:11:10 - PHP Notice:  Undefined index: name in /home/c/comfor2m/zdessvet.ru/public_html/admin/view/template/catalog/product_list.tpl on line 113
2014-06-20 22:11:10 - PHP Notice:  Undefined index: name in /home/c/comfor2m/zdessvet.ru/public_html/admin/view/template/catalog/product_list.tpl on line 113
2014-06-20 22:11:10 - PHP Notice:  Undefined index: name in /home/c/comfor2m/zdessvet.ru/public_html/admin/view/template/catalog/product_list.tpl on line 113
2014-06-20 22:11:10 - PHP Notice:  Undefined index: name in /home/c/comfor2m/zdessvet.ru/public_html/admin/view/template/catalog/product_list.tpl on line 113
2014-06-20 22:11:10 - PHP Notice:  Undefined index: name in /home/c/comfor2m/zdessvet.ru/public_html/admin/view/template/catalog/product_list.tpl on line 113
2014-06-20 22:11:10 - PHP Notice:  Undefined index: name in /home/c/comfor2m/zdessvet.ru/public_html/admin/view/template/catalog/product_list.tpl on line 113
2014-06-20 22:11:23 - PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/c/comfor2m/zdessvet.ru/public_html/vqmod/vqcache/vq2-admin_model_catalog_product.php:2) in /home/c/comfor2m/zdessvet.ru/public_html/vqmod/vqcache/vq2-system_engine_controller.php on line 28
2014-06-20 22:11:23 - PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/c/comfor2m/zdessvet.ru/public_html/vqmod/vqcache/vq2-admin_model_catalog_product.php:2) in /home/c/comfor2m/zdessvet.ru/public_html/vqmod/vqcache/vq2-system_engine_controller.php on line 29
2014-06-20 22:11:25 - PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/c/comfor2m/zdessvet.ru/public_html/vqmod/vqcache/vq2-admin_model_catalog_product.php:2) in /home/c/comfor2m/zdessvet.ru/public_html/vqmod/vqcache/vq2-system_engine_controller.php on line 28
2014-06-20 22:11:25 - PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/c/comfor2m/zdessvet.ru/public_html/vqmod/vqcache/vq2-admin_model_catalog_product.php:2) in /home/c/comfor2m/zdessvet.ru/public_html/vqmod/vqcache/vq2-system_engine_controller.php on line 29
2014-06-20 22:11:49 - PHP Notice:  Error: Duplicate entry '15-83' for key 'PRIMARY'<br />Error No: 1062<br />INSERT INTO oc_product_to_category SET `product_id` = '15', `category_id` = '83', `main_category` = 0 in /home/c/comfor2m/zdessvet.ru/public_html/system/database/mysql.php on line 50
2014-06-20 22:11:58 - PHP Notice:  Undefined index: name in /home/c/comfor2m/zdessvet.ru/public_html/admin/view/template/catalog/product_list.tpl on line 113
2014-06-20 22:12:37 - PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/c/comfor2m/zdessvet.ru/public_html/vqmod/vqcache/vq2-admin_model_catalog_product.php:2) in /home/c/comfor2m/zdessvet.ru/public_html/vqmod/vqcache/vq2-system_engine_controller.php on line 28
2014-06-20 22:12:37 - PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/c/comfor2m/zdessvet.ru/public_html/vqmod/vqcache/vq2-admin_model_catalog_product.php:2) in /home/c/comfor2m/zdessvet.ru/public_html/vqmod/vqcache/vq2-system_engine_controller.php on line 29
Надіслати
Поділитися на інших сайтах


Раз пошла такая пьянка

 

 

очистить все таблицы

 

oc_product

oc_product_....

 

 

 

oc_category_*

 

 

Ничего не забыл?

oc_product

oc_product_....

 

 

 

oc_category_

oc_category_...

все очистил

 

выдает 

Notice: Error: Duplicate entry '1-1' for key 'PRIMARY'

Error No: 1062

INSERT INTO oc_product_to_category SET `product_id` = '1', `category_id` = '1', `main_category` = 0 in /home/c/comfor2m/zdessvet.ru/public_html/system/database/mysql.php on line 50

 

при этом в товары добавляет только первую позицию, но даже ее на сайте не отображает

Надіслати
Поділитися на інших сайтах


У вас стоят мофикации через vqmod, исходя из ваших логов

vqmod/vqcache/vq2-admin_model_catalog_suppler.php

Вышлите vqmod файлы, скорей всего, запросы дублируются(из-за модификаций vqmod) в модели добавления товаров в админке.

Надіслати
Поділитися на інших сайтах


У вас стоят мофикации через vqmod, исходя из ваших логов

vqmod/vqcache/vq2-admin_model_catalog_suppler.php

Вышлите vqmod файлы, скорей всего, запросы дублируются(из-за модификаций vqmod) в модели добавления товаров в админке.

<?php 
class ModelCatalogSuppler extends Model {
public function createTables() {
$query = $this->db->query("CREATE TABLE IF NOT EXISTS " . DB_PREFIX . "suppler (form_id INT(10) AUTO_INCREMENT, suppler_id INT(11), name varchar(64), sort_order INT(13), rate decimal(12,4), cod varchar(128), item varchar(128), cat varchar(128), qu varchar(128), price varchar(128), descrip varchar(128), pic_ext varchar(64), manuf varchar(128), warranty varchar(64), ad varchar(1), status INT(2), my_cat INT(5), my_qu varchar(128), my_price INT(2), my_descrip varchar(512), my_manuf varchar(64), my_mark varchar(512), weight varchar(3), length varchar(3), width varchar(3), height varchar(3), parent  varchar(1), hide varchar(1), newphoto varchar(1), my_photo varchar(512), cheap varchar(3), addopt varchar(1), addseo varchar(1), related varchar(3), updte varchar(1), pmanuf varchar(1), upattr varchar(1), upopt varchar(1), upname varchar(1), myplus varchar(3), cprice varchar(3), minus varchar(1), chcode varchar(1), importseo varchar(1), sorder  varchar(3), spec varchar(3), upurl varchar(3), ref varchar(3), addattr varchar(1), exsame varchar(1), sku2  varchar(3), parss varchar(3), points varchar(64), places varchar(5), parsi varchar(3), pointi varchar(64), placei varchar(5), parsc varchar(3), pointc varchar(64), placec varchar(5), parsp varchar(3), pointp varchar(64), placep varchar(5), parsd varchar(3), pointd varchar(64), placed varchar(5), parsm varchar(3), pointm varchar(64), placem varchar(5), parsk varchar(3), catcreate varchar(1), stay varchar(1), joen varchar(1), off varchar(1), umanuf varchar(1), onn   varchar(12),  refer varchar(3), disc varchar(12), newurl varchar(1), upc varchar(3), ean varchar(3), mpn varchar(3), ddata varchar(3), bonus varchar(64), ddesc varchar(1), PRIMARY KEY (form_id)) ENGINE=MyISAM DEFAULT CHARSET=utf8");
 
$query = $this->db->query("CREATE TABLE IF NOT EXISTS " . DB_PREFIX . "suppler_data (nom_id int(11) AUTO_INCREMENT, form_id int(11), cat_ext varchar(128), category_id int(11), pic_int varchar(160), cat_plus varchar(512), PRIMARY  KEY (nom_id)) ENGINE=MyISAM DEFAULT CHARSET=utf8");
 
$query = $this->db->query("CREATE TABLE IF NOT EXISTS " . DB_PREFIX . "suppler_attributes (nom_id int(11) AUTO_INCREMENT, form_id int(11), attr_ext varchar(128), attr_point varchar(64), attribute_id int(11), tags varchar(1), PRIMARY KEY (nom_id))  ENGINE=MyISAM DEFAULT CHARSET=utf8");
 
$query = $this->db->query("CREATE TABLE IF NOT EXISTS " . DB_PREFIX . "suppler_options (nom_id int(11) AUTO_INCREMENT, 
form_id int(11), option_id int(11), opt varchar(3), po varchar(3), ko varchar(3), pr varchar(3), we varchar(3), `option_required` varchar(1), PRIMARY KEY (nom_id)) ENGINE=MyISAM DEFAULT CHARSET=utf8");
 
$query = $this->db->query("CREATE TABLE IF NOT EXISTS " . DB_PREFIX . "suppler_sku_description (nom_id int(11) AUTO_INCREMENT, sku_id int(11), sku varchar(128), store_id int(2), PRIMARY  KEY (nom_id)) ENGINE=MyISAM DEFAULT CHARSET=utf8");
 
$query = $this->db->query("CREATE TABLE IF NOT EXISTS " . DB_PREFIX . "suppler_sku (nom_id int(11) AUTO_INCREMENT, sku_id int(11), product_id int(11), PRIMARY  KEY (nom_id)) ENGINE=MyISAM DEFAULT CHARSET=utf8");
 
$query = $this->db->query("CREATE TABLE IF NOT EXISTS " . DB_PREFIX . "relatedoptions (relatedoptions_id int(11) AUTO_INCREMENT, product_id int(11), quantity int(4), PRIMARY  KEY (relatedoptions_id)) ENGINE=MyISAM DEFAULT CHARSET=utf8");
 
$query = $this->db->query("CREATE TABLE IF NOT EXISTS " . DB_PREFIX . "relatedoptions_option  (relatedoptions_id int(11), product_id int(11), option_id int(11), option_value_id int(11)) ENGINE=MyISAM DEFAULT CHARSET=utf8");
 
$query = $this->db->query("CREATE TABLE IF NOT EXISTS " . DB_PREFIX . "relatedoptions_variant  (relatedoptions_variant_id int(11) AUTO_INCREMENT, relatedoptions_variant_name varchar(255), PRIMARY  KEY (relatedoptions_variant_id)) ENGINE=MyISAM DEFAULT CHARSET=utf8");
 
$query = $this->db->query("CREATE TABLE IF NOT EXISTS " . DB_PREFIX . "relatedoptions_variant_option  (relatedoptions_variant_id int(11), option_id int(11)) ENGINE=MyISAM DEFAULT CHARSET=utf8");
 
$query = $this->db->query("CREATE TABLE IF NOT EXISTS " . DB_PREFIX . "relatedoptions_variant_product  (relatedoptions_variant_id int(11), product_id int(11), relatedoptions_use tinyint(1)) ENGINE=MyISAM DEFAULT CHARSET=utf8");
 
$query = $this->db->query("CREATE TABLE IF NOT EXISTS " . DB_PREFIX . "suppler_price (nom_id int(11) AUTO_INCREMENT, form_id int(11), nom varchar(3), ident varchar(16), param varchar(128), point varchar(64),  PRIMARY  KEY (nom_id)) ENGINE=MyISAM DEFAULT CHARSET=utf8");
 
$query = $this->db->query("CREATE TABLE IF NOT EXISTS " . DB_PREFIX . "suppler_ref (nom_id int(11) AUTO_INCREMENT, product_id int(11), ident varchar(16), param varchar(128), point varchar(64), url text, PRIMARY  KEY (nom_id)) ENGINE=MyISAM DEFAULT CHARSET=utf8");
 
$query = $this->db->query("CREATE TABLE IF NOT EXISTS " . DB_PREFIX . "redirect (redirect_id int(11) AUTO_INCREMENT, active tinyint(1) DEFAULT '0', from_url text, to_url text, response_code int(3) DEFAULT '301', date_start date DEFAULT '0000-00-00', date_end date DEFAULT '0000-00-00', times_used int(5) DEFAULT '0', product_id int(11), PRIMARY  KEY (redirect_id)) ENGINE=MyISAM DEFAULT CHARSET=utf8");
 
$query = $this->db->query("CREATE TABLE IF NOT EXISTS " . DB_PREFIX . "suppler_seo (nom_id int(11) AUTO_INCREMENT,  form_id int(11), prod_title varchar(400), prod_meta_desc varchar(400), prod_desc text, cat_title varchar(400), cat_meta_desc varchar(400), cat_desc text, manuf_title varchar(400), manuf_meta_desc varchar(400), manuf_desc text, seo_1 text, seo_2 text, seo_3 text, seo_4 text, seo_5 text, seo_6 text, seo_7 text, seo_8 text, seo_9 text, seo_10 text, seo_11 text, seo_12 text, seo_13 text, seo_14 text, seo_15 text, seo_16 text, seo_17 text, seo_18 text, seo_19 text, seo_20 text, seo_r1 text, seo_r2 text, seo_r3 text, seo_r4 text, seo_r5 text, seo_r6 text, PRIMARY  KEY (nom_id)) ENGINE=MyISAM DEFAULT CHARSET=utf8");
 
$this->cache->delete('suppler');
 
        
$this->cache->delete('seo_pro');
        
      
}
 
public function getMaxSuppler() {
$query = $this->db->query("SELECT max(suppler_id) FROM " . DB_PREFIX . "suppler");
return $query->row;
}
 
public function getMaxCategoryID() {
$query = $this->db->query("SELECT max(category_id) FROM " . DB_PREFIX . "category");
return $query->row;
}
 
public function getMaxManufacturerID() {
$query = $this->db->query("SELECT max(manufacturer_id) FROM " . DB_PREFIX . "manufacturer");
return $query->row;
}
 
public function addSuppler($data) {
if (!isset($data['suppler_id']) or !$data['suppler_id']) {
$row = $this->getMaxSuppler();
if (!empty($row)) $data['suppler_id'] = $row['max(suppler_id)'] + 1;
else $data['suppler_id'] = 1;
}
$data['rate'] = str_replace(',','.',trim($data['rate']));
if (!$data['rate']) $data['rate'] = 1.0;
 
$lang = $this->config->get('config_language_id');
 
      $this->db->query("INSERT INTO " . DB_PREFIX . "suppler SET `suppler_id` = '". $data['suppler_id'] . "', `name` = '" . $this->db->escape($data['name']) . "', `sort_order` = '" . $lang . "', `rate` = '" . $data['rate'] . "', `cod` = '" . $this->db->escape($data['cod']) . "', `item` = '" . $this->db->escape($data['item']) . "', `cat` = '" . $this->db->escape($data['cat']) . "', `qu` = '" . $this->db->escape($data['qu']) . "', `price` = '" . $this->db->escape($data['price']) . "', `descrip` = '" . $this->db->escape($data['descrip']) . "', `pic_ext` = '" . $this->db->escape($data['pic_ext']) . "', `manuf` = '" . $this->db->escape($data['manuf']) . "', `warranty` = '" . $this->db->escape($data['warranty']) . "', `ad` = '" . $data['ad'] . "', `status` = '" . $data['status'] . "', `my_cat` = '" . $data['my_cat'] . "', `my_qu` = '" . $this->db->escape($data['my_qu']) . "', `my_price` = '" . $data['my_price'] . "', `my_descrip` = '" . $this->db->escape($data['my_descrip']) . "', `my_manuf` = '" . $this->db->escape($data['my_manuf']) . "', `my_mark` = '" . $this->db->escape($data['my_mark']) . "', `weight` = '" . $this->db->escape($data['weight']) . "', `length` = '" . $this->db->escape($data['length']) . "', `width` = '" . $this->db->escape($data['width']) . "', `height` = '" . $this->db->escape($data['height']) ."', `parent` = '" . $data['parent'] ."', `hide` = '" . $data['hide'] ."', `newphoto` = '" . $this->db->escape($data['newphoto']) ."', `my_photo` = '" . $this->db->escape($data['my_photo']) ."', `cheap` = '" . $data['cheap'] ."', `addopt` = '" . $data['addopt'] ."', `addseo` = '" . $data['addseo'] . "', `related` = '" . $this->db->escape($data['related']) ."', `updte` = '" . $data['updte'] . "', `pmanuf` = '" . $data['pmanuf'] ."', `upattr` = '" . $data['upattr']."', `upopt` = '" . $data['upopt']. "', `upname` = '" . $data['upname']. "', `myplus` = '" . $data['myplus']. "', `cprice` = '" . $data['cprice']. "', `minus` = '" . $data['minus']. "', `chcode` = '" . $data['chcode']. "',  `importseo` = '" . $data['importseo'] ."', `sorder` = '" . $data['sorder']."', `spec` = '" . $data['spec']."', `upurl` = '" . $data['upurl']."', `ref` = '" . $data['ref']."', `addattr` = '" . $data['addattr'] ."', `exsame` = '" . 0 ."', `sku2` = '" . $data['sku2']."', `parss` = '" . $data['parss'] . "', `points` = '" . $data['points'] . "', `places` = '" . $data['places'] . "', `parsi` = '" . $data['parsi'] . "', `pointi` = '" . $data['pointi'] . "', `placei` = '" . $data['placei'] . "', `parsc` = '" . $data['parsc'] . "', `pointc` = '" . $data['pointc'] . "', `placec` = '" . $data['placec'] . "', `parsp` = '" . $data['parsp'] . "', `pointp` = '" . $data['pointp'] . "', `placep` = '" . $data['placep'] . "', `parsd` = '" . $data['parsd'] . "', `pointd` = '" . $data['pointd'] . "', `placed` = '" . $data['placed'] . "', `parsm` = '" . $data['parsm'] . "', `pointm` = '" . $data['pointm'] . "', `placem` = '" . $data['placem'] . "', `parsk` = '" . $data['parsk'] . "', `catcreate` = '" .  0 . "', `stay` = '" . $data['stay'] . "', `joen` = '" . $data['joen'] . "', `off` = '" . $data['off'] . "', `umanuf` = '" . $data['umanuf'] . "', `onn` = '" . $data['onn'] . "', `refer` = '" . $data['refer'] . "', `disc` = '" . $data['disc'] . "', `newurl` = '" . $data['newurl'] ."', `upc` = '" . $data['upc'] . "', `ean` = '" . $data['ean'] . "', `mpn` = '" . $data['mpn'] . "', `ddata` = '" . 0 ."', `bonus` = '" . $data['bonus'] ."', `ddesc` = '" . $data['ddesc'] ."'");
 
$form_id = $this->db->getLastId();
 
$i = 0;
foreach ($data['cat_ext'] as $value) {
 if ($data['cat_ext'][$i]) {
$this->db->query("INSERT INTO " . DB_PREFIX . "suppler_data SET `form_id` = '" . (int)$form_id . "', `cat_ext` = '" . $this->db->escape($data['cat_ext'][$i]) . "', `category_id` = '" . (int)$data['category_id'][$i] . "', `pic_int` = '" . $data['pic_int'][$i] . "', `cat_plus` = '" . $data['cat_plus'][$i] . "'");
 }
$i = $i +1;
}
 
$i = 0;
foreach ($data['attr_ext'] as $value) {
 if ($data['attr_ext'][$i]) {
$this->db->query("INSERT INTO " . DB_PREFIX . "suppler_attributes SET `form_id` = '" . (int)$form_id . "', `attr_ext` = '" . $this->db->escape($data['attr_ext'][$i]) . "', `attr_point` = '". $this->db->escape($data['attr_point'][$i]) . "', `attribute_id` = '" . (int)$data['attribute_id'][$i] . "', `tags` = '" . $data['tags'][$i] . "'");
 }
$i = $i +1;
}
 
$i = 0;
foreach ($data['opt'] as $value) {
 if ($data['opt'][$i]) {
$this->db->query("INSERT INTO " . DB_PREFIX . "suppler_options SET `form_id` = '" . (int)$form_id . "', `opt` = '" . (int)$data['opt'][$i] . "', `option_id` = '" . (int)$data['option_id'][$i] . "', `po` = '" . $this->db->escape($data['po'][$i]) ."', `ko` = '" . $this->db->escape($data['ko'][$i]) . "', `pr` = '" . $this->db->escape($data['pr'][$i]) ."', `we` = '" . $this->db->escape($data['we'][$i]) ."',   `option_required` = '" . $this->db->escape($data['option_required'][$i]) ."'");
 }
$i = $i +1;
}
 
$i = 0;
foreach ($data['nom'] as $value) {
 if ($data['nom'][$i]) {
$this->db->query("INSERT INTO " . DB_PREFIX . "suppler_price SET `form_id` = '" . (int)$form_id . "', `nom` = '" . $data['nom'][$i] . "', `ident` = '" . $data['ident'][$i] . "', `param` = '" . $this->db->escape($data['param'][$i]) ."', `point` = '" . $this->db->escape($data['point'][$i]) . "'");
 }
$i = $i +1;
}
 
$this->db->query("INSERT INTO " . DB_PREFIX . "suppler_seo SET `form_id` = '" . (int)$form_id . "', `prod_title` = '" . $this->db->escape($data['prod_title']) . "', `prod_meta_desc` = '" . $this->db->escape($data['prod_meta_desc']) ."', `prod_desc` = '" . $this->db->escape($data['prod_desc']) ."', `cat_title` = '" . $this->db->escape($data['cat_title']) ."', `cat_meta_desc` = '" . $this->db->escape($data['cat_meta_desc']) ."', `cat_desc` = '" . $this->db->escape($data['cat_desc']) ."', `manuf_title` = '" . $this->db->escape($data['manuf_title']) ."', `manuf_meta_desc` = '" . $this->db->escape($data['manuf_meta_desc']) ."', `manuf_desc` = '" . $this->db->escape($data['manuf_desc']) ."', `seo_1` = '" . $this->db->escape($data['seo_1']) ."', `seo_2` = '" . $this->db->escape($data['seo_2']) ."', `seo_3` = '" . $this->db->escape($data['seo_3']) ."', `seo_4` = '" . $this->db->escape($data['seo_4']) ."', `seo_5` = '" . $this->db->escape($data['seo_5']) ."', `seo_6` = '" . $this->db->escape($data['seo_6']) ."', `seo_7` = '" . $this->db->escape($data['seo_7']) ."', `seo_8` = '" . $this->db->escape($data['seo_8']) ."', `seo_9` = '" . $this->db->escape($data['seo_9']) ."', `seo_10` = '" . $this->db->escape($data['seo_10']) ."', `seo_11` = '" . $this->db->escape($data['seo_11']) ."', `seo_12` = '" . $this->db->escape($data['seo_12']) ."', `seo_13` = '" . $this->db->escape($data['seo_13']) ."', `seo_14` = '" . $this->db->escape($data['seo_14']) ."', `seo_15` = '" . $this->db->escape($data['seo_15']) ."', `seo_16` = '" . $this->db->escape($data['seo_16']) ."', `seo_17` = '" . $this->db->escape($data['seo_17']) ."', `seo_18` = '" . $this->db->escape($data['seo_18']) ."', `seo_19` = '" . $this->db->escape($data['seo_19']) ."', `seo_20` = '" . $this->db->escape($data['seo_20']) ."'");
 
$this->cache->delete('suppler');
 
        
$this->cache->delete('seo_pro');
Надіслати
Поділитися на інших сайтах


Створіть аккаунт або увійдіть для коментування

Ви повинні бути користувачем, щоб залишити коментар

Створити обліковий запис

Зареєструйтеся для отримання облікового запису. Це просто!

Зареєструвати аккаунт

Вхід

Уже зареєстровані? Увійдіть тут.

Вхід зараз
  • Зараз на сторінці   0 користувачів

    • Ні користувачів, які переглядиють цю сторінку
×
×
  • Створити...

Important Information

На нашому сайті використовуються файли cookie і відбувається обробка деяких персональних даних користувачів, щоб поліпшити користувальницький інтерфейс. Щоб дізнатися для чого і які персональні дані ми обробляємо перейдіть за посиланням . Якщо Ви натиснете «Я даю згоду», це означає, що Ви розумієте і приймаєте всі умови, зазначені в цьому Повідомленні про конфіденційність.