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 += '