Forums / Managing Customers and Orders / Order Comments Status/Update Boilerplate

Order Comments Status/Update Boilerplate

Results 1 to 20 of 83
24 Apr 2016, 05:02
#1
lloyd_borrett avatar

lloyd_borrett

Zen Follower

Join Date:
Mar 2006
Posts:
308
Plugin Contributions:
2

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
24 Apr 2016, 05:44
#2
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Posts:
2,862
Plugin Contributions:
5

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.
27 Apr 2016, 13:53
#3
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Posts:
2,862
Plugin Contributions:
5

Re: Order Comments Status/Update Boilerplate

You got me inspired, so I started to code this mod.
27 Apr 2016, 18:46
#4
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Posts:
2,862
Plugin Contributions:
5

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
27 Apr 2016, 21:16
#5
lloyd_borrett avatar

lloyd_borrett

Zen Follower

Join Date:
Mar 2006
Posts:
308
Plugin Contributions:
2

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.
27 Apr 2016, 21:49
#6
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Posts:
2,862
Plugin Contributions:
5

Re: Order Comments Status/Update Boilerplate

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]<p>test comment <a href="http://test-domain.com">link</a></p>[/HTML] 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.
01 Mar 2017, 14:37
#8
n8pbm avatar

n8pbm

Zen Follower

Join Date:
Mar 2005
Posts:
142
Plugin Contributions:
0

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?
01 Mar 2017, 15:12
#9
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Posts:
2,862
Plugin Contributions:
5

Re: Order Comments Status/Update Boilerplate

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?
01 Mar 2017, 16:41
#10
n8pbm avatar

n8pbm

Zen Follower

Join Date:
Mar 2005
Posts:
142
Plugin Contributions:
0

Re: Order Comments Status/Update Boilerplate

I will take a look when I get a chance and let you know.
01 Mar 2017, 17:20
#11
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Posts:
2,862
Plugin Contributions:
5

Re: Order Comments Status/Update Boilerplate

Please download the package again : https://github.com/Zen4All-nl/Zen-Cart-Order-Comments-Boilerplate/archive/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
01 Mar 2017, 18:10
#12
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Posts:
2,862
Plugin Contributions:
5

Re: Order Comments Status/Update Boilerplate

Design75:

Please download the package again : https://github.com/Zen4All-nl/Zen-Cart-Order-Comments-Boilerplate/archive/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.
02 Mar 2017, 12:54
#13
n8pbm avatar

n8pbm

Zen Follower

Join Date:
Mar 2005
Posts:
142
Plugin Contributions:
0

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
02 Mar 2017, 12:57
#14
n8pbm avatar

n8pbm

Zen Follower

Join Date:
Mar 2005
Posts:
142
Plugin Contributions:
0

Re: Order Comments Status/Update Boilerplate

as soon as I delete admindirectory/includes/init_includes/overrides/init_sanitize.php the site worked again.
02 Mar 2017, 13:15
#15
n8pbm avatar

n8pbm

Zen Follower

Join Date:
Mar 2005
Posts:
142
Plugin Contributions:
0

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.
02 Mar 2017, 22:50
#16
carlwhat avatar

carlwhat

Totally Zenned

Join Date:
Nov 2005
Posts:
2,932
Plugin Contributions:
5

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!
03 Mar 2017, 05:47
#17
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Posts:
2,862
Plugin Contributions:
5

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

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.
04 May 2018, 22:49
#18
mvstudio avatar

mvstudio

Zen Follower

Join Date:
Apr 2008
Posts:
447
Plugin Contributions:
1

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-Cart-Order-Comments-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 !
04 May 2018, 23:22
#19
mvstudio avatar

mvstudio

Zen Follower

Join Date:
Apr 2008
Posts:
447
Plugin Contributions:
1

Re: Order Comments Status/Update Boilerplate

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-Cart-Order-Comments-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]
<?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;");

[/PHP]
05 May 2018, 00:34
#20
mvstudio avatar

mvstudio

Zen Follower

Join Date:
Apr 2008
Posts:
447
Plugin Contributions:
1

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?