versedi / magento-w2p

Automatically exported from code.google.com/p/magento-w2p
0 stars 0 forks source link

2-way comments #471

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
We need to add 2-way commenting for placed orders. 

It holds back our PREMIUM project.

At the moment an admin can place a comment in order details, make it visible to 
the user and ask mage to notify the user via email.

We need the user to be able to enter a comment which is:
1. visible to the user and the admin
2. is emailed to the same list of recipients as a new order
All comments should show in the chronological order.
It should be clear who made the comment and when.

We will need to add file attachments in the future.

Upload the extension to our account as usual.
Name: Order comments
Icon: A balloon as in a chat and 2 arrows going both ways.
Short description: Enables 2-way comments for orders with logging.
Full description: This extension enables 2-way comments in order details 
screen. The default Magento implementation allows admins to make comments and 
make them visible to the customer, but the customer cannot place a comment in 
response. Our extension enables a proper conversation with all comments logged 
in a chronological order.
All comments placed by the customer are emailed to the list of recipients for a 
new order.
The extension is free and provided "as is" with no warranties or liabilities.
Do not install on a production site without testing.
Support: http://www.zetaprints.com/magentohelp/other-magento-support/
Created by ZetaPrints to support [web-to-print and dynamic imaging 
http://www.zetaprints.com] websites.

Obviously make links like links.

Can we have an icon ready, please?

This task is for an alpha release to see if it solves the problem.

Original issue reported on code.google.com by zetapri...@gmail.com on 27 Feb 2011 at 7:53

GoogleCodeExporter commented 8 years ago

Original comment by zetapri...@gmail.com on 4 Mar 2011 at 10:24

GoogleCodeExporter commented 8 years ago
I did some work on this and made a comment form for customer front end.
Along the way I encountered few things that might be a problem.

1. When comment is posted (in admin) there is no record kept of who posted the 
comment.

2. Comments are displayed using template file and there is no programmatic way 
to alter its content.

3. On front end order details page, if there are any comments for an order they 
are displayed right bellow order items details. After that list there is a 
'back' link displayed. All this is done in one template file. So again no 
programmatic way to stick comment form between list of comments and 'back' link.

4. This is not actually a problem but something I want to point. Comments are 
shown in newest to oldest order from top to bottom. Should we keep it this way 
or reverse the order?

For customer comments, I have created a reference table, where I save customer 
ID with comment ID, so getting customer name for display is not a problem. If 
you want to have backend user name displayed too, then I will need to capture 
comment post event and get admin user id and store it too.

About problems 2 and 3 I see 2 approaches:
1. Create our own templates the way we like them and replace Magento templates.
2. Create our templates with some JavaScript data that we need, inject them 
after Magento templates and use JavaScript to decorate default magento content 
- add user names, may be some classes to comments to tell apart admin from user 
comments visually.

First approach seem better to me but we'll have to make sure our templates are 
compatible with each new magento version.
Second approach is good to make sure that if another extension changes same 
templates for its own purposes, our decoration will still work or could be 
easily adapted to work.

I would like to hear any thoughts before going any further with that.

Original comment by jamb...@gmail.com on 10 Mar 2011 at 9:27

GoogleCodeExporter commented 8 years ago
Let's use JS.
I wouldn't worry too much about showing customer name.
Even showing it as Customer: .... will be fine. Keep it simple.

Original comment by zetapri...@gmail.com on 10 Mar 2011 at 9:40

GoogleCodeExporter commented 8 years ago
Initial release pushed to repo r1433
Installed extension on mageimage.
Now every registered customer can post comments in their order detail page.
Those comments will be visible on both front end and back end of the site on 
order details pages.
For admin comments to appear to customer, admin MUST check 'Visible on 
Frontend' check box when submitting a comment. If an email to the customer 
should be sent, check 'Notify Customer by Email'.
Customer and admin comments have slight visual differences in background and 
border colors.
In admin on top of every customer comment there is 'Customer:' label.
In frontend next to every comment there is either 'You:' label if comment is 
posted by customer or 'Admin:' if comment is posted by admin.
Comments on frontend are posted using AJAX, so no page reload should happen.

Post some comments to orders and see if all works.

Original comment by jamb...@gmail.com on 10 Mar 2011 at 9:30

GoogleCodeExporter commented 8 years ago
1. Comments loose line breaks. Any change you can insert <BR> or split them 
into <P>?

2. Probably use this sandy color for comments posted by the other party and no 
b/g for your own comments. Or just set sandy for one and no b/g for the other.

3. There is a delay in showing ADMIN/YOU. It was visible enough on my machine 
to notice.

4. Adding a comment in the admin resets the way they look, looses who posted 
what.

5. "Customer notified" msg on comments placed by the customer are totally 
misleading.

Otherwise I think we are good.

Original comment by zetapri...@gmail.com on 10 Mar 2011 at 10:16

GoogleCodeExporter commented 8 years ago
Now all but 2 are connected to my comment @2.
1. I noted this in commit comment, but will repeat it here. When magento 
outputs the comments it uses escapeHtml($comment), this effectively turns any 
html like characters to entities. If I put <br/> anywhere in comment it will 
not result in line break, but in displaying it literally.
3. The delay is because all admin, you labels are inserted using javascript.
4. I haven't altered how comments are posted from admin. It probably fetches 
all comments from server once more to display them. It can be fixed.
5. Again, this is what the template does. It puts one of three messages, 
customer notified, customer not notified and notification not applicable.

All of the above problems occur from the fact that we are using magento 
templates to display those comments, and magento templates in this case are not 
designed for that.

I can probably make all your notes work using JavaScript, but this will cause 
the delay you mentioned to be even more visible.

Another solution is to override default templates and hope that no other 
extension will do the same. Which if we are going to keep this internal is not 
very likely to be a problem.

And final solution is to implement our own notification system that is totally 
separate from those order comments.

Quickest to do is JavaScript then overriding templates and last option will 
take more time.

Original comment by jamb...@gmail.com on 11 Mar 2011 at 8:42

GoogleCodeExporter commented 8 years ago
Agree. Just noted the problems I spotted from the user point of view.

When you say out notification system, do you mean using something totally 
separate outside magento or implementing it within magento?

We just need to find a compromise between the time we have to get this going 
and the usability of it all.

Not keen of messing with the template, unless there is a separate template for 
comments only.

It's of no use for us if we cannot insert line breaks. Writing instructions 
becomes impossible. Can you check line breaks with JS and insert BRs on the fly 
every time it is displayed? Those line breaks are there. Just need a 
replacement. The page will be even more "jumpy" after that. :(

Original comment by zetapri...@gmail.com on 11 Mar 2011 at 8:59

GoogleCodeExporter commented 8 years ago
When I say our - I mean it is still similar to those comments, but add another 
section to order details or something like that. Haven't thought in too much 
detail.
Unfortunately comments are mixed with other details on front page.
Admin comment form is separate template that handles only comment submission 
and display.
As I said, I can insert <br> in php and if it is escaped, use javascript to 
replace literal <br> with actual tags. I can opt for hiding comments them 
selves until all JS processing is done. It will be still slight delay but you 
will get a completely formated view when its over.

Original comment by petar....@gmail.com on 11 Mar 2011 at 9:13

GoogleCodeExporter commented 8 years ago
Whatever works for you - either replace line breaks in PHP or in HTML with JS.
The rest is minor.

Put it in MagentoConnect when ready. Copy a description template from any of 
our other extensions. Don't forget to have a link to us from there and our 
email for support.

Original comment by zetapri...@gmail.com on 11 Mar 2011 at 9:53

GoogleCodeExporter commented 8 years ago
Addressed all your concerns. Mainly using javascript.
r1434 and r1435
All this is developed and tested on 1.5 only.
Test on mageimage.

Original comment by jamb...@gmail.com on 11 Mar 2011 at 3:43

GoogleCodeExporter commented 8 years ago
Added to magentocommerce

Original comment by jamb...@gmail.com on 11 Mar 2011 at 3:54

GoogleCodeExporter commented 8 years ago
Tested on /mageimage/

1. Customer feedback is faulty in IE (customer_IE.png). Customer comments are 
not in different color and the "Customer" label is at the end of the comment it 
self.

2. Admin comment line breaks show up as <br> in the frontend 
(front_end_line.png). Line breaks in customer comments show up ok, on the other 
hand.

3. Links don't show as links in admin nor frontend (links_in_comments.png).

4. Wasn't able to test how emails show at all. For some reason, I couldn't get 
/mageimage/ to send me an email. Am I missing something obvious?

Suggestion:
I think we should either reverse the ascending/descending order of the comments 
or move the input box at the top. It seems reversed to me and a bit confusing 
at first glance.

Original comment by agur...@gmail.com on 17 Mar 2011 at 3:56

Attachments:

GoogleCodeExporter commented 8 years ago
1. This a to be a JS error of some sort. Will take a look at some point.
2. By default no html is allowed in comments and shows literally. As I have 
mentioned in previous comments, these were not intended for rich discussion. I 
am replacing literal html with actual html but only for br tags. Anything else 
is potential vulnerability. 
3. Same as above, all tags are stripped except br.
4. I have installed 
http://www.magentocommerce.com/magento-connect/ASchroder/extension/1865/aschrode
r.com-smtp-pro as part of another issue and it logs all emails that are being 
sent. You can see a log of all emails in System > Tools > Email log

Original comment by jamb...@gmail.com on 17 Mar 2011 at 6:13

GoogleCodeExporter commented 8 years ago
See now if the problems persist.

Original comment by jamb...@gmail.com on 18 Mar 2011 at 12:04

GoogleCodeExporter commented 8 years ago
Tested on /mageimage/
web_to_print_store_incl_theme   1.8.4.0alpha31 (alpha)

1. Test OK
2. Customer comments with line breaks don't show until page refresh. Same for 
all browsers. Replicate this way:
- Input multiline comment in an order as a customer and submit it
- You will see all your separate paragraphs as one paragraph without line breaks
- Refresh the page and they get fixed
3. So, we're not to expect this one to be resolved, right? URLs cannot be 
actual linked text?

4.1. Email notification template content/text needs to be decided upon. This 
can be done further on down the track, ofcourse. For now, I suggest this as a 
small change to the default template (admin_notification.png).
4.2. Line breaks also don't show in notification emails (ex. 
customer_notification.png).

Original comment by agur...@gmail.com on 18 Mar 2011 at 2:14

Attachments:

GoogleCodeExporter commented 8 years ago
2. Should be fixed now.
3. I wouldn't go that way. These comments should serve as chat like message 
boards. If we start adding rich text capabilities that will complicate things 
without bringing too much good. Another thing is that in backend it will be 
hard to represent html in comments without overriding php templates. If you 
decide that we MUST support links then I will see what can be done.

4. You're right. Email notification template content/text needs to be decided 
upon.
Customer template is default magento one so no wander there are no line breaks.
Admin template typo is fixed.

Original comment by jamb...@gmail.com on 18 Mar 2011 at 3:55

GoogleCodeExporter commented 8 years ago
2. Test OK
3. Lets leave it up to Max.
4. Typo fix OK. Line breaks not showing correctly in notification emails. Up to 
max weather we should have them fixed.

Original comment by agur...@gmail.com on 18 Mar 2011 at 4:51

GoogleCodeExporter commented 8 years ago
Can you post what the emails look like here?

Original comment by zetapri...@gmail.com on 18 Mar 2011 at 5:41

GoogleCodeExporter commented 8 years ago

Original comment by agur...@gmail.com on 18 Mar 2011 at 6:01

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by ad...@zetaprints.com on 20 Apr 2011 at 7:31