From 4346d9e57c8f1fe7339e8bcd3cd2c7fc8ec61828 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Gaulu=C3=A9?= Date: Mon, 6 May 2013 00:32:16 +0200 Subject: [PATCH 01/13] [*] FO : AuthController can now have its own template --- controllers/front/AuthController.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/controllers/front/AuthController.php b/controllers/front/AuthController.php index f5b8563b4..8eec13284 100644 --- a/controllers/front/AuthController.php +++ b/controllers/front/AuthController.php @@ -139,6 +139,9 @@ class AuthControllerCore extends FrontController 'HOOK_CREATE_ACCOUNT_TOP' => Hook::exec('displayCustomerAccountFormTop') )); + // Just set $this->template value here in case it's used by Ajax + $this->setTemplate(_PS_THEME_DIR_.'authentication.tpl'); + if ($this->ajax) { // Call a hook to display more information on form @@ -150,12 +153,11 @@ class AuthControllerCore extends FrontController $return = array( 'hasError' => !empty($this->errors), 'errors' => $this->errors, - 'page' => $this->context->smarty->fetch(_PS_THEME_DIR_.'authentication.tpl'), + 'page' => $this->context->smarty->fetch($this->template), 'token' => Tools::getToken(false) ); die(Tools::jsonEncode($return)); } - $this->setTemplate(_PS_THEME_DIR_.'authentication.tpl'); } /** From 448b8bad023ad9b8b5b15c44767d86d67e2105c4 Mon Sep 17 00:00:00 2001 From: AntonLejon Date: Mon, 6 May 2013 12:14:11 +0300 Subject: [PATCH 02/13] [*] MO: blockcart animation optimization The animated element would not be removed upon the animation being finished. This made the site slow and unresponsive if the animated image was heavy (eg. a transparent png) and added to cart many times without reloading the page. This addition makes the animation behave as expected also when performing it multiple times. --- modules/blockcart/ajax-cart.js | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/blockcart/ajax-cart.js b/modules/blockcart/ajax-cart.js index c42dc72cf..8641931c5 100644 --- a/modules/blockcart/ajax-cart.js +++ b/modules/blockcart/ajax-cart.js @@ -232,6 +232,7 @@ var ajaxCart = { .animate({ 'width': $element.attr('width')*0.66, 'height': $element.attr('height')*0.66, 'opacity': 0.2, 'top': cartBlockOffset.top + 30, 'left': cartBlockOffset.left + 15 }, 1000) .fadeOut(100, function() { ajaxCart.updateCartInformation(jsonData, addedFromProductPage); + $(this).remove(); }); } else From 83a1ea548812abbc89d523e56aa56391a8e2f0ae Mon Sep 17 00:00:00 2001 From: AntonLejon Date: Thu, 9 May 2013 00:53:06 +0300 Subject: [PATCH 03/13] [-] MO: blockcart ajax cart product insert missing html class Added the same HTML class as the other product names have in the ajax cart. Perhaps it would be nice to add an added_from_ajax as well in case you would want to differ between the newly added items and previously added ones? Another potential issue is on line 445 where there is no space after the insert. If Prestashop is set to minify the normal page, this is correct, otherwise there will be a space missing. --- modules/blockcart/ajax-cart.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/blockcart/ajax-cart.js b/modules/blockcart/ajax-cart.js index c42dc72cf..073d95705 100644 --- a/modules/blockcart/ajax-cart.js +++ b/modules/blockcart/ajax-cart.js @@ -443,7 +443,7 @@ var ajaxCart = { var content = '