Jump to content

[SOLVED] Products comment problem with validate


Recommended Posts

Hey guys!

 

Just installed this module, but it doesnt work for me. When I try to comment a products i get the next msgs:

  • Title is incorrect
  • Comment is incorrect
  • Customer name is incorrect
  • Product not found

Any solutions?

 

I use 1.5 homemade theme :)

 

qautohifi.hu

 

Link to comment
Share on other sites

open productcomments.js

 

there is a code:
 

$('#submitNewMessage').click(function(e) {
		// Kill default behaviour
		e.preventDefault();

		// Form element

		url_options = parseInt(productcomments_url_rewrite) ? '?' : '&';
		$.ajax({
			url: productcomments_controller_url + url_options + 'action=add_comment&secure_key=' + secure_key + '&rand=' + new Date().getTime(),
			data: $('#fancybox-content form').serialize(),
			type: 'POST',
			headers: { "cache-control": "no-cache" },
			dataType: "json",
			success: function(data){
				if (data.result)
				{
					$.fancybox.close();
					document.location.href = document.location.href;
				}
				else
				{
					$('#new_comment_form_error ul').html('');
					$.each(data.errors, function(index, value) {
						$('#new_comment_form_error ul').append('<li>'+value+'</li>');
					});
					$('#new_comment_form_error').slideDown('slow');
				}
			}
		});
		return false;
	});

change this line:

data: $('#fancybox-content form').serialize()

to:

data: $('#new_comment_form form').serialize()
  • Like 5
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...