From f9c5bf0bf278b30c4564fa495fb5c6f1131f66e5 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Mon, 15 Jul 2013 17:29:08 +0200 Subject: [PATCH 1/4] [-] Fix bug #PSCFV-9633 again could not see delete href in block cart --- modules/blockcart/ajax-cart.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/modules/blockcart/ajax-cart.js b/modules/blockcart/ajax-cart.js index ba49d6c75..3c2658756 100644 --- a/modules/blockcart/ajax-cart.js +++ b/modules/blockcart/ajax-cart.js @@ -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(' '); - } + $('#' + domIdProduct + ' span.remove_link').html(' '); 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 += '' + name + ''; - if (this.is_gift != undefined && this.is_gift == 1) + if (typeof(this.is_gift) == 'undefined' || this.is_gift == 0) content += ' '; else content += ''; From c253a8edf4216ba56708c3370bc361b7a9c27a96 Mon Sep 17 00:00:00 2001 From: soware Date: Mon, 15 Jul 2013 12:45:00 -0300 Subject: [PATCH 2/4] Update AdminStockManagementController.php Hi, I altered these values to make default on the radio button. I think is better because is a value more frequent in stock management form. --- controllers/admin/AdminStockManagementController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/admin/AdminStockManagementController.php b/controllers/admin/AdminStockManagementController.php index cb14e032d..22319e557 100644 --- a/controllers/admin/AdminStockManagementController.php +++ b/controllers/admin/AdminStockManagementController.php @@ -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); From a3039024e7d30ea5196c9450470ff526ae3b7d75 Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Mon, 15 Jul 2013 18:07:33 +0200 Subject: [PATCH 3/4] // Code cleaning --- controllers/admin/AdminProductsController.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index f9d9a803a..9958f4234 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -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'; From d9c2ec37d43f28aab2ff9a31a6f85e153532dbf5 Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Mon, 15 Jul 2013 18:13:07 +0200 Subject: [PATCH 4/4] // Code cleaning --- controllers/admin/AdminProductsController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index 9958f4234..a221df3fb 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -275,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,