// Some fix on multishop + stock
This commit is contained in:
1 parent
d3db9d0808
commit
1dc3341748
6 files changed
+16
-19
No files matched your search
@@ -35,7 +35,7 @@
|
|||||||
var iso_user = '{$iso_user}';
|
var iso_user = '{$iso_user}';
|
||||||
var country_iso_code = '{$country_iso_code}';
|
var country_iso_code = '{$country_iso_code}';
|
||||||
var _PS_VERSION_ = '{$smarty.const._PS_VERSION_}';
|
var _PS_VERSION_ = '{$smarty.const._PS_VERSION_}';
|
||||||
|
|
||||||
var helpboxes = {$help_box};
|
var helpboxes = {$help_box};
|
||||||
var roundMode = {$round_mode};
|
var roundMode = {$round_mode};
|
||||||
{if isset($shop_context)}
|
{if isset($shop_context)}
|
||||||
@@ -77,7 +77,7 @@
|
|||||||
<script type="text/javascript" src="{$js_uri}"></script>
|
<script type="text/javascript" src="{$js_uri}"></script>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<link rel="shortcut icon" href="{$img_dir}favicon.ico" />
|
<link rel="shortcut icon" href="{$img_dir}favicon.ico" />
|
||||||
{if $display_header}
|
{if $display_header}
|
||||||
{$HOOK_HEADER}
|
{$HOOK_HEADER}
|
||||||
@@ -216,13 +216,13 @@
|
|||||||
{l s='For security reasons, you must also:'} {l s='delete the /install folder'}
|
{l s='For security reasons, you must also:'} {l s='delete the /install folder'}
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{if $display_header && $is_multishop && $shop_context != 'all'}
|
{if $display_header && $is_multishop && $shop_context != 'all'}
|
||||||
<div class="multishop_info">
|
<div class="multishop_info">
|
||||||
{if $shop_context == 'group'}
|
{if $shop_context == 'group'}
|
||||||
{l s='You are configuring your store for group shop'} <b> {$group_shop->name}</b>
|
{l s='You are configuring your store for group shop '} <b>{$group_shop->name}</b>
|
||||||
{elseif $shop_context == 'shop'}
|
{elseif $shop_context == 'shop'}
|
||||||
{l s='You are configuring your store for shop'} <b> {$shop->name}</b>
|
{l s='You are configuring your store for shop '} <b>{$shop->name}</b>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
@@ -596,7 +596,7 @@ class CategoryCore extends ObjectModel
|
|||||||
return (int)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql);
|
return (int)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = 'SELECT p.*, sa.out_of_stock, stock.quantity, pa.`id_product_attribute`, pl.`description`, pl.`description_short`, pl.`available_now`,
|
$sql = 'SELECT p.*, stock.out_of_stock, stock.quantity, pa.`id_product_attribute`, pl.`description`, pl.`description_short`, pl.`available_now`,
|
||||||
pl.`available_later`, pl.`link_rewrite`, pl.`meta_description`, pl.`meta_keywords`, pl.`meta_title`, pl.`name`, i.`id_image`,
|
pl.`available_later`, pl.`link_rewrite`, pl.`meta_description`, pl.`meta_keywords`, pl.`meta_title`, pl.`name`, i.`id_image`,
|
||||||
il.`legend`, m.`name` AS manufacturer_name, tl.`name` AS tax_name, t.`rate`, cl.`name` AS category_default,
|
il.`legend`, m.`name` AS manufacturer_name, tl.`name` AS tax_name, t.`rate`, cl.`name` AS category_default,
|
||||||
DATEDIFF(p.`date_add`, DATE_SUB(NOW(),
|
DATEDIFF(p.`date_add`, DATE_SUB(NOW(),
|
||||||
@@ -634,9 +634,6 @@ class CategoryCore extends ObjectModel
|
|||||||
AND tl.`id_lang` = '.(int)$id_lang.')
|
AND tl.`id_lang` = '.(int)$id_lang.')
|
||||||
LEFT JOIN `'._DB_PREFIX_.'manufacturer` m
|
LEFT JOIN `'._DB_PREFIX_.'manufacturer` m
|
||||||
ON m.`id_manufacturer` = p.`id_manufacturer`
|
ON m.`id_manufacturer` = p.`id_manufacturer`
|
||||||
LEFT JOIN `'._DB_PREFIX_.'stock_available` sa
|
|
||||||
ON sa.`id_product` = p.`id_product`
|
|
||||||
AND sa.id_product_attribute = 0
|
|
||||||
WHERE cp.`id_category` = '.(int)$this->id
|
WHERE cp.`id_category` = '.(int)$this->id
|
||||||
.($active ? ' AND p.`active` = 1' : '')
|
.($active ? ' AND p.`active` = 1' : '')
|
||||||
.($id_supplier ? ' AND p.id_supplier = '.(int)$id_supplier : '').
|
.($id_supplier ? ' AND p.id_supplier = '.(int)$id_supplier : '').
|
||||||
|
|||||||
@@ -230,7 +230,7 @@ class SupplierCore extends ObjectModel
|
|||||||
|
|
||||||
$nb_days_new_product = Validate::isUnsignedInt(Configuration::get('PS_NB_DAYS_NEW_PRODUCT')) ? Configuration::get('PS_NB_DAYS_NEW_PRODUCT') : 20;
|
$nb_days_new_product = Validate::isUnsignedInt(Configuration::get('PS_NB_DAYS_NEW_PRODUCT')) ? Configuration::get('PS_NB_DAYS_NEW_PRODUCT') : 20;
|
||||||
|
|
||||||
$sql = 'SELECT p.*, sa.out_of_stock,
|
$sql = 'SELECT p.*, stock.out_of_stock,
|
||||||
pl.`description`,
|
pl.`description`,
|
||||||
pl.`description_short`,
|
pl.`description_short`,
|
||||||
pl.`link_rewrite`,
|
pl.`link_rewrite`,
|
||||||
@@ -248,7 +248,7 @@ class SupplierCore extends ObjectModel
|
|||||||
m.`name` AS manufacturer_name
|
m.`name` AS manufacturer_name
|
||||||
FROM `'._DB_PREFIX_.'product` p
|
FROM `'._DB_PREFIX_.'product` p
|
||||||
JOIN `'._DB_PREFIX_.'product_supplier` ps ON (ps.id_product = p.id_product
|
JOIN `'._DB_PREFIX_.'product_supplier` ps ON (ps.id_product = p.id_product
|
||||||
AND ps_id_product_attribute = 0)
|
AND ps.id_product_attribute = 0)
|
||||||
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product`
|
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product`
|
||||||
AND pl.`id_lang` = '.(int)$id_lang.Context::getContext()->shop->addSqlRestrictionOnLang('pl').')
|
AND pl.`id_lang` = '.(int)$id_lang.Context::getContext()->shop->addSqlRestrictionOnLang('pl').')
|
||||||
LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.`id_product` = p.`id_product`
|
LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.`id_product` = p.`id_product`
|
||||||
@@ -264,8 +264,7 @@ class SupplierCore extends ObjectModel
|
|||||||
AND tl.`id_lang` = '.(int)$id_lang.')
|
AND tl.`id_lang` = '.(int)$id_lang.')
|
||||||
LEFT JOIN `'._DB_PREFIX_.'supplier` s ON s.`id_supplier` = p.`id_supplier`
|
LEFT JOIN `'._DB_PREFIX_.'supplier` s ON s.`id_supplier` = p.`id_supplier`
|
||||||
LEFT JOIN `'._DB_PREFIX_.'manufacturer` m ON m.`id_manufacturer` = p.`id_manufacturer`
|
LEFT JOIN `'._DB_PREFIX_.'manufacturer` m ON m.`id_manufacturer` = p.`id_manufacturer`
|
||||||
LEFT JOIN `'._DB_PREFIX_.'stock_available` sa ON (sa.`id_product` = p.`id_product`
|
'.Product::sqlStock('p').'
|
||||||
AND sa.id_product_attribute = 0)
|
|
||||||
WHERE ps.`id_supplier` = '.(int)$id_supplier.
|
WHERE ps.`id_supplier` = '.(int)$id_supplier.
|
||||||
($active ? ' AND p.`active` = 1' : '').'
|
($active ? ' AND p.`active` = 1' : '').'
|
||||||
AND p.`id_product` IN (
|
AND p.`id_product` IN (
|
||||||
|
|||||||
@@ -286,6 +286,7 @@ class AdminShopControllerCore extends AdminController
|
|||||||
'scene' => $this->l('Scenes'),
|
'scene' => $this->l('Scenes'),
|
||||||
'stock' => $this->l('Stock'),
|
'stock' => $this->l('Stock'),
|
||||||
'store' => $this->l('Stores'),
|
'store' => $this->l('Stores'),
|
||||||
|
'warehouse' => $this->l('Warehouse'),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!$this->object->id)
|
if (!$this->object->id)
|
||||||
|
|||||||
@@ -45,6 +45,10 @@ class AdminShopUrlControllerCore extends AdminController
|
|||||||
'align' => 'center',
|
'align' => 'center',
|
||||||
'width' => 25
|
'width' => 25
|
||||||
),
|
),
|
||||||
|
'shop_name' => array(
|
||||||
|
'title' => $this->l('Shop name'),
|
||||||
|
'width' => 70
|
||||||
|
),
|
||||||
'domain' => array(
|
'domain' => array(
|
||||||
'title' => $this->l('Domain'),
|
'title' => $this->l('Domain'),
|
||||||
'width' => 'auto',
|
'width' => 'auto',
|
||||||
@@ -60,10 +64,6 @@ class AdminShopUrlControllerCore extends AdminController
|
|||||||
'width' => 200,
|
'width' => 200,
|
||||||
'filter_key' => 'uri'
|
'filter_key' => 'uri'
|
||||||
),
|
),
|
||||||
'shop_name' => array(
|
|
||||||
'title' => $this->l('Shop name'),
|
|
||||||
'width' => 70
|
|
||||||
),
|
|
||||||
'main' => array(
|
'main' => array(
|
||||||
'title' => $this->l('Main URL'),
|
'title' => $this->l('Main URL'),
|
||||||
'align' => 'center',
|
'align' => 'center',
|
||||||
|
|||||||
@@ -323,8 +323,8 @@ class AuthControllerCore extends FrontController
|
|||||||
|
|
||||||
// Preparing customer
|
// Preparing customer
|
||||||
$customer = new Customer();
|
$customer = new Customer();
|
||||||
$_POST['lastname'] = $_POST['customer_lastname'];
|
$_POST['lastname'] = Tools::getValue('customer_lastname');
|
||||||
$_POST['firstname'] = $_POST['customer_firstname'];
|
$_POST['firstname'] = Tools::getValue('customer_firstname');
|
||||||
if (!Tools::getValue('phone') && !Tools::getValue('phone_mobile') && Configuration::get('PS_REGISTRATION_PROCESS_TYPE'))
|
if (!Tools::getValue('phone') && !Tools::getValue('phone_mobile') && Configuration::get('PS_REGISTRATION_PROCESS_TYPE'))
|
||||||
$this->errors[] = Tools::displayError('You must register at least one phone number');
|
$this->errors[] = Tools::displayError('You must register at least one phone number');
|
||||||
$this->errors = array_unique(array_merge($this->errors, $customer->validateController()));
|
$this->errors = array_unique(array_merge($this->errors, $customer->validateController()));
|
||||||
|
|||||||
Reference in new issue
Block a user