Page 8 of 8 FirstFirst ... 678
Results 71 to 80 of 80
  1. #71
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,270
    Plugin Contributions
    1

    Default Re: Order Comments Status/Update Boilerplate

    Quote Originally Posted by simon1066 View Post
    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,
    Name:  Screenshot 2024-04-04 125606.png
Views: 173
Size:  17.6 KB

    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
    Simon

  2. #72
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,748
    Plugin Contributions
    11

    Default Re: Order Comments Status/Update Boilerplate

    Quote Originally Posted by simon1066 View Post
    ..
    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.
    author of square Webpay.
    mxWorks now has Apple Pay and Google Pay. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  3. #73
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,270
    Plugin Contributions
    1

    Default Re: Order Comments Status/Update Boilerplate

    Quote Originally Posted by carlwhat View Post
    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.
    That's great, thanks.
    Simon

  4. #74
    Join Date
    Sep 2014
    Location
    Indiana
    Posts
    102
    Plugin Contributions
    0

    Default Re: Order Comments Status/Update Boilerplate

    [Deleted comment]
    Last edited by apollowilcox; 29 May 2024 at 09:15 PM.

  5. #75
    Join Date
    Sep 2014
    Location
    Indiana
    Posts
    102
    Plugin Contributions
    0

    Default 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,

  6. #76
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,270
    Plugin Contributions
    1

    Default Re: Order Comments Status/Update Boilerplate

    Quote Originally Posted by apollowilcox View Post
    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.
    Simon

  7. #77
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,270
    Plugin Contributions
    1

    Default Re: Order Comments Status/Update Boilerplate

    Quote Originally Posted by simon1066 View Post
    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
    Simon

  8. #78
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    10,036
    Plugin Contributions
    124

    Default 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
    That Software Guy. My Store: Zen Cart Support
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  9. #79
    Join Date
    Sep 2014
    Location
    Indiana
    Posts
    102
    Plugin Contributions
    0

    Default Re: Order Comments Status/Update Boilerplate

    Lol... Thanks, but well over my head.

    My code does look like what Simon offered. Guess I'll wait for the update to the order-comments-boilerplate plug-in.
    Last edited by apollowilcox; 9 Sep 2024 at 03:28 PM.

  10. #80
    Join Date
    Sep 2014
    Location
    Indiana
    Posts
    102
    Plugin Contributions
    0

    Default 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

 

 
Page 8 of 8 FirstFirst ... 678

Similar Threads

  1. Replies: 0
    Last Post: 17 Oct 2013, 04:32 PM
  2. v151 Order Status Update / Append Comments & Noitify Customer
    By Brent in forum Managing Customers and Orders
    Replies: 4
    Last Post: 16 Oct 2013, 07:57 PM
  3. Change Email Subject of Status Update Messages e.g. Order Update XXXX
    By apemusic in forum Managing Customers and Orders
    Replies: 4
    Last Post: 13 Oct 2010, 08:42 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR