X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   The Customer_Notes field, and XML in notification emails (https://forum.x-cart.com/showthread.php?t=6273)

mgatten 01-31-2004 08:50 PM

The Customer_Notes field, and XML in notification emails
 
I'm editing my /mail/order_notification_admin.tpl file to fit the specifications of a system used by my distributor for automated shipping.

One of the fields I need to include is Customer_Notes (taken from the payment screen field), but I can't figure out what the variable name is that I need to use.

Also, am I going to run into any snags embedding XML into the notification email?

As it stands, my /mail/order_notification_admin.tpl file looks like this:

Code:

{config_load file="$skin_config"}
{assign var=where value="A"}
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE b2b_pop3_order_ship SYSTEM "http://www.wdgcorp.com/dtd/b2b_pop3_order_ship.dtd">

<b2b_pop3_order_ship>
  <xtn>{$order.orderid}</xtn>
  <vendor_acct>AMB ENTERPRISES</vendor_acct>
  <whse>MCKNIGHT</whse>
  <order_number>{$order.tracking}</order_number>
  <po_number></po_number>
  <special_instructions>
!!      $comments
  </special_instructions>
  <shipper_description>{$order.firstname} {$order.lastname}</shipper_description>
  <shipper_addr1>{$order.b_address}</shipper_addr1>
  <shipper_addr2></shipper_addr2>
  <shipper_city>{$order.b_city}</shipper_city>
  <shipper_state>{$order.b_statename}</shipper_state>
  <shipper_postalcode>{$order.b_zipcode}</shipper_postalcode>
  <shipper_country>{$order.b_countryname}</shipper_country>
  <consignee_description>{$order.s_firstname} {$order.s_lastname}</consignee_description>
  <consignee_addr1>{$order.s_address}</consignee_addr1>
  <consignee_addr2></consignee_addr2>
  <consignee_city>{$order.s_city}</consignee_city>
  <consignee_state>{$order.s_statename}</consignee_state>
  <consignee_postalcode>{$order.s_zipcode}</consignee_postalcode>
  <consignee_country>{$order.s_countryname}</consignee_country>
  <ship_date>{$order.date|date_format:$config.Appearance.date_format}</ship_date>
  <ship_email>{$order.email}</ship_email>
  <ship_method>{$order.shipping}</ship_method>
  <ship_instructions>
!!      $comments
  </ship_instructions>
  <ship_billto_description></ship_billto_description>
  <ship_billto_addr1></ship_billto_addr1>
  <ship_billto_addr2></ship_billto_addr2>
  <ship_billto_city></ship_billto_city>
  <ship_billto_state></ship_billto_state>
  <ship_billto_postalcode></ship_billto_postalcode>
  <ship_billto_telephone></ship_billto_telephone>
  <ship_billterms>PREPAID</ship_billterms>
{section name=prod_num loop=$products}
  <item_entry>
      <sku>{$products[prod_num].productcode}</sku>
      <quantity>{$products[prod_num].amount}</quantity>
      <uom>Blankets</uom>
  </item_entry>
{/section}
</b2b_pop3_order_ship>


The two lines starting with !! are the ones that I need to replace with the proper variable. (Same variable, both places.)

Once I complete this and try to make it work, do you see any reasons that XCart might choke on the XML?

I'm a complete newbie when it comes to XCart and SmartyTags, so please try to avoid sailing over my head. :wink:

Thanks,
M

mgatten 01-31-2004 10:58 PM

Oooh. Not good.
 
It just dawned on me that the /mail/order_notification_admin.tpl email is sent when the order is initially placed, regardless of the outcome of the charge attempt.

#-o

This won't work, because my shipping house should only receive orders that are approved.

Is there a way to send a notification after credit card approval?

If a card is declined, or there is some other error keeping a charge from being processed, the last thing I want to do is automatically instruct my shipping house to ship the order.

Thanks,
M

mgatten 02-01-2004 01:15 AM

On further tinkering...
 
On further tinkering, I've discovered the code in func.php which sends a notification to the customer when an order is completed, in the func_complete_order function:

Code:

func_send_mail($userinfo["email"], "mail/order_cust_complete_subj.tpl", "mail/order_customer_complete.tpl", $config["Company"]["orders_department"], false);

It seems to me that I could create a new pair of .tpl files in the email directory called notification_shippinghouse.tpl and notification_shippinghouse_subj.tpl and add the following line just after the one above.

Code:

func_send_mail(shippinghouse\@miracleblanket.com, "mail/notification_shippinghouse_subj.tpl", "mail/notification_shippinghouse.tpl", $config["Company"]["orders_department"], false);

So, the question (other than "Would that work?") then becomes: Would a change to the func.php file be likely to survive a software upgrade? Would it void my customer support with X-Cart?

Are there any other gotchyas I should be aware of?

Most importantly, is there a better way to do this?

Thanks,
M


All times are GMT -8. The time now is 02:16 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.