Отображение цен по магазинам и мультипросмотр товаров на сайтах
This commit is contained in:
@@ -617,11 +617,14 @@ class ControllerCatalogProduct extends Controller {
|
||||
|
||||
|
||||
$this->load->model('setting/store');
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$stores = array();
|
||||
$stores[] = array(
|
||||
'store_id' => 0,
|
||||
'name' => $this->config->get('config_name')
|
||||
'name' => $this->config->get('config_name'),
|
||||
'url' => HTTP_CATALOG,
|
||||
'currency' => $this->config->get('config_currency')
|
||||
);
|
||||
|
||||
$store_results = $this->model_setting_store->getStores();
|
||||
@@ -629,7 +632,9 @@ class ControllerCatalogProduct extends Controller {
|
||||
foreach ($store_results as $store) {
|
||||
$stores[] = array(
|
||||
'store_id' => $store['store_id'],
|
||||
'name' => $store['name']
|
||||
'name' => $store['name'],
|
||||
'url' => $store['url'],
|
||||
'currency' => $this->model_setting_setting->getSettingValue('config_currency', $store['store_id'])
|
||||
);
|
||||
}
|
||||
|
||||
@@ -668,9 +673,9 @@ class ControllerCatalogProduct extends Controller {
|
||||
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'));
|
||||
$p = $this->currency->format($product_prices[$store_id]['price'], $store['currency']);
|
||||
$p2 = $this->currency->format($product_prices[$store_id]['price_2'], $store['currency']);
|
||||
$p3 = $this->currency->format($product_prices[$store_id]['price_3'], $store['currency']);
|
||||
$prices_html .= '<div style="margin-bottom:2px;"><small>' . $store['name'] . ':</small> ' . $p . ' / ' . $p2 . ' / ' . $p3 . '</div>';
|
||||
}
|
||||
}
|
||||
@@ -685,7 +690,6 @@ class ControllerCatalogProduct extends Controller {
|
||||
'quantity' => $result['quantity'],
|
||||
'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'),
|
||||
'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),
|
||||
'product_stores' => $product_stores
|
||||
);
|
||||
@@ -1096,20 +1100,31 @@ class ControllerCatalogProduct extends Controller {
|
||||
}
|
||||
|
||||
$this->load->model('setting/store');
|
||||
$this->load->model('setting/setting');
|
||||
$this->load->model('localisation/currency');
|
||||
|
||||
$currencies = $this->model_localisation_currency->getCurrencies();
|
||||
|
||||
$data['stores'] = array();
|
||||
|
||||
$default_currency = $this->config->get('config_currency');
|
||||
|
||||
$data['stores'][] = array(
|
||||
'store_id' => 0,
|
||||
'name' => $this->config->get('config_name')
|
||||
'name' => $this->config->get('config_name'),
|
||||
'currency' => $default_currency,
|
||||
'symbol' => isset($currencies[$default_currency]) ? $currencies[$default_currency]['symbol_left'] : ''
|
||||
);
|
||||
|
||||
$stores = $this->model_setting_store->getStores();
|
||||
|
||||
foreach ($stores as $store) {
|
||||
$store_currency = $this->model_setting_setting->getSettingValue('config_currency', $store['store_id']);
|
||||
$data['stores'][] = array(
|
||||
'store_id' => $store['store_id'],
|
||||
'name' => $store['name']
|
||||
'name' => $store['name'],
|
||||
'currency' => $store_currency,
|
||||
'symbol' => isset($currencies[$store_currency]) ? $currencies[$store_currency]['symbol_left'] : ''
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user