Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OC 2.2.0.0] admin contact.tpl summernote error #4089

Closed
b-and-p opened this issue Mar 10, 2016 · 2 comments
Closed

[OC 2.2.0.0] admin contact.tpl summernote error #4089

b-and-p opened this issue Mar 10, 2016 · 2 comments

Comments

@b-and-p
Copy link

b-and-p commented Mar 10, 2016

File: opencart\admin\view\template\marketing\contact.tpl line 194:

    // Summer not fix
 $('textarea[name=\'message\']').val($('#input-message').code());

cause JS error:

    Uncaught TypeError: $(...).code is not a function

Cause summernote API has changed.

Proposed solution: comment out or delete offending code

   // Summer not fix
// $('textarea[name=\'message\']').val($('#input-message').code());
@bau720123
Copy link

I have the same problem just like @b-and-p said
after comment it, seem work perfect
hope it will fix in the new version

@lives-in-th
Copy link

lives-in-th commented Dec 16, 2017

FIX Marketing Mail in OPC2.2.0.0
opencart\admin\view\template\marketing\contact.tpl

Replace function send(url) {
from Line192 to end with this code

function send(url) {
$.ajax({
url: url,
type: 'post',
data: $('#content select, #content input, #content textarea'),
dataType: 'json',
beforeSend: function() {
$('#button-send').button('loading');
},
complete: function() {
$('#button-send').button('reset');
},
success: function(json) {
$('.alert, .text-danger').remove();

		if (json['error']) {
			if (json['error']['warning']) {
				$('#content > .container-fluid').prepend('<div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> ' + json['error']['warning'] + '</div>');
			}

			if (json['error']['email']) {
				$('#content > .container-fluid').prepend('<div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> ' + json['error']['email'] + '</div>');
			}

			if (json['error']['subject']) {
				$('input[name=\'subject\']').after('<div class="text-danger">' + json['error']['subject'] + '</div>');
			}

			if (json['error']['message']) {
				$('textarea[name=\'message\']').parent().append('<div class="text-danger">' + json['error']['message'] + '</div>');
			}
		}

		if (json['success']) {
			$('#content > .container-fluid').prepend('<div class="alert alert-success"><i class="fa fa-check-circle"></i>  ' + json['success'] + '</div>');
		}
			
		if (json['next']) {
			send(json['next']);
		}
	},
	error: function(xhr, ajaxOptions, thrownError) {
		alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
	}
});

}
//--></script>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants