Jump to content

How to link to TWO Order Print Pages


Dirty Butter

Recommended Posts

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>

Link to comment
Share on other sites

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.)

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

  • 2 months later...

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);
			}

 

Link to comment
Share on other sites

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>
            &quot;{$OVERVIEW_SUMMARY.customer_comments}&quot;
         </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>
            &quot;{$OVERVIEW_SUMMARY.customer_message}&quot;
         </div>
         {/if}

I had not changed the wording on the second one to $DISPLAY_CUSTOMER_MESSAGE

Link to comment
Share on other sites

  • 8 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...