+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 16

Thread: Adding fields to order notification email

  1. #1
    Registered User
    Join Date
    Dec 2005
    Posts
    23
    Squirrelcart version
    v2.2.3

    Adding fields to order notification email

    Is it possible to have all contact info the complete address all fields and phone/fax numbers included in the Order notification email?
    If so how please tell me how ideally it would just be a matter of checking boxes in the store set up.

  2. #2
    Client
    Join Date
    Mar 2006
    Location
    Ontario, Canada
    Posts
    282
    Squirrelcart version
    v3.4.0

    Do You Mean Like This?

    On our shipping info I have edited to show the following:

    Order Number
    Billing Phone Number
    Shipping Phone Number
    Email Address
    Order Date

    I find that this is important info so it is printed as part of the invoice... Also, did you notice that I put all that info into a separate info box?

    If this is what you're looking for - I'll post the code... let me know...

    Image is attached...
    Attached Images

  3. #3
    Registered User
    Join Date
    Dec 2005
    Posts
    23
    Squirrelcart version
    v2.2.3

    Please post the code

    Glad you could work out how to do it, get the hidden fields. I want all the address fields often overseas address are more than 3 lines long also I want the phone and email.

    I looked at order_notification_email.php and order_notification_email.tpl.php both seened to have all the data fileds But email_order.func.php just looked very complicated.

  4. #4
    Squirrelcart Staff Jamie's Avatar
    Join Date
    May 2002
    Posts
    6,719
    Squirrelcart version
    v3.3.7
    Quote Originally Posted by vajra View Post
    Glad you could work out how to do it, get the hidden fields. I want all the address fields often overseas address are more than 3 lines long also I want the phone and email.

    I looked at order_notification_email.php
    You don't need to (and shouldn't) modify that file for this.

    ...and order_notification_email.tpl.php
    That template is for the plain text version of the order email. Unless you have your email preference on your admin account set to plain text, you shouldn't modify this template either.

    ...But email_order.func.php just looked very complicated.
    That's a function file. It shouldn't be modified.

    *The template file you need for this is order_email_merchant_html.tpl.php in v3.x, and order_notify_email_htm.tpl.php in v2.x.

    Instructions

    1. If you haven't already, read this:
      http://squirrelcart.com/help/?Modifying%20Templates.html


    2. If you don't have a custom theme, create one:
      http://squirrelcart.com/help/?Creating%20a%20Custom%20Theme.html

      and set it as your store's default theme:
      http://squirrelcart.com/help/?Changing%20the%20Default%20Theme.html


    3. Open any order in edit mode:
      http://squirrelcart.com/help/?Viewing%20Orders.html


    4. Write down the names of the fields that you want to add to your order emails
    5. Put a copy of the template file listed above (in the line with the *) in your custom theme folder squirrelcart/themes/CUSTOM_THEME_NAME


    6. Open that copy in an editor
    7. Add any variable you like in this format:

      PHP Code:
      <?=$Bill_Phone?>
      <?=$Ship_Company?>
      etc...
      Field names should match what you wrote down, but with underscores in place of spaces.
    8. Save the file

  5. #5
    Registered User
    Join Date
    Dec 2005
    Posts
    23
    Squirrelcart version
    v2.2.3

    Bill_Country

    Thanks your fix works fine apart from <?=$Bill_Country ?> the country shows as a number ie 180 for the US.

    How can I fix this?

  6. #6
    Squirrelcart Staff Jamie's Avatar
    Join Date
    May 2002
    Posts
    6,719
    Squirrelcart version
    v3.3.7
    Use Bill_Country_Name or Ship_Country_Name. You can also use Bill_Country_Abbrev if you happen to have all the country abbreviations memorized.

    Bill_State_Name, Ship_State_Name, Bill_State_Abbrev, and Ship_State_Abbrev may also be useful.

  7. #7
    Registered User
    Join Date
    Dec 2005
    Posts
    23
    Squirrelcart version
    v2.2.3

    Bill_Country

    Thanks its now working just fine. V

  8. #8
    Squirrelcart Staff Jamie's Avatar
    Join Date
    May 2002
    Posts
    6,719
    Squirrelcart version
    v3.3.7
    You're welcome

  9. #9
    Registered User
    Join Date
    Dec 2005
    Posts
    23
    Squirrelcart version
    v2.2.3

    printing

    when the order_notify_email is printed its too wide it cuts of the right hand edge. I tried to adjust the template box width but it did not work is there a css setting to be changed?

  10. #10
    Squirrelcart Staff Jamie's Avatar
    Join Date
    May 2002
    Posts
    6,719
    Squirrelcart version
    v3.3.7
    The order emails print fine by default. It sounds like you might need to change your printer settings.

  11. #11
    Registered User
    Join Date
    Dec 2005
    Posts
    23
    Squirrelcart version
    v2.2.3

    printing

    When the email is oped to see it all requires you to scroll. You see about 90% of the email width however you have the program browser set in this case thunderbird. I assume this is the same reason why there is a problem printing. Other emails print just fine.

  12. #12
    Registered User
    Join Date
    Nov 2008
    Posts
    55
    Squirrelcart version
    not specified!
    I'm trying to get this to work. I've added:

    <table class="address_block" cellspacing="0" cellpadding="4" align="left">
    <tr class="header_row">
    <td colspan="2"> Shipping Info</td>
    </tr>
    <tr>
    <td style="text-align: left">
    <?=$Order_Number?>
    <br />
    <?php /*DO NOT MODIFY THIS LINE!*/ if ($Bill_Phone) { ?>
    <?=$Bill_Phone?>
    <br />
    <?php /*DO NOT MODIFY THIS LINE!*/ if ($Ship_Phone) { ?>
    <?=$Ship_Phone?>
    <br />
    <?=$Ship_Email_Address?>
    <br />
    <?=$Order_Date?>
    </td>
    </tr>
    </table>
    I keep getting php errors though when checking out.
    Any ideas??

  13. #13
    Registered User
    Join Date
    Nov 2008
    Posts
    55
    Squirrelcart version
    not specified!
    designwerks, can you please paste the code you have in your order_notify_email_htm.tpl file? php gives me a headache!

    Thank you.

  14. #14
    Client
    Join Date
    Mar 2006
    Location
    Ontario, Canada
    Posts
    282
    Squirrelcart version
    v3.4.0

    Code On Its Way...

    I'll have to do it when I return to the office. Can you send me a reminder email later this evening.

    John

  15. #15
    Squirrelcart Staff Jamie's Avatar
    Join Date
    May 2002
    Posts
    6,719
    Squirrelcart version
    v3.3.7
    wetjet550:
    PHP Code:
    <table class="address_block" cellspacing="0" cellpadding="4" align="left">
                          <tr class="header_row">
                            <td colspan="2"> Shipping Info</td>
                          </tr>
                          <tr>
                            <td style="text-align: left">
                            <?=$Order_Number?>
                                <br />
                                <?php /*DO NOT MODIFY THIS LINE!*/ if ($Bill_Phone) { ?>
                                <?=$Bill_Phone?>
                                <br />
                                <?php /*DO NOT MODIFY THIS LINE!*/ if ($Ship_Phone) { ?>
                                <?=$Ship_Phone?>
                                <br />
                                <?=$Ship_Email_Address?>
                                <br />
                                <?=$Order_Date?>
                            </td>
                          </tr>
                        </table>
    You have if statements, and aren't ending them which will cause parse errors. This is a better version of the code you pasted without parse errors:
    PHP Code:
    <table class="address_block" cellspacing="0" cellpadding="4" align="left">
        <tr class="header_row">
            <td colspan="2"> Shipping Info</td>
        </tr>
        <tr>
            <td style="text-align: left">
                <?php print $Order_Number ?><br />
                <?php if (!empty($Bill_Phone)) print "$Bill_Phone<br/> "?>
                <?php if (!empty($Ship_Phone)) print "$Ship_Phone<br/> "?>
                <?php print $Ship_Email_Address ?><br />
                <?php print $Order_Date ?>
            </td>
        </tr>
    </table>

+ Reply to Thread
Page 1 of 2 1 2 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts