Merge remote-tracking branch 'origin/development' into development
This commit is contained in:
@@ -160,7 +160,11 @@ class AdminProductsControllerCore extends AdminController
|
||||
if (Validate::isLoadedObject($this->_category) && empty($this->_filter))
|
||||
$join_category = true;
|
||||
|
||||
$this->_join .= 'LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.`id_product` = a.`id_product` '.(!Shop::isFeatureActive() ? ' AND i.cover=1' : '').')';
|
||||
$this->_join .= '
|
||||
LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.`id_product` = a.`id_product` '.(!Shop::isFeatureActive() ? ' AND i.cover=1' : '').')
|
||||
LEFT JOIN `'._DB_PREFIX_.'stock_available` sav ON (sav.`id_product` = a.`id_product` AND sav.`id_product_attribute` = 0
|
||||
'.StockAvailable::addSqlShopRestriction(null, null, 'sav').') ';
|
||||
|
||||
if (Shop::isFeatureActive())
|
||||
{
|
||||
$alias = 'sa';
|
||||
@@ -188,12 +192,13 @@ class AdminProductsControllerCore extends AdminController
|
||||
$this->_join .= 'LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON ('.$alias.'.`id_category_default` = cl.`id_category` AND b.`id_lang` = cl.`id_lang` AND cl.id_shop = 1)';
|
||||
}
|
||||
|
||||
$this->_select .= 'MAX('.$alias_image.'.id_image) id_image,';
|
||||
$this->_select .= 'MAX('.$alias_image.'.id_image) id_image, cl.name `name_category`, '.$alias.'.`price`, 0 AS price_final, sav.`quantity` as sav_quantity, '.$alias.'.`active`';
|
||||
|
||||
$this->_join .= ($join_category ? 'INNER JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_product` = a.`id_product` AND cp.`id_category` = '.(int)$this->_category->id.')' : '').'
|
||||
LEFT JOIN `'._DB_PREFIX_.'stock_available` sav ON (sav.`id_product` = a.`id_product` AND sav.`id_product_attribute` = 0
|
||||
'.StockAvailable::addSqlShopRestriction(null, null, 'sav').') ';
|
||||
$this->_select .= 'cl.name `name_category` '.($join_category ? ', cp.`position`' : '').', '.$alias.'.`price`, 0 AS price_final, sav.`quantity` as sav_quantity, '.$alias.'.`active`';
|
||||
if ($join_category)
|
||||
{
|
||||
$this->_join .= ' INNER JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_product` = a.`id_product` AND cp.`id_category` = '.(int)$this->_category->id.') ';
|
||||
$this->_select .= ' cp.`position`, ';
|
||||
}
|
||||
|
||||
$this->_group = 'GROUP BY '.$alias.'.id_product';
|
||||
|
||||
@@ -270,7 +275,7 @@ class AdminProductsControllerCore extends AdminController
|
||||
'orderby' => false
|
||||
);
|
||||
|
||||
if ((int)$this->id_current_category)
|
||||
if ($join_category && (int)$this->id_current_category)
|
||||
$this->fields_list['position'] = array(
|
||||
'title' => $this->l('Position'),
|
||||
'width' => 70,
|
||||
|
||||
@@ -1060,8 +1060,8 @@ class AdminStockManagementControllerCore extends AdminController
|
||||
{
|
||||
$helper->fields_value['id_warehouse_from'] = Tools::getValue('id_warehouse_from', '');
|
||||
$helper->fields_value['id_warehouse_to'] = Tools::getValue('id_warehouse_to', '');
|
||||
$helper->fields_value['usable_from'] = Tools::getValue('usable_from', '');
|
||||
$helper->fields_value['usable_to'] = Tools::getValue('usable_to', '');
|
||||
$helper->fields_value['usable_from'] = Tools::getValue('usable_from', '1');
|
||||
$helper->fields_value['usable_to'] = Tools::getValue('usable_to', '1');
|
||||
}
|
||||
|
||||
$this->content .= $helper->generateForm($this->fields_form);
|
||||
|
||||
@@ -348,13 +348,12 @@ var ajaxCart = {
|
||||
});
|
||||
});
|
||||
}
|
||||
var removeLinks = $('#cart_block_product_' + domIdProduct).find('.ajax_cart_block_remove_link');
|
||||
|
||||
var removeLinks = $('#' + domIdProduct).find('.ajax_cart_block_remove_link');
|
||||
if (!product.hasCustomizedDatas && !removeLinks.length)
|
||||
{
|
||||
$('#cart_block_product_' + domIdProduct + ' span.remove_link').html('<a class="ajax_cart_block_remove_link" rel="nofollow" href="' + baseUri + '?controller=cart&delete=1&id_product=' + product['id'] + '&ipa=' + product['idCombination'] + '&token=' + static_token + '"> </a>');
|
||||
}
|
||||
$('#' + domIdProduct + ' span.remove_link').html('<a class="ajax_cart_block_remove_link" rel="nofollow" href="' + baseUri + '?controller=cart&delete=1&id_product=' + product['id'] + '&ipa=' + product['idCombination'] + '&token=' + static_token + '"> </a>');
|
||||
if (product.is_gift)
|
||||
$('#cart_block_product_' + domIdProduct + ' span.remove_link').html('');
|
||||
$('#' + domIdProduct + ' span.remove_link').html('');
|
||||
},
|
||||
|
||||
doesCustomizationStillExist : function (product, customizationId)
|
||||
@@ -448,7 +447,7 @@ var ajaxCart = {
|
||||
var name = (this.name.length > 12 ? this.name.substring(0, 10) + '...' : this.name);
|
||||
content += '<a href="' + this.link + '" title="' + this.name + '" class="cart_block_product_name">' + name + '</a>';
|
||||
|
||||
if (this.is_gift != undefined && this.is_gift == 1)
|
||||
if (typeof(this.is_gift) == 'undefined' || this.is_gift == 0)
|
||||
content += '<span class="remove_link"><a rel="nofollow" class="ajax_cart_block_remove_link" href="' + baseUri + '?controller=cart&delete=1&id_product=' + productId + '&token=' + static_token + (this.hasAttributes ? '&ipa=' + parseInt(this.idCombination) : '') + '"> </a></span>';
|
||||
else
|
||||
content += '<span class="remove_link"></span>';
|
||||
|
||||
Reference in New Issue
Block a user