diff --git a/modules/productcomments/js/productcomments.js b/modules/productcomments/js/productcomments.js index 50799839f..eca9fae2a 100644 --- a/modules/productcomments/js/productcomments.js +++ b/modules/productcomments/js/productcomments.js @@ -54,8 +54,9 @@ $(function() { e.preventDefault(); // Form element + url_options = productcomments_url_rewrite ? '?' : '&'; $.ajax({ - url: productcomments_controller_url+'&action=add_comment&secure_key='+secure_key, + url: productcomments_controller_url+url_options+'action=add_comment&secure_key='+secure_key, data: $('#fancybox-content form').serialize(), type: 'POST', dataType: "json", diff --git a/modules/productcomments/productcomments.php b/modules/productcomments/productcomments.php index 0dbc64d35..4060d8fb9 100644 --- a/modules/productcomments/productcomments.php +++ b/modules/productcomments/productcomments.php @@ -755,7 +755,8 @@ class ProductComments extends Module 'productcomment_cover' => (int)Tools::getValue('id_product').'-'.(int)$image['id_image'], 'mediumSize' => Image::getSize('medium'), 'nbComments' => (int)ProductComment::getCommentNumber((int)Tools::getValue('id_product')), - 'productcomments_controller_url' => $this->context->link->getModuleLink('productcomments') + 'productcomments_controller_url' => $this->context->link->getModuleLink('productcomments'), + 'productcomments_url_rewriting_activated' => Configuration::get('PS_REWRITING_SETTINGS', 0) )); $this->context->controller->pagination((int)ProductComment::getCommentNumber((int)Tools::getValue('id_product'))); diff --git a/modules/productcomments/productcomments.tpl b/modules/productcomments/productcomments.tpl index f3d0af038..6b6c768b0 100644 --- a/modules/productcomments/productcomments.tpl +++ b/modules/productcomments/productcomments.tpl @@ -27,6 +27,7 @@ var productcomments_controller_url = '{$productcomments_controller_url}'; var confirm_report_message = "{l s='Are you sure you want report this comment?' mod='productcomments'}"; var secure_key = "{$secure_key}"; +var productcomments_url_rewrite = '{$productcomments_url_rewriting_activated}';