1 Attachment(s)
Re: Order Comments Status/Update Boilerplate
Quote:
Originally Posted by
simon1066
ZC v 2.0.0 rc2
PHP 8.1
Not specific to ZC 2.0.0 but, the coupon_admin page displays 'no coupons' when coupons are empty
Attachment 20548
I would like to do the same for this plugin, while I'm beautifying it (and getting it ready for ZC 2.0.0).
I have achieved this, but want to remove the grey portion below the black 'no comments' block....
I have resolved the above issue.
When inserting a comment there exists some custom text adjacent to the input boxes,
Attachment 20553
I aim to have different text depending on whether the content input box is Plain Text or CKEditor entry. I can write some code except that I'm unsure how to identify the type of input box in use.
e.g.
if input box is Plain Text then
display this text
else (if it is CKeditor)
display that text
Re: Order Comments Status/Update Boilerplate
Quote:
Originally Posted by
simon1066
..
e.g.
if input box is Plain Text then
display this text
else (if it is CKeditor)
display that text
look at this session var:
$_SESSION['html_editor_preference_status']
that should tell you which editor (or none) is in use.
you can look over here to see how it gets set:
https://github.com/zencart/zencart/b...tml_editor.php
best.
Re: Order Comments Status/Update Boilerplate
Quote:
Originally Posted by
carlwhat
That's great, thanks.
Re: Order Comments Status/Update Boilerplate
Re: Order Comments Status/Update Boilerplate
Just updated the CKEditor and now this Boilerplate comments will not copy into the comments box. The editor seems to work fine, and i've re-installed the OC Boilerplate plug-in just cause. No change. Feels like something simple but I can't find it. No error logfile being created.
Can someone send me a hint? Thanks,
Re: Order Comments Status/Update Boilerplate
Quote:
Originally Posted by
apollowilcox
Just updated the CKEditor and now this Boilerplate comments will not copy into the comments box. The editor seems to work fine, and i've re-installed the OC Boilerplate plug-in just cause. No change. Feels like something simple but I can't find it. No error logfile being created.
Can someone send me a hint? Thanks,
I've tested this by upgrading to ckeditor5 on ZC v1.5.8a. The appropriate lines of code on my install of this plugin is as folllows, with the line that gives an error in browser dev console highlighted in red.
Code:
$(document).ready(function() {
$('#predefined_comments').change(function(){
val = $(":selected", this).index();
<?php if ($editor_handler !== '') { ?>
CKEDITOR.instances['comments'].insertHtml((commentsArray[val].comment) + '<br>');
<?php } else { ?>
/* Using Plain Text Editor */
$('textarea[name="comments"]').val($('textarea[name="comments"]').val() +(commentsArray[val].comment) + '\n');
/* Use this instead of above line if you want to strip out HTML
var html_comment = $.parseHTML(commentsArray[val].comment);
var text = $(html_comment).text();
$('#comments').val($('#comments').val() +(text) + '\n');
*/
<?php } ?>
});
});
I haven't much time at the moment to debug this or compare it with the latest plugin code - so your code might be different.
Re: Order Comments Status/Update Boilerplate
Quote:
Originally Posted by
simon1066
I've tested this by upgrading to ckeditor5 on ZC v1.5.8a. The appropriate lines of code on my install of this plugin is as folllows, with the line that gives an error in browser dev console highlighted in red.
Code:
$(document).ready(function() {
$('#predefined_comments').change(function(){
val = $(":selected", this).index();
<?php if ($editor_handler !== '') { ?>
CKEDITOR.instances['comments'].insertHtml((commentsArray[val].comment) + '<br>');
<?php } else { ?>
/* Using Plain Text Editor */
$('textarea[name="comments"]').val($('textarea[name="comments"]').val() +(commentsArray[val].comment) + '\n');
/* Use this instead of above line if you want to strip out HTML
var html_comment = $.parseHTML(commentsArray[val].comment);
var text = $(html_comment).text();
$('#comments').val($('#comments').val() +(text) + '\n');
*/
<?php } ?>
});
});
I haven't much time at the moment to debug this or compare it with the latest plugin code - so your code might be different.
Edit: relevant file is admin/orders.php
Re: Order Comments Status/Update Boilerplate
Referencing CKEditor no longer works in CKEditor 5.
Here are some details on how to fix this:
https://stackoverflow.com/questions/...tor-5-instance
Re: Order Comments Status/Update Boilerplate
Lol... Thanks, but well over my head. :shocking:
My code does look like what Simon offered. Guess I'll wait for the update to the order-comments-boilerplate plug-in.
Re: Order Comments Status/Update Boilerplate
Using the developer tools in the browser, I get this comment when attempting to insert a comment from the Order-comments-boilerplate at the customer order screen:
index.php?cmd=orders&oID=335750&action=edit:753
Uncaught ReferenceError: CKEDITOR is not defined
at HTMLSelectElement.<anonymous> (index.php?cmd=orders&oID=335750&action=edit:753:3)
at HTMLSelectElement.dispatch (jquery-3.6.1.min.js:2:43064)
at y.handle (jquery-3.6.1.min.js:2:41048)
Does that lead anyone to any specific suggestions?
Thank you!
ZC 1.5.8a; PHP 8.2.23