|
|
Radical Hacks :
|
|
|
|
 |
HTML Formatted Email Receipt for WebStore
|
 |
|
|
|
sent in the following hack...
#####################################################################
# Web_Store receipt in HTML format
# By Guinevere Orvis guin@NO-SPAMcanada.com
# This hack allows you to send an email receipt in HTML format via
# email to your customer.
#####################################################################
#Introduction
#
#The HTML in this example is very basic. You can spruce it up with your own colour and
#pictures. However, it does format a nice table for details of the order like this:
<table><tr><td>Description</td> <td> = Ray Ban Sunglasses</td></tr>
<tr><td>Quantity:</td> <td> = 1</td></tr>
<tr><td>Price:</td> <td>78.00 Dollars</td></tr>
and so on...
#This hack sends HTML email to the customer AND the store owner.
#This hack assumes you have already installed a specific hack to email a receipt to a client.
#See Step 1 for which email to client hack you need.
# Breakdown of Steps:
Step 1 tells you which "email receipt to customer" hack you need installed and where to
get it.
Step 2 formats the email as HTML
Step 3 formats the text before the cart data. You can customize to your liking, but don't
forget the <TABLE><TR><TD> before: ". $text_of_cart; as it opens a table for the next steps
Steps 4 and 5 formats the data of the cart into a neat table.
# Here's the hack!
#------------------------------------
#Step 1: install the "email receipts to a client" hack by Angelina Hedgepeth and
#Ignaciao Bustamonte, available here:
#
#http://www.extropia.com/support/faq/extropia_cgi_install_faq.html#webStoreReceipts
#
#If extropia has updated their site and the link above is outdated, it is listed on the
#FAQ section of the web store - not the "cool hacks".
#------------------------------------
#
#Step 2:
#
#in mail-lib.pl around line 138 says:
#
To: $touser
From: $fromuser
Subject: $subject
Status:
$messagebody
#change this to:
To: $touser
From: $fromuser
Subject: $subject
Mime-version: 1.0
Content-type: text/html; charset="US-ASCII"
Content-transfer-encoding: quoted-printable
Status:
$messagebody ------------------------------------
#Step 3: web_store_order_lib.pl around line 624 where it says:
# IBM 06-09-97 next line # Fill $text_of_cart_to_customer # with contents of $text_of_cart $text_of_cart_to_customer = (NOTE: this is part of the code added with the email hack already implemented)
#I changed my $text_of_cart_to_customer to:
$text_of_cart_to_customer = "Hello $form_data{'01- Title'} $form_data{'03-Lname'}, thank you for ordering from name of our store.
The following was ordered:
". $text_of_cart;
#(I've simplified the HTML here, spruce it up to your suit your store). ------------------------------------
#Step 4: web_store_html_lib.pl around line 1072 where it says:
$sc_cart_display_fields[$display_counter]) . "= $price\n"; change to: $sc_cart_display_fields[$display_counter]) . "= $price\n";
#Then a bit further down:
$sc_cart_display_fields[$display_counter]) . "= $cart_fields[$display_index]\n"; change to: $sc_cart_display_fields[$display_counter]) . "= $cart_fields[$display_index]\n";
#Then a bit futher down again...
$text_of_cart .= &format_text_field("Quantity") . "= $quantity\n"; $text_of_cart .= &format_text_field("Subtotal For Item") . "= $price\n"; change to: $text_of_cart .= &format_text_field("Quantity") . "= $quantity\n"; $text_of_cart .= &format_text_field("Subtotal For Item") . "= $price\n"; ------------------------------------
#Step 5: in web_store_order_lib.pl around line 240 where it says:
$text_of_cart .= &format_text_field("Shipping:") . "= $final_shipping\n\n";
#change to
$text_of_cart .= &format_text_field("Shipping:") . "= $final_shipping\n\n";
#then in the next if statement:
$text_of_cart .= &format_text_field("Discount:") . "= $final_discount\n\n";
#change to:
$text_of_cart .= &format_text_field("Discount:") . "= $final_discount\n\n";
#then in the next if statement:
$text_of_cart .= &format_text_field("Sales Tax:") . "= $final_sales_tax\n\n";
#change to: $text_of_cart .= &format_text_field("Sales Tax:") . "= $final_sales_tax\n\n";
#then in the next if statement:
$text_of_cart .= &format_text_field("Grand Total:") . "= $grand_total\n\n"
#change to:
$text_of_cart .= &format_text_field("Grand Total:") . "= $grand_total\n\n";
#NOW YOU'RE DONE!
|
|