Dirty Butter Posted July 23, 2016 Share Posted July 23, 2016 I've been successful in copying the process for the Customer Comments box on Checkout, so now I have a second box for the customer to write a short message to the recipient of their gift order. I would like to limit the number of characters they can write in such a way that they can tell how many characters they have left, if that's possible. I have successfully created a modified copy of orders.print.php that shows the message from the buyer prominently and does not include pricing. I named it orders.print.gift.php. gift.print.php. (changed to make the naming simpler) But I need help to add the second printer icon on the orders.index.php so it links to the Gift version when I want to use that Packing Slip. It is NOT needed on the Order Summary page, just at the top of the individual order page where the Customer Comments and my Customer Message information are displayed. I'm guessing it will be some variation of this line in orders.index.php: <p><a href="?_g=orders&node=index&print[]={$SUMMARY.cart_order_id}" class="print" target="_blank"><i class="fa fa-print" title="{$LANG.common.print}"></i></a></p> Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted July 23, 2016 Author Share Posted July 23, 2016 Trying to figure as much of this out for myself as I possibly can. It looks like the Parse section in orders.index.inc.php needs a new section that deals with gift.print.php, as well as the current orders.print.php section - perhaps with some sort of if/then?? (In trying to simplify things, I changed the name of my file to gift.print.php.) Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted July 24, 2016 Author Share Posted July 24, 2016 It looks like I figured it out!! I duplicated the orders.index.inc.php file, changing the name to gifts.index.inc.php and changed the Parse line: // Parse $template = $GLOBALS['smarty']->fetch('templates/gift.print.php'); Now it prints the Gift packing slip or the regular packing slip, depending on which link I click. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted September 24, 2016 Author Share Posted September 24, 2016 I've run into a problem and can't seem to fix it myself. In testing I had created an order with text in the Comments AND the gift message lines. This works perfectly. But if I delete the comments from the customer, the gift message does not show up. It IS databased and will print on the Gift packing slip. There's an IF section in the orders.index.inc.php that I've played around with trying to take out the conditional part, but nothing I tried would display the DISPLAY_customer_message when there was not a customer-comments entry. I'd be perfectly happy for the comments and customer message areas to show on the Order Summary page even when they are empty, if that's the only way to make this work. $GLOBALS['smarty']->assign('OVERVIEW_SUMMARY', $overview_summary); // Show the customer comments if (!empty($overview_summary['customer_comments'])) { $GLOBALS['smarty']->assign('DISPLAY_COMMENTS', true); } // Show the customer message if (!empty($overview_summary['customer_message'])) { $GLOBALS['smarty']->assign('DISPLAY_CUSTOMER_MESSAGE', true); } Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted September 24, 2016 Author Share Posted September 24, 2016 i think I found the problem. This is working, even when there is not a customer comment: {if isset($DISPLAY_COMMENTS)} <div class="note"> <span class="actions"></span> <div class="note-header">{$LANG.orders.note_from} {$OVERVIEW_SUMMARY.first_name} {$OVERVIEW_SUMMARY.last_name}</div> "{$OVERVIEW_SUMMARY.customer_comments}" </div> {/if} {if isset($DISPLAY_CUSTOMER_MESSAGE)} <div class="note"> <span class="actions"></span> <div class="note-header">Message from {$OVERVIEW_SUMMARY.first_name} </div> "{$OVERVIEW_SUMMARY.customer_message}" </div> {/if} I had not changed the wording on the second one to $DISPLAY_CUSTOMER_MESSAGE Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted May 31, 2017 Author Share Posted May 31, 2017 I forgot to mention that I added a customer_message field to CubeCart_order_summary table. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.