Разные цены для разных доменов
This commit is contained in:
@@ -616,6 +616,25 @@ class ControllerCatalogProduct extends Controller {
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
$this->load->model('setting/store');
|
||||||
|
|
||||||
|
$stores = array();
|
||||||
|
$stores[] = array(
|
||||||
|
'store_id' => 0,
|
||||||
|
'name' => $this->language->get('text_default')
|
||||||
|
);
|
||||||
|
|
||||||
|
$store_results = $this->model_setting_store->getStores();
|
||||||
|
|
||||||
|
foreach ($store_results as $store) {
|
||||||
|
$stores[] = array(
|
||||||
|
'store_id' => $store['store_id'],
|
||||||
|
'name' => $store['name']
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$data['stores'] = $stores;
|
||||||
|
|
||||||
$this->load->model('tool/image');
|
$this->load->model('tool/image');
|
||||||
|
|
||||||
$product_total = $this->model_catalog_product->getTotalProducts($filter_data);
|
$product_total = $this->model_catalog_product->getTotalProducts($filter_data);
|
||||||
@@ -641,18 +660,34 @@ class ControllerCatalogProduct extends Controller {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$product_stores = $this->model_catalog_product->getProductStores($result['product_id']);
|
||||||
|
$product_prices = $this->model_catalog_product->getProductPrices($result['product_id']);
|
||||||
|
|
||||||
|
$prices_html = '';
|
||||||
|
|
||||||
|
foreach ($stores as $store) {
|
||||||
|
$store_id = $store['store_id'];
|
||||||
|
if (isset($product_prices[$store_id])) {
|
||||||
|
$p = $this->currency->format($product_prices[$store_id]['price'], $this->config->get('config_currency'));
|
||||||
|
$p2 = $this->currency->format($product_prices[$store_id]['price_2'], $this->config->get('config_currency'));
|
||||||
|
$p3 = $this->currency->format($product_prices[$store_id]['price_3'], $this->config->get('config_currency'));
|
||||||
|
$prices_html .= '<div style="margin-bottom:2px;"><small>' . $store['name'] . ':</small> ' . $p . ' / ' . $p2 . ' / ' . $p3 . '</div>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$data['products'][] = array(
|
$data['products'][] = array(
|
||||||
'product_id' => $result['product_id'],
|
'product_id' => $result['product_id'],
|
||||||
'image' => $image,
|
'image' => $image,
|
||||||
'name' => $result['name'],
|
'name' => $result['name'],
|
||||||
'model' => $result['model'],
|
|
||||||
'price' => $this->currency->format($result['price'], $this->config->get('config_currency')),
|
'price' => $this->currency->format($result['price'], $this->config->get('config_currency')),
|
||||||
|
'prices_html' => $prices_html,
|
||||||
'special' => $special,
|
'special' => $special,
|
||||||
'quantity' => $result['quantity'],
|
'quantity' => $result['quantity'],
|
||||||
'status' => $result['status'] ? $this->language->get('text_enabled_short') : $this->language->get('text_disabled_short'),
|
'status' => $result['status'] ? $this->language->get('text_enabled_short') : $this->language->get('text_disabled_short'),
|
||||||
'noindex' => $result['noindex'] ? $this->language->get('text_enabled_short') : $this->language->get('text_disabled_short'),
|
'noindex' => $result['noindex'] ? $this->language->get('text_enabled_short') : $this->language->get('text_disabled_short'),
|
||||||
'href_shop' => HTTP_CATALOG . 'index.php?route=product/product&product_id=' . $result['product_id'],
|
'href_shop' => HTTP_CATALOG . 'index.php?route=product/product&product_id=' . $result['product_id'],
|
||||||
'edit' => $this->url->link('catalog/product/edit', 'user_token=' . $this->session->data['user_token'] . '&product_id=' . $result['product_id'] . $url, true)
|
'edit' => $this->url->link('catalog/product/edit', 'user_token=' . $this->session->data['user_token'] . '&product_id=' . $result['product_id'] . $url, true),
|
||||||
|
'product_stores' => $product_stores
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -742,7 +777,6 @@ class ControllerCatalogProduct extends Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$data['sort_name'] = $this->url->link('catalog/product', 'user_token=' . $this->session->data['user_token'] . '&sort=pd.name' . $url, true);
|
$data['sort_name'] = $this->url->link('catalog/product', 'user_token=' . $this->session->data['user_token'] . '&sort=pd.name' . $url, true);
|
||||||
$data['sort_model'] = $this->url->link('catalog/product', 'user_token=' . $this->session->data['user_token'] . '&sort=p.model' . $url, true);
|
|
||||||
$data['sort_price'] = $this->url->link('catalog/product', 'user_token=' . $this->session->data['user_token'] . '&sort=p.price' . $url, true);
|
$data['sort_price'] = $this->url->link('catalog/product', 'user_token=' . $this->session->data['user_token'] . '&sort=p.price' . $url, true);
|
||||||
$data['sort_quantity'] = $this->url->link('catalog/product', 'user_token=' . $this->session->data['user_token'] . '&sort=p.quantity' . $url, true);
|
$data['sort_quantity'] = $this->url->link('catalog/product', 'user_token=' . $this->session->data['user_token'] . '&sort=p.quantity' . $url, true);
|
||||||
$data['sort_status'] = $this->url->link('catalog/product', 'user_token=' . $this->session->data['user_token'] . '&sort=p.status' . $url, true);
|
$data['sort_status'] = $this->url->link('catalog/product', 'user_token=' . $this->session->data['user_token'] . '&sort=p.status' . $url, true);
|
||||||
@@ -1087,6 +1121,14 @@ class ControllerCatalogProduct extends Controller {
|
|||||||
$data['product_store'] = array(0);
|
$data['product_store'] = array(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset($this->request->post['product_prices'])) {
|
||||||
|
$data['product_prices'] = $this->request->post['product_prices'];
|
||||||
|
} elseif (isset($this->request->get['product_id'])) {
|
||||||
|
$data['product_prices'] = $this->model_catalog_product->getProductPrices($this->request->get['product_id']);
|
||||||
|
} else {
|
||||||
|
$data['product_prices'] = array();
|
||||||
|
}
|
||||||
|
|
||||||
if (isset($this->request->post['shipping'])) {
|
if (isset($this->request->post['shipping'])) {
|
||||||
$data['shipping'] = $this->request->post['shipping'];
|
$data['shipping'] = $this->request->post['shipping'];
|
||||||
} elseif (!empty($product_info)) {
|
} elseif (!empty($product_info)) {
|
||||||
@@ -1685,10 +1727,6 @@ if (isset($this->request->post['price_3'])) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((utf8_strlen($this->request->post['model']) < 1) || (utf8_strlen($this->request->post['model']) > 64)) {
|
|
||||||
$this->error['model'] = $this->language->get('error_model');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($this->request->post['product_seo_url']) && is_array($this->request->post['product_seo_url'])) {
|
if (isset($this->request->post['product_seo_url']) && is_array($this->request->post['product_seo_url'])) {
|
||||||
foreach ($this->request->post['product_seo_url'] as $store_id => &$languages) {
|
foreach ($this->request->post['product_seo_url'] as $store_id => &$languages) {
|
||||||
foreach ($languages as $language_id => &$keyword) {
|
foreach ($languages as $language_id => &$keyword) {
|
||||||
@@ -1819,6 +1857,36 @@ if (isset($this->request->post['price_3'])) {
|
|||||||
return !$this->error;
|
return !$this->error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function toggleStore() {
|
||||||
|
$json = array();
|
||||||
|
|
||||||
|
$this->load->model('catalog/product');
|
||||||
|
|
||||||
|
if (isset($this->request->get['product_id']) && isset($this->request->get['store_id'])) {
|
||||||
|
$product_id = (int)$this->request->get['product_id'];
|
||||||
|
$store_id = (int)$this->request->get['store_id'];
|
||||||
|
|
||||||
|
$product_stores = $this->model_catalog_product->getProductStores($product_id);
|
||||||
|
|
||||||
|
if (in_array($store_id, $product_stores)) {
|
||||||
|
$this->db->query("DELETE FROM " . DB_PREFIX . "product_to_store WHERE product_id = '" . (int)$product_id . "' AND store_id = '" . (int)$store_id . "'");
|
||||||
|
$json['added'] = false;
|
||||||
|
} else {
|
||||||
|
$this->db->query("INSERT INTO " . DB_PREFIX . "product_to_store SET product_id = '" . (int)$product_id . "', store_id = '" . (int)$store_id . "'");
|
||||||
|
$json['added'] = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->cache->delete('product');
|
||||||
|
|
||||||
|
$json['success'] = true;
|
||||||
|
} else {
|
||||||
|
$json['error'] = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->response->addHeader('Content-Type: application/json');
|
||||||
|
$this->response->setOutput(json_encode($json));
|
||||||
|
}
|
||||||
|
|
||||||
public function autocomplete() {
|
public function autocomplete() {
|
||||||
$json = array();
|
$json = array();
|
||||||
|
|
||||||
|
|||||||
@@ -29,8 +29,10 @@ $_['column_manufacturer'] = 'Производитель';
|
|||||||
$_['column_model'] = 'Код товара';
|
$_['column_model'] = 'Код товара';
|
||||||
$_['column_image'] = 'Изображение';
|
$_['column_image'] = 'Изображение';
|
||||||
$_['column_price'] = 'Цена';
|
$_['column_price'] = 'Цена';
|
||||||
|
$_['column_prices'] = 'Цены по магазинам';
|
||||||
$_['column_quantity'] = 'Количество';
|
$_['column_quantity'] = 'Количество';
|
||||||
$_['column_status'] = 'Статус';
|
$_['column_status'] = 'Статус';
|
||||||
|
$_['column_stores'] = 'Магазины';
|
||||||
$_['column_noindex'] = 'Индекс';
|
$_['column_noindex'] = 'Индекс';
|
||||||
$_['column_action'] = 'Действие';
|
$_['column_action'] = 'Действие';
|
||||||
|
|
||||||
@@ -58,6 +60,11 @@ $_['entry_location'] = 'Расположение';
|
|||||||
$_['entry_shipping'] = 'Необходима доставка';
|
$_['entry_shipping'] = 'Необходима доставка';
|
||||||
$_['entry_manufacturer'] = 'Производитель';
|
$_['entry_manufacturer'] = 'Производитель';
|
||||||
$_['entry_store'] = 'Магазины';
|
$_['entry_store'] = 'Магазины';
|
||||||
|
$_['entry_store_price'] = 'Цена';
|
||||||
|
$_['entry_store_price_2'] = 'Второй прокат';
|
||||||
|
$_['entry_store_price_3'] = 'Покупка';
|
||||||
|
$_['tab_data'] = 'Данные';
|
||||||
|
$_['tab_prices'] = 'Цены по магазинам';
|
||||||
$_['entry_date_available'] = 'Дата поступления';
|
$_['entry_date_available'] = 'Дата поступления';
|
||||||
$_['entry_quantity'] = 'Количество';
|
$_['entry_quantity'] = 'Количество';
|
||||||
$_['entry_minimum'] = 'Минимальное количество';
|
$_['entry_minimum'] = 'Минимальное количество';
|
||||||
|
|||||||
@@ -22,6 +22,9 @@ class ModelCatalogProduct extends Model {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->load->model('catalog/product_price');
|
||||||
|
$this->model_catalog_product_price->addProductPrices($product_id, $data);
|
||||||
|
|
||||||
if (isset($data['product_attribute'])) {
|
if (isset($data['product_attribute'])) {
|
||||||
foreach ($data['product_attribute'] as $product_attribute) {
|
foreach ($data['product_attribute'] as $product_attribute) {
|
||||||
if ($product_attribute['attribute_id']) {
|
if ($product_attribute['attribute_id']) {
|
||||||
@@ -180,6 +183,9 @@ class ModelCatalogProduct extends Model {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->load->model('catalog/product_price');
|
||||||
|
$this->model_catalog_product_price->editProductPrices($product_id, $data);
|
||||||
|
|
||||||
$this->db->query("DELETE FROM " . DB_PREFIX . "product_attribute WHERE product_id = '" . (int)$product_id . "'");
|
$this->db->query("DELETE FROM " . DB_PREFIX . "product_attribute WHERE product_id = '" . (int)$product_id . "'");
|
||||||
|
|
||||||
if (!empty($data['product_attribute'])) {
|
if (!empty($data['product_attribute'])) {
|
||||||
@@ -379,8 +385,9 @@ class ModelCatalogProduct extends Model {
|
|||||||
$data['product_category'] = $this->getProductCategories($product_id);
|
$data['product_category'] = $this->getProductCategories($product_id);
|
||||||
$data['product_download'] = $this->getProductDownloads($product_id);
|
$data['product_download'] = $this->getProductDownloads($product_id);
|
||||||
$data['product_layout'] = $this->getProductLayouts($product_id);
|
$data['product_layout'] = $this->getProductLayouts($product_id);
|
||||||
$data['product_store'] = $this->getProductStores($product_id);
|
$data['product_store'] = $this->getProductStores($product_id);
|
||||||
$data['product_recurrings'] = $this->getRecurrings($product_id);
|
$data['product_prices'] = $this->getProductPrices($product_id);
|
||||||
|
$data['product_recurrings'] = $this->getRecurrings($product_id);
|
||||||
|
|
||||||
$this->addProduct($data);
|
$this->addProduct($data);
|
||||||
}
|
}
|
||||||
@@ -404,6 +411,7 @@ class ModelCatalogProduct extends Model {
|
|||||||
$this->db->query("DELETE FROM " . DB_PREFIX . "product_to_download WHERE product_id = '" . (int)$product_id . "'");
|
$this->db->query("DELETE FROM " . DB_PREFIX . "product_to_download WHERE product_id = '" . (int)$product_id . "'");
|
||||||
$this->db->query("DELETE FROM " . DB_PREFIX . "product_to_layout WHERE product_id = '" . (int)$product_id . "'");
|
$this->db->query("DELETE FROM " . DB_PREFIX . "product_to_layout WHERE product_id = '" . (int)$product_id . "'");
|
||||||
$this->db->query("DELETE FROM " . DB_PREFIX . "product_to_store WHERE product_id = '" . (int)$product_id . "'");
|
$this->db->query("DELETE FROM " . DB_PREFIX . "product_to_store WHERE product_id = '" . (int)$product_id . "'");
|
||||||
|
$this->db->query("DELETE FROM " . DB_PREFIX . "product_prices WHERE product_id = '" . (int)$product_id . "'");
|
||||||
$this->db->query("DELETE FROM " . DB_PREFIX . "product_recurring WHERE product_id = " . (int)$product_id);
|
$this->db->query("DELETE FROM " . DB_PREFIX . "product_recurring WHERE product_id = " . (int)$product_id);
|
||||||
$this->db->query("DELETE FROM " . DB_PREFIX . "review WHERE product_id = '" . (int)$product_id . "'");
|
$this->db->query("DELETE FROM " . DB_PREFIX . "review WHERE product_id = '" . (int)$product_id . "'");
|
||||||
$this->db->query("DELETE FROM " . DB_PREFIX . "seo_url WHERE query = 'product_id=" . (int)$product_id . "'");
|
$this->db->query("DELETE FROM " . DB_PREFIX . "seo_url WHERE query = 'product_id=" . (int)$product_id . "'");
|
||||||
@@ -723,6 +731,11 @@ class ModelCatalogProduct extends Model {
|
|||||||
return $product_store_data;
|
return $product_store_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getProductPrices($product_id) {
|
||||||
|
$this->load->model('catalog/product_price');
|
||||||
|
return $this->model_catalog_product_price->getProductPrices($product_id);
|
||||||
|
}
|
||||||
|
|
||||||
public function getProductSeoUrls($product_id) {
|
public function getProductSeoUrls($product_id) {
|
||||||
$product_seo_url_data = array();
|
$product_seo_url_data = array();
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
<?php
|
||||||
|
class ModelCatalogProductPrice extends Model {
|
||||||
|
public function addProductPrices($product_id, $data) {
|
||||||
|
if (isset($data['product_prices'])) {
|
||||||
|
foreach ($data['product_prices'] as $store_id => $prices) {
|
||||||
|
$this->db->query("INSERT INTO " . DB_PREFIX . "product_prices SET product_id = '" . (int)$product_id . "', store_id = '" . (int)$store_id . "', price = '" . (float)$prices['price'] . "', price_2 = '" . (float)$prices['price_2'] . "', price_3 = '" . (float)$prices['price_3'] . "'");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function editProductPrices($product_id, $data) {
|
||||||
|
$this->db->query("DELETE FROM " . DB_PREFIX . "product_prices WHERE product_id = '" . (int)$product_id . "'");
|
||||||
|
|
||||||
|
if (isset($data['product_prices'])) {
|
||||||
|
foreach ($data['product_prices'] as $store_id => $prices) {
|
||||||
|
$this->db->query("INSERT INTO " . DB_PREFIX . "product_prices SET product_id = '" . (int)$product_id . "', store_id = '" . (int)$store_id . "', price = '" . (float)$prices['price'] . "', price_2 = '" . (float)$prices['price_2'] . "', price_3 = '" . (float)$prices['price_3'] . "'");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getProductPrices($product_id) {
|
||||||
|
$prices = array();
|
||||||
|
|
||||||
|
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_prices WHERE product_id = '" . (int)$product_id . "'");
|
||||||
|
|
||||||
|
foreach ($query->rows as $row) {
|
||||||
|
$prices[$row['store_id']] = array(
|
||||||
|
'price' => $row['price'],
|
||||||
|
'price_2' => $row['price_2'],
|
||||||
|
'price_3' => $row['price_3']
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $prices;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function deleteProductPrices($product_id) {
|
||||||
|
$this->db->query("DELETE FROM " . DB_PREFIX . "product_prices WHERE product_id = '" . (int)$product_id . "'");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -27,6 +27,7 @@
|
|||||||
<ul class="nav nav-tabs">
|
<ul class="nav nav-tabs">
|
||||||
<li class="active"><a href="#tab-general" data-toggle="tab">{{ tab_general }}</a></li>
|
<li class="active"><a href="#tab-general" data-toggle="tab">{{ tab_general }}</a></li>
|
||||||
<li><a href="#tab-data" data-toggle="tab">{{ tab_data }}</a></li>
|
<li><a href="#tab-data" data-toggle="tab">{{ tab_data }}</a></li>
|
||||||
|
<li><a href="#tab-prices" data-toggle="tab">{{ tab_prices }}</a></li>
|
||||||
<li><a href="#tab-links" data-toggle="tab">{{ tab_links }}</a></li>
|
<li><a href="#tab-links" data-toggle="tab">{{ tab_links }}</a></li>
|
||||||
<li><a href="#tab-attribute" data-toggle="tab">{{ tab_attribute }}</a></li>
|
<li><a href="#tab-attribute" data-toggle="tab">{{ tab_attribute }}</a></li>
|
||||||
<li><a href="#tab-image" data-toggle="tab">{{ tab_image }}</a></li>
|
<li><a href="#tab-image" data-toggle="tab">{{ tab_image }}</a></li>
|
||||||
@@ -104,56 +105,14 @@
|
|||||||
{% endfor %}</div>
|
{% endfor %}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="tab-pane" id="tab-data">
|
<div class="tab-pane" id="tab-data">
|
||||||
<div class="form-group required">
|
<div class="form-group">
|
||||||
<label class="col-sm-2 control-label" for="input-model">{{ entry_model }}</label>
|
<label class="col-sm-2 control-label" for="input-model">{{ entry_model }}</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<input type="text" name="model" value="{{ model }}" placeholder="{{ entry_model }}" id="input-model" class="form-control"/>
|
<input type="text" name="model" value="{{ model }}" placeholder="{{ entry_model }}" id="input-model" class="form-control"/>
|
||||||
{% if error_model %}
|
</div>
|
||||||
<div class="text-danger">{{ error_model }}</div>
|
|
||||||
{% endif %}</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="col-sm-2 control-label" for="input-sku"><span data-toggle="tooltip" title="{{ help_sku }}">{{ entry_sku }}</span></label>
|
|
||||||
<div class="col-sm-10">
|
|
||||||
<input type="text" name="sku" value="{{ sku }}" placeholder="{{ entry_sku }}" id="input-sku" class="form-control"/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="col-sm-2 control-label" for="input-upc"><span data-toggle="tooltip" title="{{ help_upc }}">{{ entry_upc }}</span></label>
|
|
||||||
<div class="col-sm-10">
|
|
||||||
<input type="text" name="upc" value="{{ upc }}" placeholder="{{ entry_upc }}" id="input-upc" class="form-control"/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="col-sm-2 control-label" for="input-ean"><span data-toggle="tooltip" title="{{ help_ean }}">{{ entry_ean }}</span></label>
|
|
||||||
<div class="col-sm-10">
|
|
||||||
<input type="text" name="ean" value="{{ ean }}" placeholder="{{ entry_ean }}" id="input-ean" class="form-control"/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="col-sm-2 control-label" for="input-jan"><span data-toggle="tooltip" title="{{ help_jan }}">{{ entry_jan }}</span></label>
|
|
||||||
<div class="col-sm-10">
|
|
||||||
<input type="text" name="jan" value="{{ jan }}" placeholder="{{ entry_jan }}" id="input-jan" class="form-control"/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="col-sm-2 control-label" for="input-isbn"><span data-toggle="tooltip" title="{{ help_isbn }}">{{ entry_isbn }}</span></label>
|
|
||||||
<div class="col-sm-10">
|
|
||||||
<input type="text" name="isbn" value="{{ isbn }}" placeholder="{{ entry_isbn }}" id="input-isbn" class="form-control"/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="col-sm-2 control-label" for="input-mpn"><span data-toggle="tooltip" title="{{ help_mpn }}">{{ entry_mpn }}</span></label>
|
|
||||||
<div class="col-sm-10">
|
|
||||||
<input type="text" name="mpn" value="{{ mpn }}" placeholder="{{ entry_mpn }}" id="input-mpn" class="form-control"/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="col-sm-2 control-label" for="input-location">{{ entry_location }}</label>
|
|
||||||
<div class="col-sm-10">
|
|
||||||
<input type="text" name="location" value="{{ location }}" placeholder="{{ entry_location }}" id="input-location" class="form-control"/>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-2 control-label" for="input-price">{{ entry_price }}</label>
|
<label class="col-sm-2 control-label" for="input-price">{{ entry_price }}</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
@@ -172,33 +131,7 @@
|
|||||||
<input type="text" name="price_3" value="{{ price_3 }}" placeholder="{{ entry_price_3 }}" id="input-price-3" class="form-control"/>
|
<input type="text" name="price_3" value="{{ price_3 }}" placeholder="{{ entry_price_3 }}" id="input-price-3" class="form-control"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
|
||||||
<label class="col-sm-2 control-label" for="input-tax-class">{{ entry_tax_class }}</label>
|
|
||||||
<div class="col-sm-10">
|
|
||||||
<select name="tax_class_id" id="input-tax-class" class="form-control">
|
|
||||||
<option value="0">{{ text_none }}</option>
|
|
||||||
|
|
||||||
|
|
||||||
{% for tax_class in tax_classes %}
|
|
||||||
{% if tax_class.tax_class_id == tax_class_id %}
|
|
||||||
|
|
||||||
|
|
||||||
<option value="{{ tax_class.tax_class_id }}" selected="selected">{{ tax_class.title }}</option>
|
|
||||||
|
|
||||||
|
|
||||||
{% else %}
|
|
||||||
|
|
||||||
|
|
||||||
<option value="{{ tax_class.tax_class_id }}">{{ tax_class.title }}</option>
|
|
||||||
|
|
||||||
|
|
||||||
{% endif %}
|
|
||||||
{% endfor %}
|
|
||||||
|
|
||||||
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-2 control-label" for="input-quantity">{{ entry_quantity }}</label>
|
<label class="col-sm-2 control-label" for="input-quantity">{{ entry_quantity }}</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
@@ -211,76 +144,7 @@
|
|||||||
<input type="text" name="minimum" value="{{ minimum }}" placeholder="{{ entry_minimum }}" id="input-minimum" class="form-control"/>
|
<input type="text" name="minimum" value="{{ minimum }}" placeholder="{{ entry_minimum }}" id="input-minimum" class="form-control"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
|
||||||
<label class="col-sm-2 control-label" for="input-subtract">{{ entry_subtract }}</label>
|
|
||||||
<div class="col-sm-10">
|
|
||||||
<select name="subtract" id="input-subtract" class="form-control">
|
|
||||||
|
|
||||||
|
|
||||||
{% if subtract %}
|
|
||||||
|
|
||||||
|
|
||||||
<option value="1" selected="selected">{{ text_yes }}</option>
|
|
||||||
<option value="0">{{ text_no }}</option>
|
|
||||||
|
|
||||||
|
|
||||||
{% else %}
|
|
||||||
|
|
||||||
|
|
||||||
<option value="1">{{ text_yes }}</option>
|
|
||||||
<option value="0" selected="selected">{{ text_no }}</option>
|
|
||||||
|
|
||||||
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="col-sm-2 control-label" for="input-stock-status"><span data-toggle="tooltip" title="{{ help_stock_status }}">{{ entry_stock_status }}</span></label>
|
|
||||||
<div class="col-sm-10">
|
|
||||||
<select name="stock_status_id" id="input-stock-status" class="form-control">
|
|
||||||
|
|
||||||
|
|
||||||
{% for stock_status in stock_statuses %}
|
|
||||||
{% if stock_status.stock_status_id == stock_status_id %}
|
|
||||||
|
|
||||||
|
|
||||||
<option value="{{ stock_status.stock_status_id }}" selected="selected">{{ stock_status.name }}</option>
|
|
||||||
|
|
||||||
|
|
||||||
{% else %}
|
|
||||||
|
|
||||||
|
|
||||||
<option value="{{ stock_status.stock_status_id }}">{{ stock_status.name }}</option>
|
|
||||||
|
|
||||||
|
|
||||||
{% endif %}
|
|
||||||
{% endfor %}
|
|
||||||
|
|
||||||
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="col-sm-2 control-label">{{ entry_shipping }}</label>
|
|
||||||
<div class="col-sm-10">
|
|
||||||
<label class="radio-inline"> {% if shipping %}
|
|
||||||
<input type="radio" name="shipping" value="1" checked="checked"/>
|
|
||||||
{{ text_yes }}
|
|
||||||
{% else %}
|
|
||||||
<input type="radio" name="shipping" value="1"/>
|
|
||||||
{{ text_yes }}
|
|
||||||
{% endif %} </label> <label class="radio-inline"> {% if not shipping %}
|
|
||||||
<input type="radio" name="shipping" value="0" checked="checked"/>
|
|
||||||
{{ text_no }}
|
|
||||||
{% else %}
|
|
||||||
<input type="radio" name="shipping" value="0"/>
|
|
||||||
{{ text_no }}
|
|
||||||
{% endif %} </label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-2 control-label" for="input-date-available">{{ entry_date_available }}</label>
|
<label class="col-sm-2 control-label" for="input-date-available">{{ entry_date_available }}</label>
|
||||||
<div class="col-sm-3">
|
<div class="col-sm-3">
|
||||||
@@ -290,80 +154,7 @@
|
|||||||
</span></div>
|
</span></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
|
||||||
<label class="col-sm-2 control-label" for="input-length">{{ entry_dimension }}</label>
|
|
||||||
<div class="col-sm-10">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-sm-4">
|
|
||||||
<input type="text" name="length" value="{{ length }}" placeholder="{{ entry_length }}" id="input-length" class="form-control"/>
|
|
||||||
</div>
|
|
||||||
<div class="col-sm-4">
|
|
||||||
<input type="text" name="width" value="{{ width }}" placeholder="{{ entry_width }}" id="input-width" class="form-control"/>
|
|
||||||
</div>
|
|
||||||
<div class="col-sm-4">
|
|
||||||
<input type="text" name="height" value="{{ height }}" placeholder="{{ entry_height }}" id="input-height" class="form-control"/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="col-sm-2 control-label" for="input-length-class">{{ entry_length_class }}</label>
|
|
||||||
<div class="col-sm-10">
|
|
||||||
<select name="length_class_id" id="input-length-class" class="form-control">
|
|
||||||
|
|
||||||
|
|
||||||
{% for length_class in length_classes %}
|
|
||||||
{% if length_class.length_class_id == length_class_id %}
|
|
||||||
|
|
||||||
|
|
||||||
<option value="{{ length_class.length_class_id }}" selected="selected">{{ length_class.title }}</option>
|
|
||||||
|
|
||||||
|
|
||||||
{% else %}
|
|
||||||
|
|
||||||
|
|
||||||
<option value="{{ length_class.length_class_id }}">{{ length_class.title }}</option>
|
|
||||||
|
|
||||||
|
|
||||||
{% endif %}
|
|
||||||
{% endfor %}
|
|
||||||
|
|
||||||
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="col-sm-2 control-label" for="input-weight">{{ entry_weight }}</label>
|
|
||||||
<div class="col-sm-10">
|
|
||||||
<input type="text" name="weight" value="{{ weight }}" placeholder="{{ entry_weight }}" id="input-weight" class="form-control"/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="col-sm-2 control-label" for="input-weight-class">{{ entry_weight_class }}</label>
|
|
||||||
<div class="col-sm-10">
|
|
||||||
<select name="weight_class_id" id="input-weight-class" class="form-control">
|
|
||||||
|
|
||||||
|
|
||||||
{% for weight_class in weight_classes %}
|
|
||||||
{% if weight_class.weight_class_id == weight_class_id %}
|
|
||||||
|
|
||||||
|
|
||||||
<option value="{{ weight_class.weight_class_id }}" selected="selected">{{ weight_class.title }}</option>
|
|
||||||
|
|
||||||
|
|
||||||
{% else %}
|
|
||||||
|
|
||||||
|
|
||||||
<option value="{{ weight_class.weight_class_id }}">{{ weight_class.title }}</option>
|
|
||||||
|
|
||||||
|
|
||||||
{% endif %}
|
|
||||||
{% endfor %}
|
|
||||||
|
|
||||||
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-2 control-label" for="input-status">{{ entry_status }}</label>
|
<label class="col-sm-2 control-label" for="input-status">{{ entry_status }}</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
@@ -397,6 +188,36 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="tab-pane" id="tab-prices">
|
||||||
|
<div class="table-responsive">
|
||||||
|
<table class="table table-bordered table-hover">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<td class="text-left">{{ entry_store }}</td>
|
||||||
|
<td class="text-left">{{ entry_price }}</td>
|
||||||
|
<td class="text-left">{{ entry_price_2 }}</td>
|
||||||
|
<td class="text-left">{{ entry_price_3 }}</td>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% for store in stores %}
|
||||||
|
<tr>
|
||||||
|
<td class="text-left">{{ store.name }}</td>
|
||||||
|
<td class="text-left">
|
||||||
|
<input type="text" name="product_prices[{{ store.store_id }}][price]" value="{{ product_prices[store.store_id] ? product_prices[store.store_id].price }}" class="form-control" />
|
||||||
|
</td>
|
||||||
|
<td class="text-left">
|
||||||
|
<input type="text" name="product_prices[{{ store.store_id }}][price_2]" value="{{ product_prices[store.store_id] ? product_prices[store.store_id].price_2 }}" class="form-control" />
|
||||||
|
</td>
|
||||||
|
<td class="text-left">
|
||||||
|
<input type="text" name="product_prices[{{ store.store_id }}][price_3]" value="{{ product_prices[store.store_id] ? product_prices[store.store_id].price_3 }}" class="form-control" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="tab-pane" id="tab-links">
|
<div class="tab-pane" id="tab-links">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-2 control-label" for="input-manufacturer"><span data-toggle="tooltip" title="{{ help_manufacturer }}">{{ entry_manufacturer }}</span></label>
|
<label class="col-sm-2 control-label" for="input-manufacturer"><span data-toggle="tooltip" title="{{ help_manufacturer }}">{{ entry_manufacturer }}</span></label>
|
||||||
|
|||||||
@@ -77,18 +77,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!--
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="control-label" for="input-manufacturer-name">{{ entry_manufacturer }}</label>
|
|
||||||
<div class="input-group">
|
|
||||||
<input type="text" name="filter_manufacturer_name" value="{{ filter_manufacturer_name }}" placeholder="{{ entry_manufacturer }}" id="input-manufacturer-name" class="form-control" />
|
|
||||||
<div class="input-group-btn">
|
|
||||||
<button type="button" id="button-clear-input-manufacturer-name" class="btn btn-default"><i class="fa fa-times"></i></button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<input type="hidden" name="filter_manufacturer" value="{{ filter_manufacturer_name }}" id="input-manufacturer" class="form-control" />
|
|
||||||
</div>
|
|
||||||
-->
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label" for="input-price">{{ entry_price }}</label>
|
<label class="control-label" for="input-price">{{ entry_price }}</label>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@@ -135,77 +123,16 @@
|
|||||||
<label class="control-label" for="input-status">{{ entry_status }}</label>
|
<label class="control-label" for="input-status">{{ entry_status }}</label>
|
||||||
<select name="filter_status" id="input-status" class="form-control">
|
<select name="filter_status" id="input-status" class="form-control">
|
||||||
<option value=""></option>
|
<option value=""></option>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{% if filter_status == '1' %}
|
{% if filter_status == '1' %}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<option value="1" selected="selected">{{ text_enabled }}</option>
|
<option value="1" selected="selected">{{ text_enabled }}</option>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<option value="1">{{ text_enabled }}</option>
|
<option value="1">{{ text_enabled }}</option>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if filter_status == '0' %}
|
{% if filter_status == '0' %}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<option value="0" selected="selected">{{ text_disabled }}</option>
|
<option value="0" selected="selected">{{ text_disabled }}</option>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<option value="0">{{ text_disabled }}</option>
|
<option value="0">{{ text_disabled }}</option>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
@@ -245,10 +172,10 @@
|
|||||||
<td style="width: 1px;" class="text-center"><input type="checkbox" onclick="$('input[name*=\'selected\']').prop('checked', this.checked);" /></td>
|
<td style="width: 1px;" class="text-center"><input type="checkbox" onclick="$('input[name*=\'selected\']').prop('checked', this.checked);" /></td>
|
||||||
<td class="text-center">{{ column_image }}</td>
|
<td class="text-center">{{ column_image }}</td>
|
||||||
<td class="text-left">{% if sort == 'pd.name' %} <a href="{{ sort_name }}" class="{{ order|lower }}">{{ column_name }}</a> {% else %} <a href="{{ sort_name }}">{{ column_name }}</a> {% endif %}</td>
|
<td class="text-left">{% if sort == 'pd.name' %} <a href="{{ sort_name }}" class="{{ order|lower }}">{{ column_name }}</a> {% else %} <a href="{{ sort_name }}">{{ column_name }}</a> {% endif %}</td>
|
||||||
<td class="text-left">{% if sort == 'p.model' %} <a href="{{ sort_model }}" class="{{ order|lower }}">{{ column_model }}</a> {% else %} <a href="{{ sort_model }}">{{ column_model }}</a> {% endif %}</td>
|
<td class="text-left">{{ column_prices }}</td>
|
||||||
<td class="text-right">{% if sort == 'p.price' %} <a href="{{ sort_price }}" class="{{ order|lower }}">{{ column_price }}</a> {% else %} <a href="{{ sort_price }}">{{ column_price }}</a> {% endif %}</td>
|
|
||||||
<td class="text-right">{% if sort == 'p.quantity' %} <a href="{{ sort_quantity }}" class="{{ order|lower }}">{{ column_quantity }}</a> {% else %} <a href="{{ sort_quantity }}">{{ column_quantity }}</a> {% endif %}</td>
|
<td class="text-right">{% if sort == 'p.quantity' %} <a href="{{ sort_quantity }}" class="{{ order|lower }}">{{ column_quantity }}</a> {% else %} <a href="{{ sort_quantity }}">{{ column_quantity }}</a> {% endif %}</td>
|
||||||
<td class="text-left">{% if sort == 'p.status' %} <a href="{{ sort_status }}" class="{{ order|lower }}">{{ column_status }}</a> {% else %} <a href="{{ sort_status }}">{{ column_status }}</a> {% endif %}</td>
|
<td class="text-left">{% if sort == 'p.status' %} <a href="{{ sort_status }}" class="{{ order|lower }}">{{ column_status }}</a> {% else %} <a href="{{ sort_status }}">{{ column_status }}</a> {% endif %}</td>
|
||||||
|
<td class="text-left">{{ column_stores }}</td>
|
||||||
<td class="text-left">{% if sort == 'p.noindex' %} <a href="{{ sort_noindex }}" class="{{ order|lower }}">{{ column_noindex }}</a> {% else %} <a href="{{ sort_noindex }}">{{ column_noindex }}</a> {% endif %}</td>
|
<td class="text-left">{% if sort == 'p.noindex' %} <a href="{{ sort_noindex }}" class="{{ order|lower }}">{{ column_noindex }}</a> {% else %} <a href="{{ sort_noindex }}">{{ column_noindex }}</a> {% endif %}</td>
|
||||||
<td class="text-right">{{ column_action }}</td>
|
<td class="text-right">{{ column_action }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -265,14 +192,19 @@
|
|||||||
{% endif %}</td>
|
{% endif %}</td>
|
||||||
<td class="text-center">{% if product.image %} <img src="{{ product.image }}" alt="{{ product.name }}" class="img-thumbnail" /> {% else %} <span class="img-thumbnail list"><i class="fa fa-camera fa-2x"></i></span> {% endif %}</td>
|
<td class="text-center">{% if product.image %} <img src="{{ product.image }}" alt="{{ product.name }}" class="img-thumbnail" /> {% else %} <span class="img-thumbnail list"><i class="fa fa-camera fa-2x"></i></span> {% endif %}</td>
|
||||||
<td class="text-left">{{ product.name }}</td>
|
<td class="text-left">{{ product.name }}</td>
|
||||||
<td class="text-left">{{ product.model }}</td>
|
<td class="text-left">{% if product.prices_html %}{{ product.prices_html }}{% else %}{{ product.price }}{% endif %}</td>
|
||||||
<td class="text-right">{% if product.special %} <span style="text-decoration: line-through;">{{ product.price }}</span><br/>
|
|
||||||
<div class="text-danger">{{ product.special }}</div>
|
|
||||||
{% else %}
|
|
||||||
{{ product.price }}
|
|
||||||
{% endif %}</td>
|
|
||||||
<td class="text-right">{% if product.quantity <= 0 %} <span class="label label-warning">{{ product.quantity }}</span> {% elseif product.quantity <= 5 %} <span class="label label-danger">{{ product.quantity }}</span> {% else %} <span class="label label-success">{{ product.quantity }}</span> {% endif %}</td>
|
<td class="text-right">{% if product.quantity <= 0 %} <span class="label label-warning">{{ product.quantity }}</span> {% elseif product.quantity <= 5 %} <span class="label label-danger">{{ product.quantity }}</span> {% else %} <span class="label label-success">{{ product.quantity }}</span> {% endif %}</td>
|
||||||
<td class="text-left">{{ product.status }}</td>
|
<td class="text-left">{{ product.status }}</td>
|
||||||
|
<td class="text-left">
|
||||||
|
{% for store in stores %}
|
||||||
|
<div class="checkbox" style="margin:0;min-height:0;">
|
||||||
|
<label style="font-size:11px;">
|
||||||
|
<input type="checkbox" class="toggle-store" data-product-id="{{ product.product_id }}" data-store-id="{{ store.store_id }}" value="{{ store.store_id }}"{% if store.store_id in product.product_stores %} checked="checked"{% endif %} />
|
||||||
|
{{ store.name }}
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
</td>
|
||||||
<td class="text-left">{{ product.noindex }}</td>
|
<td class="text-left">{{ product.noindex }}</td>
|
||||||
<td class="text-right">
|
<td class="text-right">
|
||||||
<a target="_blank" href="{{ product.href_shop }}" data-toggle="tooltip" title="{{ button_shop }}" class="btn btn-success"><i class="fa fa-eye"></i></a>
|
<a target="_blank" href="{{ product.href_shop }}" data-toggle="tooltip" title="{{ button_shop }}" class="btn btn-success"><i class="fa fa-eye"></i></a>
|
||||||
@@ -282,7 +214,7 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="text-center" colspan="9">{{ text_no_results }}</td>
|
<td class="text-center" colspan="10">{{ text_no_results }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</tbody>
|
</tbody>
|
||||||
@@ -511,5 +443,22 @@ $('input[name=\'filter_name\'], input[name=\'filter_model\'], input[name=\'filte
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Toggle store for product
|
||||||
|
$(document).on('change', '.toggle-store', function() {
|
||||||
|
var $checkbox = $(this);
|
||||||
|
var product_id = $checkbox.data('product-id');
|
||||||
|
var store_id = $checkbox.data('store-id');
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: 'index.php?route=catalog/product/toggleStore&user_token={{ user_token }}&product_id=' + product_id + '&store_id=' + store_id,
|
||||||
|
dataType: 'json',
|
||||||
|
success: function(json) {
|
||||||
|
if (json.success) {
|
||||||
|
// do nothing, checkbox already changed
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
//--></script></div>
|
//--></script></div>
|
||||||
{{ footer }}
|
{{ footer }}
|
||||||
@@ -8,7 +8,7 @@ class ModelCatalogProduct extends Model {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function getProduct($product_id) {
|
public function getProduct($product_id) {
|
||||||
$query = $this->db->query("SELECT DISTINCT *, pd.name AS name, p.image, p.price_2, p.price_3, p.noindex AS noindex, m.name AS manufacturer, (SELECT price FROM " . DB_PREFIX . "product_discount pd2 WHERE pd2.product_id = p.product_id AND pd2.customer_group_id = '" . (int)$this->config->get('config_customer_group_id') . "' AND pd2.quantity = '1' AND ((pd2.date_start = '0000-00-00' OR pd2.date_start < NOW()) AND (pd2.date_end = '0000-00-00' OR pd2.date_end > NOW())) ORDER BY pd2.priority ASC, pd2.price ASC LIMIT 1) AS discount, (SELECT price FROM " . DB_PREFIX . "product_special ps WHERE ps.product_id = p.product_id AND ps.customer_group_id = '" . (int)$this->config->get('config_customer_group_id') . "' AND ((ps.date_start = '0000-00-00' OR ps.date_start < NOW()) AND (ps.date_end = '0000-00-00' OR ps.date_end > NOW())) ORDER BY ps.priority ASC, ps.price ASC LIMIT 1) AS special, (SELECT points FROM " . DB_PREFIX . "product_reward pr WHERE pr.product_id = p.product_id AND pr.customer_group_id = '" . (int)$this->config->get('config_customer_group_id') . "') AS reward, (SELECT ss.name FROM " . DB_PREFIX . "stock_status ss WHERE ss.stock_status_id = p.stock_status_id AND ss.language_id = '" . (int)$this->config->get('config_language_id') . "') AS stock_status, (SELECT wcd.unit FROM " . DB_PREFIX . "weight_class_description wcd WHERE p.weight_class_id = wcd.weight_class_id AND wcd.language_id = '" . (int)$this->config->get('config_language_id') . "') AS weight_class, (SELECT lcd.unit FROM " . DB_PREFIX . "length_class_description lcd WHERE p.length_class_id = lcd.length_class_id AND lcd.language_id = '" . (int)$this->config->get('config_language_id') . "') AS length_class, (SELECT AVG(rating) AS total FROM " . DB_PREFIX . "review r1 WHERE r1.product_id = p.product_id AND r1.status = '1' GROUP BY r1.product_id) AS rating, (SELECT COUNT(*) AS total FROM " . DB_PREFIX . "review r2 WHERE r2.product_id = p.product_id AND r2.status = '1' GROUP BY r2.product_id) AS reviews, p.sort_order FROM " . DB_PREFIX . "product p LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id) LEFT JOIN " . DB_PREFIX . "product_to_store p2s ON (p.product_id = p2s.product_id) LEFT JOIN " . DB_PREFIX . "manufacturer m ON (p.manufacturer_id = m.manufacturer_id) WHERE p.product_id = '" . (int)$product_id . "' AND pd.language_id = '" . (int)$this->config->get('config_language_id') . "' AND p.status = '1' AND p.date_available <= NOW() AND p2s.store_id = '" . (int)$this->config->get('config_store_id') . "'");
|
$query = $this->db->query("SELECT DISTINCT *, COALESCE(pp.price, p.price) AS price, COALESCE(pp.price_2, p.price_2) AS price_2, COALESCE(pp.price_3, p.price_3) AS price_3, pd.name AS name, p.image, p.noindex AS noindex, m.name AS manufacturer, (SELECT price FROM " . DB_PREFIX . "product_discount pd2 WHERE pd2.product_id = p.product_id AND pd2.customer_group_id = '" . (int)$this->config->get('config_customer_group_id') . "' AND pd2.quantity = '1' AND ((pd2.date_start = '0000-00-00' OR pd2.date_start < NOW()) AND (pd2.date_end = '0000-00-00' OR pd2.date_end > NOW())) ORDER BY pd2.priority ASC, pd2.price ASC LIMIT 1) AS discount, (SELECT price FROM " . DB_PREFIX . "product_special ps WHERE ps.product_id = p.product_id AND ps.customer_group_id = '" . (int)$this->config->get('config_customer_group_id') . "' AND ((ps.date_start = '0000-00-00' OR ps.date_start < NOW()) AND (ps.date_end = '0000-00-00' OR ps.date_end > NOW())) ORDER BY ps.priority ASC, ps.price ASC LIMIT 1) AS special, (SELECT points FROM " . DB_PREFIX . "product_reward pr WHERE pr.product_id = p.product_id AND pr.customer_group_id = '" . (int)$this->config->get('config_customer_group_id') . "') AS reward, (SELECT ss.name FROM " . DB_PREFIX . "stock_status ss WHERE ss.stock_status_id = p.stock_status_id AND ss.language_id = '" . (int)$this->config->get('config_language_id') . "') AS stock_status, (SELECT wcd.unit FROM " . DB_PREFIX . "weight_class_description wcd WHERE p.weight_class_id = wcd.weight_class_id AND wcd.language_id = '" . (int)$this->config->get('config_language_id') . "') AS weight_class, (SELECT lcd.unit FROM " . DB_PREFIX . "length_class_description lcd WHERE p.length_class_id = lcd.length_class_id AND lcd.language_id = '" . (int)$this->config->get('config_language_id') . "') AS length_class, (SELECT AVG(rating) AS total FROM " . DB_PREFIX . "review r1 WHERE r1.product_id = p.product_id AND r1.status = '1' GROUP BY r1.product_id) AS rating, (SELECT COUNT(*) AS total FROM " . DB_PREFIX . "review r2 WHERE r2.product_id = p.product_id AND r2.status = '1' GROUP BY r2.product_id) AS reviews, p.sort_order FROM " . DB_PREFIX . "product p LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id) LEFT JOIN " . DB_PREFIX . "product_to_store p2s ON (p.product_id = p2s.product_id) LEFT JOIN " . DB_PREFIX . "manufacturer m ON (p.manufacturer_id = m.manufacturer_id) LEFT JOIN " . DB_PREFIX . "product_prices pp ON (p.product_id = pp.product_id AND pp.store_id = '" . (int)$this->config->get('config_store_id') . "') WHERE p.product_id = '" . (int)$product_id . "' AND pd.language_id = '" . (int)$this->config->get('config_language_id') . "' AND p.status = '1' AND p.date_available <= NOW() AND p2s.store_id = '" . (int)$this->config->get('config_store_id') . "'");
|
||||||
|
|
||||||
if ($query->num_rows) {
|
if ($query->num_rows) {
|
||||||
return array(
|
return array(
|
||||||
|
|||||||
Reference in New Issue
Block a user