Author Topic: Can html be used when commenting an order ?  (Read 4598 times)

0 Members and 2 Guests are viewing this topic.

David M. Graham

  • Administrator
  • Sr. Member
  • *****
  • Offline Offline
  • Posts: 380
  • Karma: 12
    • View Profile
    • osCommerce University
Re: Can html be used when commenting an order ?
« Reply #22 on: October 29, 2008, 08:15:40 AM »
Not exactly.

It actually is a call to a wysiwyg editor module system.  So, once an FCKEditor module is added for example, the flip of a switch would change the editor used everywhere.

David

inetbiz

  • eCommerce Strategy Consultant
  • Administrator
  • Full Member
  • *****
  • Offline Offline
  • Posts: 135
  • Karma: 22
  • SKYNET; T3; Apple Inc. Coincidence?
    • View Profile
    • Hosting for Creloaded Cart
Re: Can html be used when commenting an order ?
« Reply #21 on: October 26, 2008, 01:11:28 AM »
Ok, looks like all we should need to start using the WYSIWYG is the includes commands at the top of the page
Is this a call to the tinyMCE editor?

David M. Graham

  • Administrator
  • Sr. Member
  • *****
  • Offline Offline
  • Posts: 380
  • Karma: 12
    • View Profile
    • osCommerce University
Re: Can html be used when commenting an order ?
« Reply #20 on: May 25, 2008, 01:35:09 AM »
Great.  I'm looking forward to seeing how it turns out.  I'll be moving soon myself.

David

tegralens

  • Newbie
  • *
  • Offline Offline
  • Posts: 37
  • Karma: 0
    • View Profile
Re: Can html be used when commenting an order ?
« Reply #19 on: May 19, 2008, 08:26:07 PM »
The only change I could see that you might need is to eliminate the changes in the start and end tags that I made to avoid the anti scripting filters.

I will try it in about 2 weeks I am in the process of moving.  I will let you know how it turns out.

David M. Graham

  • Administrator
  • Sr. Member
  • *****
  • Offline Offline
  • Posts: 380
  • Karma: 12
    • View Profile
    • osCommerce University
Re: Can html be used when commenting an order ?
« Reply #18 on: May 14, 2008, 11:24:34 PM »
The only change I could see that you might need is to eliminate the changes in the start and end tags that I made to avoid the anti scripting filters.

tegralens

  • Newbie
  • *
  • Offline Offline
  • Posts: 37
  • Karma: 0
    • View Profile
Re: Can html be used when commenting an order ?
« Reply #17 on: May 12, 2008, 09:15:31 PM »
I was unable to make those changes that you told me about it said something about wrong syntax.  I have attached my orders.php file.  please rename to orders.php.  the system does not let me upload php files

tegralens

  • Newbie
  • *
  • Offline Offline
  • Posts: 37
  • Karma: 0
    • View Profile
Re: Can html be used when commenting an order ?
« Reply #16 on: May 12, 2008, 08:22:22 AM »
Billy,

Did you say this was a Pro install or a B2B ??

David

I have pro now but in about 1 month I will already have finished updating my test site to b2b and will be using b2b.

David M. Graham

  • Administrator
  • Sr. Member
  • *****
  • Offline Offline
  • Posts: 380
  • Karma: 12
    • View Profile
    • osCommerce University
Re: Can html be used when commenting an order ?
« Reply #15 on: May 11, 2008, 12:50:31 PM »
Ok, looks like all we should need to start using the WYSIWYG is the includes commands at the top of the page:

< ? php

// Load Editor
include('includes/javascript/editor.php');
echo tep_load_html_editor();
echo tep_insert_html_editor($comments,'simple','60');
? >

Then tweak the "60" to manage the comment field size.

Change the mail configuration to use HTML email ,and done.

David

David M. Graham

  • Administrator
  • Sr. Member
  • *****
  • Offline Offline
  • Posts: 380
  • Karma: 12
    • View Profile
    • osCommerce University
Re: Can html be used when commenting an order ?
« Reply #14 on: May 10, 2008, 05:11:03 PM »
Then, at about line 600 where the comment field cell is located we change

       <td class="main"><?php echo tep_draw_textarea_field('comments', 'soft', '60', '5'); ?></td>


to

       <td class="main"><?php echo tep_draw_textarea_field('comments', 'soft', '60', '5', mce_editable="true"); ?></td>


This should make the field editable.   The remainder of the field handling does not seem to me to need any change.

Now all that is left, is to set the email to HTML type.   Forcing this through the configuration values may be all that is needed here.

David M. Graham

  • Administrator
  • Sr. Member
  • *****
  • Offline Offline
  • Posts: 380
  • Karma: 12
    • View Profile
    • osCommerce University
Re: Can html be used when commenting an order ?
« Reply #13 on: May 10, 2008, 05:08:12 PM »
ok in orders.php, just before the header ends at about line 190 we insert:

< ? php

// Load Editor
include('includes/javascript/editor.php');
echo tep_load_html_editor();
echo tep_insert_html_editor($comments,'simple','60');
? >

This should setup the editor for operation in a rather standard "simple" mode already defined by the cart.


David M. Graham

  • Administrator
  • Sr. Member
  • *****
  • Offline Offline
  • Posts: 380
  • Karma: 12
    • View Profile
    • osCommerce University
Re: Can html be used when commenting an order ?
« Reply #12 on: May 10, 2008, 05:04:11 PM »
Billy,

Did you say this was a Pro install or a B2B ??

David

tegralens

  • Newbie
  • *
  • Offline Offline
  • Posts: 37
  • Karma: 0
    • View Profile
Re: Can html be used when commenting an order ?
« Reply #11 on: May 10, 2008, 03:47:24 PM »
I am tracing out code and will post bit by bit here as I do this - so I can write up the process later.


The order comment field can be found in orders.php.   It is managed in several places - but the field itself is generated near line 595.

The comment is placed in a variable named $comments near line 73.

CRE Loaded editor fields are managed via a new function - tep_insert_html_editor() after loading the editor with tep_load_html_editor().

While TinyMCE is currently the only editor supported, the use of these functions along with editor mediation in admin/includes/javascript/editor.php makes it rather easy to add other editors to the distribution.

Next I'll look at how the system is setup to give the right editor feature set , generate the editor field, and get the data back to the update / insert routines.



Thanks keep me informed

David M. Graham

  • Administrator
  • Sr. Member
  • *****
  • Offline Offline
  • Posts: 380
  • Karma: 12
    • View Profile
    • osCommerce University
Re: Can html be used when commenting an order ?
« Reply #10 on: May 10, 2008, 12:29:59 PM »
I am tracing out code and will post bit by bit here as I do this - so I can write up the process later.


The order comment field can be found in orders.php.   It is managed in several places - but the field itself is generated near line 595.

The comment is placed in a variable named $comments near line 73.

CRE Loaded editor fields are managed via a new function - tep_insert_html_editor() after loading the editor with tep_load_html_editor().

While TinyMCE is currently the only editor supported, the use of these functions along with editor mediation in admin/includes/javascript/editor.php makes it rather easy to add other editors to the distribution.

Next I'll look at how the system is setup to give the right editor feature set , generate the editor field, and get the data back to the update / insert routines.


tegralens

  • Newbie
  • *
  • Offline Offline
  • Posts: 37
  • Karma: 0
    • View Profile
Re: Can html be used when commenting an order ?
« Reply #9 on: May 09, 2008, 09:45:16 AM »
I believe we may also need to change the email type to force HTML email from that location...

David

Ok let me know how to do all this when you can

David M. Graham

  • Administrator
  • Sr. Member
  • *****
  • Offline Offline
  • Posts: 380
  • Karma: 12
    • View Profile
    • osCommerce University
Re: Can html be used when commenting an order ?
« Reply #8 on: May 08, 2008, 10:19:18 AM »
I believe we may also need to change the email type to force HTML email from that location...

David

tegralens

  • Newbie
  • *
  • Offline Offline
  • Posts: 37
  • Karma: 0
    • View Profile
Re: Can html be used when commenting an order ?
« Reply #7 on: May 07, 2008, 11:03:35 AM »
Just the WYSIWYG change would be a matter of changing the comments field type to a tinymce field type I believe.  Will have to play with the code..

David

Let me know what you find out

David M. Graham

  • Administrator
  • Sr. Member
  • *****
  • Offline Offline
  • Posts: 380
  • Karma: 12
    • View Profile
    • osCommerce University
Re: Can html be used when commenting an order ?
« Reply #6 on: May 05, 2008, 08:26:48 PM »
Just the WYSIWYG change would be a matter of changing the comments field type to a tinymce field type I believe.  Will have to play with the code..

David

tegralens

  • Newbie
  • *
  • Offline Offline
  • Posts: 37
  • Karma: 0
    • View Profile
Re: Can html be used when commenting an order ?
« Reply #5 on: May 05, 2008, 04:13:07 PM »
This becomes a bit of a different issue presented this way.  I'm wondering if there is not something in the Paypal API's which could be used to deal with this.

Sounds like time for some API diving.

Just making the comment fields WYSIWYG compliant in an HTML sense will not really help you here.

David


It does help making the comments html in the admin because Lets say that a customer buys a product.  I ship it with paypal.  Paypal supposed to send the customer the the USPS Conf # but sometimes Paypal has issues and the number does not get to the customer.  So I like to send the customer the Conf# myself because at the same time they can login to their account and see it there and I can see it on the admin side.  What steps do I have to do in order to make it html?

The only thing I have with paypal that does not work well is when someone uses to lines for the address.  But that is a different issue.

David M. Graham

  • Administrator
  • Sr. Member
  • *****
  • Offline Offline
  • Posts: 380
  • Karma: 12
    • View Profile
    • osCommerce University
Re: Can html be used when commenting an order ?
« Reply #4 on: May 05, 2008, 03:35:45 PM »
This becomes a bit of a different issue presented this way.  I'm wondering if there is not something in the Paypal API's which could be used to deal with this.

Sounds like time for some API diving.

Just making the comment fields WYSIWYG compliant in an HTML sense will not really help you here.

David

tegralens

  • Newbie
  • *
  • Offline Offline
  • Posts: 37
  • Karma: 0
    • View Profile
Re: Can html be used when commenting an order ?
« Reply #3 on: May 05, 2008, 01:53:05 PM »
It can be done.  The questions are, should it be done, and if so , where and how?

If it should be done at all I'd suggest that the place to do it is only in the Admin.  Most customers are unlikely to want to take the time to format these comments, and adding it customer side would open up another vulnerability point for SQL injection.

Just what did you have in mind?
Thanks for the Quick response.  Yes I only want it on the admin.  Would you happen to know how?  The issue is that I have to copy over the USPS tracking info to the admin side to notify my customers about their tracking info.  I would rather copy the html link that paypal gives me so they only have to click on it and not have to go to the usps website to hen write the usps number. I have 6.2 pro patch 11 Thanks
« Last Edit: May 05, 2008, 01:55:11 PM by tegralens »

David M. Graham

  • Administrator
  • Sr. Member
  • *****
  • Offline Offline
  • Posts: 380
  • Karma: 12
    • View Profile
    • osCommerce University
Re: Can html be used when commenting an order ?
« Reply #2 on: May 05, 2008, 12:26:04 PM »
It can be done.  The questions are, should it be done, and if so , where and how?

If it should be done at all I'd suggest that the place to do it is only in the Admin.  Most customers are unlikely to want to take the time to format these comments, and adding it customer side would open up another vulnerability point for SQL injection.

Just what did you have in mind?

tegralens

  • Newbie
  • *
  • Offline Offline
  • Posts: 37
  • Karma: 0
    • View Profile
Can html be used when commenting an order ?
« Reply #1 on: May 05, 2008, 09:21:21 AM »
I want to know instead of using  the text version if the comments box when customers make order can it be change to use WYSIWYG. That way I can use html codes.  If so how can I do it?  Thanks