-
Order Comments Status/Update Boilerplate
When you have a team working to fulfill customer orders, and different people each day, it becomes vital to have a central place for recording what is going on with orders, plus providing customers with update emails and status updates.
We've been trying to use the customer order comments and status values to record what is going on with a customer.
However, a lot of responses are pretty standard. Thus it would be nice to have these boilerplate responses available and able to be managed and used easily on the customer orders admin page.
Is there a Zen Cart plugin to provide us with a set of standard customer boilerplate options? (I couldn't find one.) Each boilerplate item would have a title, content (hopefully HTML capable), and sort order.
Then we could have a drop down box on the admin customer order page which displays the boilerplate title, in the sort order. It would then let us select which boilerplate option gets put into the order comment box. We then get to edit/personalise the comments before updating the order comments and/or status.
There would need to be an admin page where we get to edit/add/delete boilerplate options.
Has this already been done?
Best regards, Lloyd Borrett.
MODERATOR COMMENT: A plugin was built and it is available here:
https://www.zen-cart.com/downloads.php?do=file&id=2222
-
Re: Order Comments Status/Update Boilerplate
I don't think it has been done, but it surely can be done. My first thought is to populate a new table with the boilerplates and present them via a drop down. Upon selection the comment is then populated.
-
Re: Order Comments Status/Update Boilerplate
You got me inspired, so I started to code this mod.
-
3 Attachment(s)
Re: Order Comments Status/Update Boilerplate
some images to give you an idea
Attachment 16267Attachment 16268Attachment 16269
A drop-down on the orders page to select the comment, and a separate page to add/edit/remove comments
Multilingual and html enabled
-
Re: Order Comments Status/Update Boilerplate
Looking good. I suggest a sort order will be required for the predefined comments.
Also need to look into how the comments will be handled in the emails.
My understanding is that comments by default are just text with no HTML handling.
Nice to be able to put HTML in the comments, especially links, but need to make sure it gets handled properly in the emails.
Best regards, Lloyd Borrett.
-
Re: Order Comments Status/Update Boilerplate
Quote:
Originally Posted by
lloyd_borrett
Looking good. I suggest a sort order will be required for the predefined comments.
Also need to look into how the comments will be handled in the emails.
My understanding is that comments by default are just text with no HTML handling.
Nice to be able to put HTML in the comments, especially links, but need to make sure it gets handled properly in the emails.
Best regards, Lloyd Borrett.
The basic functionality is working now. HTML can be used in the comments, but will only be recognized (obviously) when sending html mails. For example is the html comment is
HTML Code:
<p>test comment <a href="http://test-domain.com">link</a></p>
The plain text mail looks like "test comment link".
To overcome this "problem" some additional coding is still needed.
I'll make a repository on GitHub later, so any one who likes can test his code.
-
Re: Order Comments Status/Update Boilerplate
-
Re: Order Comments Status/Update Boilerplate
I tried using this with version 1.55d but it crashed the admin section. It appears that the auto_loaders file causes the issue. Any updates on this?
-
Re: Order Comments Status/Update Boilerplate
Quote:
Originally Posted by
n8pbm
I tried using this with version 1.55d but it crashed the admin section. It appears that the auto_loaders file causes the issue. Any updates on this?
I'll take a look at it tonight. Do you have any debug log?
-
Re: Order Comments Status/Update Boilerplate
I will take a look when I get a chance and let you know.
-
Re: Order Comments Status/Update Boilerplate
Please download the package again : https://github.com/Zen4All-nl/Zen-Ca...ive/master.zip
I updated admin/includes/init_include/overrides/init_sanatize.php. This file was for an earlier ZC version. The file needs to be changed anyway in a future version so it does not need this override
-
Re: Order Comments Status/Update Boilerplate
Quote:
Originally Posted by
Design75
Please download the package again :
https://github.com/Zen4All-nl/Zen-Ca...ive/master.zip
I updated admin/includes/init_include/overrides/init_sanatize.php. This file was for an earlier ZC version. The file needs to be changed anyway in a future version so it does not need this override
I removed the override file in admin/includes/init_include/overrides/init_sanatize.php, and added a new file in admin/includes/extra_datafiles/order_comment_bolerplate_sanatizer.php.
-
Re: Order Comments Status/Update Boilerplate
I got the same error message after I uploaded the files when I went to my admin section:
The www.popupparts.com page isn’t working
www.popupparts.com is currently unable to handle this request.
HTTP ERROR 500
Log file:
[02-Mar-2017 06:51:05 America/Chicago] PHP Fatal error: Call to undefined method AdminRequestSanitizer::addSanitizationGroup() in /xxxxxxxxx/admindirectory/includes/init_includes/overrides/init_sanitize.php on line 169
-
Re: Order Comments Status/Update Boilerplate
as soon as I delete admindirectory/includes/init_includes/overrides/init_sanitize.php the site worked again.
-
Re: Order Comments Status/Update Boilerplate
Sorry - ignore the last two post. I still had the old files on the site. removed the old files and reinstalled the new ones. The site does not crash anymore but when I go to the orders page I get:
WARNING: An Error occurred, please refresh the page and try again.
Log File:
[02-Mar-2017 07:10:31 America/Chicago] Request URI: /admindirectory/orders.php, IP address: xxxxxx
#1 trigger_error() called at [/xxxxxxx/includes/classes/db/mysql/query_factory.php:167]
#2 queryFactory->show_error() called at [/xxxxxx/includes/classes/db/mysql/query_factory.php:139]
#3 queryFactory->set_error() called at [/xxxxxxxx/includes/classes/db/mysql/query_factory.php:266]
#4 queryFactory->Execute() called at [/xxxxxxxxx/pupadmin/orders.php:30]
[02-Mar-2017 07:10:31 America/Chicago] PHP Fatal error: 1146:Table 'xxxxxxxx.TABLE_ORDER_COMMENTS_CONTENT' doesn't exist :: SELECT comment_id, comment_title, comment_content
FROM TABLE_ORDER_COMMENTS_CONTENT
WHERE language_id = 1
ORDER BY comment_id ASC ==> (as called by) /xxxxx/Admindirectory/orders.php on line 30 <== in /xxxxxxxxx/includes/classes/db/mysql/query_factory.php on line 167
So i looks like the tables were not created.
-
Re: Order Comments Status/Update Boilerplate
actually, the error message does not say that. do you have the following file:
your_admin/includes/extra_datafiles/order_comment_boilerplate.php
if loaded properly, that file will define the constant:
TABLE_ORDER_COMMENTS_CONTENT
as your error log shows the constant (as opposed to the actual table name), it does NOT mean the tables is not there.
i would go over the install again. and you can look to see if the table is there via phpMyAdmin or some other tool for looking at your database.
good luck!
-
Re: Order Comments Status/Update Boilerplate
Like Carlwhat said, the tables are probably there. be sure to check you have this file: YOUR_ADMIN/includes/extra_datafiles/order_comment_boilerplate.php in place
Quote:
Originally Posted by
n8pbm
Sorry - ignore the last two post. I still had the old files on the site. removed the old files and reinstalled the new ones. The site does not crash anymore but when I go to the orders page I get:
WARNING: An Error occurred, please refresh the page and try again.
Log File:
[02-Mar-2017 07:10:31 America/Chicago] Request URI: /admindirectory/orders.php, IP address: xxxxxx
#1 trigger_error() called at [/xxxxxxx/includes/classes/db/mysql/query_factory.php:167]
#2 queryFactory->show_error() called at [/xxxxxx/includes/classes/db/mysql/query_factory.php:139]
#3 queryFactory->set_error() called at [/xxxxxxxx/includes/classes/db/mysql/query_factory.php:266]
#4 queryFactory->Execute() called at [/xxxxxxxxx/pupadmin/orders.php:30]
[02-Mar-2017 07:10:31 America/Chicago] PHP Fatal error: 1146:Table 'xxxxxxxx.TABLE_ORDER_COMMENTS_CONTENT' doesn't exist :: SELECT comment_id, comment_title, comment_content
FROM TABLE_ORDER_COMMENTS_CONTENT
WHERE language_id = 1
ORDER BY comment_id ASC ==> (as called by) /xxxxx/Admindirectory/orders.php on line 30 <== in /xxxxxxxxx/includes/classes/db/mysql/query_factory.php on line 167
So i looks like the tables were not created.
-
Re: Order Comments Status/Update Boilerplate
Hello. I know this thread is a bit old, but the module seems promising and could be quite useful.
I've downloaded this plugin from https://github.com/Zen4All-nl/Zen-Ca...ts-Boilerplate
I too get the same error and more when trying to access the orders.php page. Actually the orders.php page goes blank.
Checking the database via phpAdmin the tables are not being created. The installer doesn't seem to be running. I was able to create the tables nonetheless, yet I still get errors in the admin area. Nothing is inserted in configuration_group in the database either.
This is the error I keep getting when trying to access the order_comment_boilerplate.php page. All files are in the correct place. I'm using v1.5.5e.
[04-May-2018 16:20:18 America/Denver] Request URI: /ADMIN/order_comment_boilerplate.php, IP address: xxxxxx
#1 trigger_error() called at [/home/koolwedd/public_html/includes/classes/db/mysql/query_factory.php:167]
#2 queryFactory->show_error() called at [/public_html/includes/classes/db/mysql/query_factory.php:139]
#3 queryFactory->set_error() called at [/public_html/includes/classes/db/mysql/query_factory.php:266]
#4 queryFactory->Execute() called at [/public_html/pluMp-nRJ-crosS/includes/classes/split_page_results.php:40]
#5 splitPageResults->__construct() called at [/public_html/pluMp-nRJ-crosS/order_comment_boilerplate.php:306]
[04-May-2018 16:20:18 America/Denver] PHP Fatal error: 1146:Table 'XXXXX.order_comments_content' doesn't exist :: select count(*) as total FROM order_comments oc, order_comments_content occ WHERE oc.comment_id = occ.comment_id AND occ.language_id = '1' ==> (as called by) /public_html/pluMp-nRJ-crosS/includes/classes/split_page_results.php on line 40 <== in /public_html/includes/classes/db/mysql/query_factory.php on line 167
Any idea what could be the issue?
Thank you !
-
Re: Order Comments Status/Update Boilerplate
Quote:
Originally Posted by
mvstudio
Hello. I know this thread is a bit old, but the module seems promising and could be quite useful.
I've downloaded this plugin from
https://github.com/Zen4All-nl/Zen-Ca...ts-Boilerplate
I too get the same error and more when trying to access the orders.php page. Actually the orders.php page goes blank.
Checking the database via phpAdmin the tables are not being created. The installer doesn't seem to be running. I was able to create the tables nonetheless, yet I still get errors in the admin area. Nothing is inserted in configuration_group in the database either.
This is the error I keep getting when trying to access the order_comment_boilerplate.php page. All files are in the correct place. I'm using v1.5.5e.
[04-May-2018 16:20:18 America/Denver] Request URI: /ADMIN/order_comment_boilerplate.php, IP address: xxxxxx
#1 trigger_error() called at [/home/koolwedd/public_html/includes/classes/db/mysql/query_factory.php:167]
#2 queryFactory->show_error() called at [/public_html/includes/classes/db/mysql/query_factory.php:139]
#3 queryFactory->set_error() called at [/public_html/includes/classes/db/mysql/query_factory.php:266]
#4 queryFactory->Execute() called at [/public_html/pluMp-nRJ-crosS/includes/classes/split_page_results.php:40]
#5 splitPageResults->__construct() called at [/public_html/pluMp-nRJ-crosS/order_comment_boilerplate.php:306]
[04-May-2018 16:20:18 America/Denver] PHP Fatal error: 1146:Table 'XXXXX.order_comments_content' doesn't exist :: select count(*) as total FROM order_comments oc, order_comments_content occ WHERE oc.comment_id = occ.comment_id AND occ.language_id = '1' ==> (as called by) /public_html/pluMp-nRJ-crosS/includes/classes/split_page_results.php on line 40 <== in /public_html/includes/classes/db/mysql/query_factory.php on line 167
Any idea what could be the issue?
Thank you !
I fixed the installer and the issue has been resolved. It seems the installer is the one causing the problem at least for me. For anyone facing the same issue or the same errors, the corrected installer/order_comment_boilerplate/1_0_0.php below might do the trick. Hope it helps.
PHP Code:
<?php
// use $configuration_group_id where needed
// For Admin Pages
$zc150 = (PROJECT_VERSION_MAJOR > 1 || (PROJECT_VERSION_MAJOR == 1 && substr(PROJECT_VERSION_MINOR, 0, 3) >= 5));
if ($zc150) { // continue Zen Cart 1.5.0
$admin_page = 'editOrderCommentBoilerplate';
// delete configuration menu
$db->Execute("DELETE FROM ".TABLE_ADMIN_PAGES." WHERE page_key = '".$admin_page."' LIMIT 1;");
// add configuration menu
if (!zen_page_key_exists($admin_page)) {
if ((int)$configuration_group_id > 0) {
zen_register_admin_page($admin_page,
'BOX_TOOLS_ORDER_COMMENT_BOILERPLATE',
'FILENAME_ORDER_COMMENT_BOILERPLATE',
'',
'tools',
'Y',
$configuration_group_id);
$messageStack->add('Enabled MODULE Configuration Menu.', 'success');
}
}
}
/*
* If your checking for a field
*/
$db->Execute("CREATE TABLE IF NOT EXISTS order_comments (
comment_id INT(11) NOT NULL AUTO_INCREMENT,
sort_order INT(3) DEFAULT NULL,
last_modified DATETIME NULL DEFAULT NULL,
date_added DATETIME NULL DEFAULT NULL,
PRIMARY KEY (comment_id),
KEY idx_sort_order_zen (sort_order)
) ENGINE = MyISAM;");
$db->Execute("CREATE TABLE IF NOT EXISTS order_comments_content (
comment_id INT(11) NOT NULL DEFAULT '0',
language_id INT(11) NOT NULL DEFAULT '1',
comment_title VARCHAR(64) NOT NULL,
comment_content TEXT NOT NULL,
PRIMARY KEY (comment_id,language_id),
KEY idx_comment_title_zen (comment_title)
) ENGINE = MyISAM;");
-
Re: Order Comments Status/Update Boilerplate
I've encountered another issue.
In orders.php the textarea isn't getting populated with the predefined comments. No error logs.
Any ideas?
-
Re: Order Comments Status/Update Boilerplate
Quote:
Originally Posted by
mvstudio
I've encountered another issue.
In orders.php the textarea isn't getting populated with the predefined comments. No error logs.
Any ideas?
The area is updated with JavaScript. Check your browser console for errors.
I am not in able to fix the module this week, because I am on a holiday, but after that I will fix it. You can also create a pull request or issue on GitHub, so I can update the module easier.
-
Re: Order Comments Status/Update Boilerplate
I thought I posted the error I got in the console, but now I see I didn't.
This is the error I'm getting - SyntaxError: unterminated string literal - which points to these lines in the code
PHP Code:
echo "{value : '" . $value['id'] . "', comment : '" . $value['content'] . "'}";
} else {
echo "{value : '" . $value['id'] . "', comment : '" . $value['content'] . "'},";
I also had ' in the comment sample I generated. I was able to get rid off the other errors by changing the words don't to do not and so on. I'm assuming the problems is with the sanitize?
Thank you for looking into it.
-
Re: Order Comments Status/Update Boilerplate
Quote:
Originally Posted by
mvstudio
Hello. I know this thread is a bit old, but the module seems promising and could be quite useful.
I've downloaded this plugin from
https://github.com/Zen4All-nl/Zen-Ca...ts-Boilerplate
I too get the same error and more when trying to access the orders.php page. Actually the orders.php page goes blank.
Checking the database via phpAdmin the tables are not being created. The installer doesn't seem to be running. I was able to create the tables nonetheless, yet I still get errors in the admin area. Nothing is inserted in configuration_group in the database either.
This is the error I keep getting when trying to access the order_comment_boilerplate.php page. All files are in the correct place. I'm using v1.5.5e.
[04-May-2018 16:20:18 America/Denver] Request URI: /ADMIN/order_comment_boilerplate.php, IP address: xxxxxx
#1 trigger_error() called at [/home/koolwedd/public_html/includes/classes/db/mysql/query_factory.php:167]
#2 queryFactory->show_error() called at [/public_html/includes/classes/db/mysql/query_factory.php:139]
#3 queryFactory->set_error() called at [/public_html/includes/classes/db/mysql/query_factory.php:266]
#4 queryFactory->Execute() called at [/public_html/pluMp-nRJ-crosS/includes/classes/split_page_results.php:40]
#5 splitPageResults->__construct() called at [/public_html/pluMp-nRJ-crosS/order_comment_boilerplate.php:306]
[04-May-2018 16:20:18 America/Denver] PHP Fatal error: 1146:Table 'XXXXX.order_comments_content' doesn't exist :: select count(*) as total FROM order_comments oc, order_comments_content occ WHERE oc.comment_id = occ.comment_id AND occ.language_id = '1' ==> (as called by) /public_html/pluMp-nRJ-crosS/includes/classes/split_page_results.php on line 40 <== in /public_html/includes/classes/db/mysql/query_factory.php on line 167
Any idea what could be the issue?
Thank you !
This error has been fixed,by adding DB_PREFIX to the table defines.
-
Re: Order Comments Status/Update Boilerplate
Quote:
Originally Posted by
Design75
This error has been fixed,by adding DB_PREFIX to the table defines.
Thank you. I did solve this one. The last error I got - SyntaxError: unterminated string literal - is the one I'm unable to. It seems any comma, period, etc added to the comment itself affects the display of the comment in the textarea box generating that error. Perhaps the sanitizer? I tested a regular text comment without periods, commas, etc, and the comment gets populated just fine in the textarea box.
Thank you for taking the time to look into it. I appreciate it.
-
Re: Order Comments Status/Update Boilerplate
Quote:
Originally Posted by
mvstudio
Thank you. I did solve this one. The last error I got - SyntaxError: unterminated string literal - is the one I'm unable to. It seems any comma, period, etc added to the comment itself affects the display of the comment in the textarea box generating that error. Perhaps the sanitizer? I tested a regular text comment without periods, commas, etc, and the comment gets populated just fine in the textarea box.
Thank you for taking the time to look into it. I appreciate it.
This should be fixed to.
-
Re: Order Comments Status/Update Boilerplate
Thank you for the fix! It's much appreciated.
Is there any way to allow line breaks even on plain text? When the comment is entered it saves it as a continuous line of text.
-
Re: Order Comments Status/Update Boilerplate
Quote:
Originally Posted by
mvstudio
Thank you for the fix! It's much appreciated.
Is there any way to allow line breaks even on plain text? When the comment is entered it saves it as a continuous line of text.
I'll look into it. This mod only started as a proof of concept. So alot of improvement is possible.
-
Re: Order Comments Status/Update Boilerplate
Oh, I get it! Thank you! It's a wonderful addition to any store for sure.
Thank you for looking into it =)
-
Re: Order Comments Status/Update Boilerplate
Except for the documentation, I think most work is done.
Please test using https://github.com/Zen4All-nl/Zen-Ca...ive/master.zip, and report any issues.
When the documentation is done, I'll publish version 1.0 to the downloads section.
-
Re: Order Comments Status/Update Boilerplate
Quote:
Originally Posted by
Design75
BRILLIANT!!! I'll install, test and get back with any findings. Thank you so much and have a great weekend! =)
-
Re: Order Comments Status/Update Boilerplate
I'm back after a full weekend of testing. So the plugin works as it should. No errors, no blank pages and no error logs. The improvements you made are also really nice! Thank you so much for taking the time to work on it!!
It would be nice to find this in the plugin section for easy download. Just saying! :D
-
Re: Order Comments Status/Update Boilerplate
Quote:
Originally Posted by
mvstudio
I'm back after a full weekend of testing. So the plugin works as it should. No errors, no blank pages and no error logs. The improvements you made are also really nice! Thank you so much for taking the time to work on it!!
It would be nice to find this in the plugin section for easy download. Just saying! :D
Thanks for testing, and helping to finish the module. I'll finish the documentation ASAP, and upload it to the download section.
-
Re: Order Comments Status/Update Boilerplate
So it's finally finished. You'll find the plugin here https://www.zen-cart.com/downloads.php?do=file&id=2222
-
Re: Order Comments Status/Update Boilerplate
Quote:
Originally Posted by
Design75
This is a great plugin. Thanks very much for your work here, Design75! And mvstudio and other testers!
I found it quite easy to upload (with the merge required as indicated), easy to use and very helpful.
-
Re: Order Comments Status/Update Boilerplate
Thanks :smile:
Quote:
Originally Posted by
GerriM
This is a great plugin. Thanks very much for your work here, Design75! And mvstudio and other testers!
I found it quite easy to upload (with the merge required as indicated), easy to use and very helpful.
-
Re: Order Comments Status/Update Boilerplate
Does this plugin work with Super Orders ? I have installed it but the predefined comments don't get put in as a comment. Nothing happens.
Thanks
-
Re: Order Comments Status/Update Boilerplate
I have not tried that, but with some careful merging, I do not see why it wouldn't.
Quote:
Originally Posted by
donw
Does this plugin work with Super Orders ? I have installed it but the predefined comments don't get put in as a comment. Nothing happens.
Thanks
-
Re: Order Comments Status/Update Boilerplate
Design75 - sent you a PM.... need a response ASAP!
-
Re: Order Comments Status/Update Boilerplate
Quote:
Originally Posted by
Carbonless
Design75 - sent you a PM.... need a response ASAP!
It did work initially. I was using an old version of Safari. It worked using a much later version of Safari. However, it has stopped working again. I have installed a couple of other modules, which don't appear to have any code in common, so I may have to uninstall things to track down what the problem is.
-
Re: Order Comments Status/Update Boilerplate
Which Zen Cart, PHP version?
What is it exactly that is not working?
Are there any debug files created?
Without this information it is nearly impossible to help you.
Quote:
Originally Posted by
donw
It did work initially. I was using an old version of Safari. It worked using a much later version of Safari. However, it has stopped working again. I have installed a couple of other modules, which don't appear to have any code in common, so I may have to uninstall things to track down what the problem is.
-
Re: Order Comments Status/Update Boilerplate
I just tested this in combination with super orders, and it works fine for me.
-
Re: Order Comments Status/Update Boilerplate
Installed on ZC 1.5.7b and it functions without issue.
Thank You
-
Re: Order Comments Status/Update Boilerplate
hello zenniacs,
My client today asked me why this feature is missing, he would like to auto append comments to customer messages as it used to exist per this forum thread.
The one we're on (https://www.zen-cart.com/showthread....te-Boilerplate)
Does this function not exist anymore?
-
Re: Order Comments Status/Update Boilerplate
Something like this would make a great addition to the customer record to keep up with what the customer told you today compared to the claim they made last week, etc. Or not even when a customer is being a problem, just forgetful. I have one customer who calls at least once a week and can't remember what she asked about on the last call, so we go round and round trying to figure out what she needed help with. I've started making these notes in a separate file, but it sure would be nice to have them come up with the customer record, as many places with regular CSR employees do.
-
Re: Order Comments Status/Update Boilerplate
Does your business volume justify a using a CRM? It's unlikely that these features would be built into the Zen Cart core.
-
Re: Order Comments Status/Update Boilerplate
That's right! Having a running commentary that both parties receive (owner and customer) keeps everyone on the same page.
The Boilerplate solution is for canned messages. My client thought we used to have the ability to make an order comment and when it is stored in orders, there would be a button to the right of each comment that would move it to Customer Comments, the editor below the order comments.
I couldn't find anything like that.
-
Re: Order Comments Status/Update Boilerplate
Quote:
Originally Posted by
CarolineBogart
That's right! Having a running commentary that both parties receive (owner and customer) keeps everyone on the same page.
The Boilerplate solution is for canned messages. My client thought we used to have the ability to make an order comment and when it is stored in orders, there would be a button to the right of each comment that would move it to Customer Comments, the editor below the order comments.
I couldn't find anything like that.
You might be thinking of "Admin Notes". I don't know if that plugin has been updated in awhile though.
But, as swguy mentions, using a CRM application alongside might give you even more benefit than patching features onto the store.
-
Re: Order Comments Status/Update Boilerplate
I previously had posted that this worked with 1.5.7b... and it did ONLY because I overwrote the admin/orders.php file with 1.5.6 version. Which broke several new features with 1.5.7b in the orders admin.
After merging the 3 comments from the Boiler plate orders.php file with 1.5.7b orders.php file, the Boiler plate allows you to define the comments, the comments display as a selection in the order, but do NOT load when selected.
Currently is NOT functioning with 1.5.7b
-
Re: Order Comments Status/Update Boilerplate
Quote:
Originally Posted by
Carbonless
I previously had posted that this worked with 1.5.7b... and it did ONLY because I overwrote the admin/orders.php file with 1.5.6 version. Which broke several new features with 1.5.7b in the orders admin.
After merging the 3 comments from the Boiler plate orders.php file with 1.5.7b orders.php file, the Boiler plate allows you to define the comments, the comments display as a selection in the order, but do NOT load when selected.
Currently is NOT functioning with 1.5.7b
Any chance you resolved this? I am trying to merge the two files together but have the same issue. I can select the comments in the dropdown but they do not populate the comments section. I am sure it is where the changes are placed but the 1.5.7c orders.php file is very different than the one included in the mod. I just do not know enough to figure it out.
-
Re: Order Comments Status/Update Boilerplate
OK this plugin has been updated for 1.5.7.
-
Re: Order Comments Status/Update Boilerplate
Quote:
Originally Posted by
swguy
OK this plugin has been updated for 1.5.7.
Thank you, It worked perfectly.
-
Re: Order Comments Status/Update Boilerplate
I may have spoken too soon.
The comments load into the comments box fine. However when you update the order the email sends but the comments do not show. When the comments are added, you cannot change or add to the comments and the comment box appears frozen.
Thank you
-
Re: Order Comments Status/Update Boilerplate
I did this work very late at night - it might need a bit more effort.
Are you using CKEditor or plain text?
-
Re: Order Comments Status/Update Boilerplate
-
Re: Order Comments Status/Update Boilerplate
Confirmed - plain text works as expected but CKEditor has the issue you see. I will fix ASAP.
-
Re: Order Comments Status/Update Boilerplate
OK if you re-download the zip and install the updated copy of 157/admin/orders.php, this issue should be fixed.
-
Re: Order Comments Status/Update Boilerplate
Thanks, I just tried the new orders.php. Now it does not populate the comments field. I can select the comments from the dropdown but nothing appears in the actual comments box.
-
Re: Order Comments Status/Update Boilerplate
Hmm... you have to do it before you type anything in. I am using Chrome with the following workflow:
- bring up order details
- select a comment
- add on to the comment
- press update
If you're typing something in before selecting a comment, that appears to fail in the way you have described.
I'll look some more and see how that can be fixed.
-
Re: Order Comments Status/Update Boilerplate
Thank you for updating this mod @swguy.
Fresh install of this mod on an existing ZC v1.57c store. HTML tags don't seem to be carried over to the comments field on the order details page.
I can for instance wrap some boilerplate comment text in <b></b>, this shows as bold in the order_comment_boilerplate page. Not so if I add the Predefined Comments to the order details page.
(I can successfully add HTML tagged text to the order details comments field, manually)
Edit: I am not using CKEditor
-
Re: Order Comments Status/Update Boilerplate
Simon: if you want to use HTML in your predefined comments, use CKEditor on the order details page. (You may need to make the change below.)
@n8pbm: Please replace the ready() function in orders.php (around line 481) with the following:
Code:
$(document).ready(function() {
$('#predefined_comments').change(function(){
val = $(":selected", this).index();
<?php if ($editor_handler !== '') { ?>
CKEDITOR.instances['comments'].setData(commentsArray[val].comment);
<?php } else { ?>
var html_comment = $.parseHTML(commentsArray[val].comment);
var text = $(html_comment).text();
$('#comments').val(text);
<?php } ?>
});
});
-
Re: Order Comments Status/Update Boilerplate
Quote:
Originally Posted by
simon1066
Thank you for updating this mod @swguy.
Fresh install of this mod on an existing ZC v1.57c store. HTML tags don't seem to be carried over to the comments field on the order details page.
I can for instance wrap some boilerplate comment text in <b></b>, this shows as bold in the order_comment_boilerplate page. Not so if I add the Predefined Comments to the order details page.
(I can successfully add HTML tagged text to the order details comments field, manually)
Edit: I am not using CKEditor
This seems to be caused by the introduction of this new code in Admin/orders.php
Code:
$(document).ready(function() {
$('#predefined_comments').change(function(){
val = $(":selected", this).index();
<?php if ($editor_handler !== '') { ?>
$('textarea[name="comments"]').val(commentsArray[val].comment);
<?php } else { ?>
var html_comment = $.parseHTML(commentsArray[val].comment);
var text = $(html_comment).text();
$('textarea[name="comments"]').html(text);
<?php } ?>
});
});
</script>
<?php /* EOF Zen4All Order Comment 2 of 3 */ ?>
as opposed to the previous code, which worked, of
Code:
$(document).ready(function() {
$('#predefined_comments').change(function(){
val = $(":selected", this).index();
$('textarea[name="comments"]').val(commentsArray[val].comment);
});
});
</script>
<?php /* EOF Zen4All Order Comment 2 of 3 */ ?>
-
Re: Order Comments Status/Update Boilerplate
Quote:
Originally Posted by
swguy
Simon: if you want to use HTML in your predefined comments, use CKEditor on the order details page. (You may need to make the change below.)
@n8pbm: Please replace the ready() function in orders.php (around line 481) with the following:
Code:
$(document).ready(function() {
$('#predefined_comments').change(function(){
val = $(":selected", this).index();
<?php if ($editor_handler !== '') { ?>
CKEDITOR.instances['comments'].setData(commentsArray[val].comment);
<?php } else { ?>
var html_comment = $.parseHTML(commentsArray[val].comment);
var text = $(html_comment).text();
$('#comments').val(text);
<?php } ?>
});
});
Thank you, styling the comments with CKEDITOR has worked - once I enabled it. I've never liked using the editor, I might have to configure the way it wraps everything in <p> tags and how it handles new lines/carriage returns.
-
Re: Order Comments Status/Update Boilerplate
If you really want to type HTML into the non-CKEditor textarea block, you can do that if you tweak the else branch of the ready() function. Right now, it strips out any HTML. This was a guess as to correct behavior on my part - please feel free to customize to your own taste.
-
Re: Order Comments Status/Update Boilerplate
I did not type anything in the comments section before selecting from the dropdown. I just opened the order and then select from the dropdown and nothing happens.
I will give the code you provided as soon as I can.
Thank you
-
Re: Order Comments Status/Update Boilerplate
I updated the file with the new code and everything appears to be working.
Thank you for taking the time to work on this. I really appreciate it.
-
Re: Order Comments Status/Update Boilerplate
I'm going to update the mod to use this new code for CKEditor but the old code for plain text - I think this is the best compromise. I have my updated code for plain text in there and commented out in case someone prefers that behavior.
-
Re: Order Comments Status/Update Boilerplate
As designed, adding a second boilerplate entry to the order comments box replaces the first. I have occasion to add more than one boilerplate comment at a time. With a bit of help from Stackoverflow I made a stab at it:
Note: this only works if, like me, you don't use ckeditor and are adding HTML code manually to the boilerplate comments.
The new line is in red and replaces the line above it,
admin/orders.php
Code:
$(document).ready(function() {
$('#predefined_comments').change(function(){
val = $(":selected", this).index();
<?php if ($editor_handler !== '') { ?>
CKEDITOR.instances['comments'].setData(commentsArray[val].comment);
<?php } else { ?>
/* Use this instead if you want to strip out HTML
var html_comment = $.parseHTML(commentsArray[val].comment);
var text = $(html_comment).text();
$('#comments').val(text);
*/
// $('textarea[name="comments"]').val(commentsArray[val].comment);
$('textarea[name="comments"]').val($('textarea[name="comments"]').val() +(commentsArray[val].comment) + "\n");
<?php } ?>
});
});
-
2 Attachment(s)
Re: Order Comments Status/Update Boilerplate
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.
Attachment 20549
I added the 'no comments' with this code in red
Code:
default:
if (isset($ocInfo) && is_object($ocInfo)) {
$heading[] = array('text' => '<h4>[' . $ocInfo->comment_id . '] ' . $ocInfo->comment_title . '</h4>');
$contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_ORDER_COMMENT_BOILERPLATE, (isset($_GET['page']) ? '&page=' . $_GET['page'] : '') . '&ocid=' . $ocInfo->comment_id . '&action=new') . '" class="btn btn-primary">' . IMAGE_EDIT . '</a> <a href="' . zen_href_link(FILENAME_ORDER_COMMENT_BOILERPLATE, 'ocid=' . $ocInfo->comment_id . (isset($_GET['page']) ? '&page=' . (int)$_GET['page'] : '') . '&action=del') . '" class="btn btn-warning" role="button">' . IMAGE_DELETE . '</a>');
$commentContent = $db->Execute("SELECT comment_content
FROM " . TABLE_ORDER_COMMENTS_CONTENT . "
WHERE comment_id = " . (int)$ocInfo->comment_id . "
AND language_id = " . (int)$_SESSION['languages_id']);
$contents[] = array('text' => COMMENT_CONTENT . ': ' . $commentContent->fields['comment_content']);
$contents[] = array('text' => DATE_CREATED . ': ' . zen_date_short($ocInfo->date_added));
$contents[] = array('text' => DATE_MODIFIED . ': ' . zen_date_short($ocInfo->last_modified));
} else {
$heading[] = array('text' => '<h4>' . ERROR_NO_COMMENTS . '</h4>');
$contents[] = [];
}
break;
It is obviously this line that is causing the greyed area
but if I remove it then the entire 'no comments' box disappears so it seems that the $heading has to be paired with a $contents. As you can see, this is a bit above my head so any pointers are welcome.
-
Re: Order Comments Status/Update Boilerplate
I will update this for PHP8 soon.
-
Re: Order Comments Status/Update Boilerplate
Quote:
Originally Posted by
swguy
I will update this for PHP8 soon.
I'm happy to work through this, unless you have a burning desire to do so. Both you and @lat9 (possibly others) have added a decent amount of info to the Docs regarding upgrading plugins to work with newer PHP versions - that should help.
-
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