From 2f14bbc7f34dc76acdd3ca74622d6f6439e84bb3 Mon Sep 17 00:00:00 2001 From: vChabot Date: Fri, 10 Feb 2012 14:08:03 +0000 Subject: [PATCH] // report bugfix from saving customization with combination --- controllers/front/ProductController.php | 17 +++++++++ js/tools.js | 8 ++++- modules/blockcart/ajax-cart.js | 8 +++-- themes/default/css/global.css | 7 ++++ themes/default/js/product.js | 48 +++++++++++++++++++++++-- 5 files changed, 82 insertions(+), 6 deletions(-) diff --git a/controllers/front/ProductController.php b/controllers/front/ProductController.php index 11511a1df..9d152c935 100644 --- a/controllers/front/ProductController.php +++ b/controllers/front/ProductController.php @@ -559,5 +559,22 @@ class ProductControllerCore extends FrontController } return $specific_prices; } + + public function postProcess() + { + if ($this->ajax) + { + if (Tools::isSubmit('submitCustomizedDatas')) + { + $this->pictureUpload($this->product, $this->context->cart); + $this->textRecord($this->product, $this->context->cart); + $this->formTargetFormat(); + } + if (count($this->errors)) + die(Tools::jsonEncode(array('hasErrors' => true, 'errors' => $this->errors))); + else + die(Tools::jsonEncode(array('hasErrors' => false, 'conf' => Tools::displayError('Customization saved successfully.')))); + } + } } diff --git a/js/tools.js b/js/tools.js index 5038af989..f4be7c856 100644 --- a/js/tools.js +++ b/js/tools.js @@ -214,7 +214,13 @@ function checkCustomizations() function emptyCustomizations() { if(typeof(customizationFields) == 'undefined') return; - + + $('.customization_block .success').fadeOut(function(){ + $(this).remove(); + }); + $('.customization_block .error').fadeOut(function(){ + $(this).remove(); + }); for (var i = 0; i < customizationFields.length; i++) { $('#' + customizationFields[i][0]).html(''); diff --git a/modules/blockcart/ajax-cart.js b/modules/blockcart/ajax-cart.js index 5430737e5..38ad20d56 100644 --- a/modules/blockcart/ajax-cart.js +++ b/modules/blockcart/ajax-cart.js @@ -493,8 +493,10 @@ var ajaxCart = { if (!hasAlreadyCustomizations) { - if (!product.hasAttributes) content += '