Difference between revisions of "Email Orders"

From Custom Scriptz
Jump to: navigation, search
(Installation Instructions)
Line 142: Line 142:
 
# Upload all files that are inside the folder "uploads" to your shop-root directory by using your preferable ftp software. Don't upload the folder "uploads", upload what's inside of it.
 
# Upload all files that are inside the folder "uploads" to your shop-root directory by using your preferable ftp software. Don't upload the folder "uploads", upload what's inside of it.
 
# Go to Customers -> Email Orders (if you have Admin Profiles mod, when you try to access this page you will get a 'Denied' warning, so you must go to Tools -> Admin Settings and allow access to this page and try to access it again). After you access this page Email Orders will be automatically installed and you will see a success message.
 
# Go to Customers -> Email Orders (if you have Admin Profiles mod, when you try to access this page you will get a 'Denied' warning, so you must go to Tools -> Admin Settings and allow access to this page and try to access it again). After you access this page Email Orders will be automatically installed and you will see a success message.
 +
# If you don't to send old orders, append "?action=reset" to your URL. eg. http://www.yourshopaddress.com/admin/email_orders.php?action=reset
  
 
== Manually editing manufacturers.php file ==
 
== Manually editing manufacturers.php file ==

Revision as of 00:49, 22 October 2009

Email Orders is a module developed by Custom Scriptz for Zen Cart where Manufacturers can receive emails with their sold products for each order.


This module is free?

  • No, this module isn't free and it's for salebought at our scripts store.

This module is supported by Zen Cart Team?

  • No, we support this module as soon as you have a valid license.

System Requirements

ionCube Loaders
PHP 5.x.x or newer
MySQL 5

Features

  • Send email messages separately by manufacturer that have their products bought in the same order.
  • Example:

Customer buy 10 products from 3 different Manufacturers (often called Designers by Scrapbooking Store Owners). When you use Email Orders, 3 email messages will be sent out with the following contents:

  • ManufacturerA: receive an email message with 3 products and his totals (with discount if any)
  • ManufacturerB: receive an email message with 2 products and his totals (with discount if any)
  • ManufacturerC: receive an email message with 5 products and his totals (with discount if any)
  • Store Owner: receive an email message containing an report with the orders totals sent to this manufacturers.
  • If any coupon is used, the discount will be restricted only to the products/categories that have restriction to it. If a coupon is used and no restriction is applied, the discount is applied to all products for all emails with his own discount.

This module is aimed to be used at Stores that have their default currency set to USD. In the future versions will support different currencies.

Demo Message

Email sent to ManufacturerA

EMAIL ORDER #328

Order Number #6255
Date: 2009-05-30 23:23:39

PRODUCTS ORDERED
---------------------------------
Product name: Example4
Product price: $2.50 (Coupon Applied)
Product quantity: 1
Download 01 of 01

Product name: Example5
Product price: $2.50 (Coupon Applied)
Product quantity: 1
Download 01 of 01

Product name: Example6
Product price: $4.00
Product quantity: 1
Download 01 of 01

---------------------------------
Sub-Total: $9.00
Coupon Discount: $5.00 (Coupon Code: coupon_test_code)
Total: $4.00

Email sent to ManufacturerB

EMAIL ORDER #329

Order Number #6255
Date: 2009-05-30 23:23:39

PRODUCTS ORDERED
---------------------------------
Product name: Example3
Product model: Model_Test3
Product price: $3.50
Product quantity: 1
Download 01 of 01

---------------------------------
Sub-Total: $3.50
Coupon Discount: $0.00
Total: $3.50

Email sent to ManufacturerC

EMAIL ORDER #330

Order Number #6255
Date: 2009-05-30 23:23:39

PRODUCTS ORDERED
---------------------------------
Product name: Example1
Product model: Model_Test1
Product price: $3.50
Product quantity: 1
Download 01 of 01

Product name: Example2
Product model: Model_Test2
Product price: $3.00
Product quantity: 1
Download 01 of 01

---------------------------------
Sub-Total: $6.50
Coupon Discount: $0.00
Total: $6.50

And finally, this is the email that the Store Owner receive at each batch sent:

Email Orders Sent Report
05/30/2009 23:23:39

Email Messages Sent: 3
---------------------------------
ManufacturerA
---------------------------------
Email Order #328 - Order #6255 - Sub-Total: $9.00 - Coupon Discount: $5.00 (Coupon Code: coupon_test_code)

ManufacturerB
---------------------------------
Email Order #329 - Order #6255 - Sub-Total: $3.50

ManufacturerC
---------------------------------
Email Order #330 - Order #6255 - Sub-Total: $6.50

Sub-Total: $19.00
Discounts Total: $5.00
Orders Total: $14.00

Before Installing

This modification needs to replace the file 'admin/manufacturers.php' with a modified one, if you have modded this file, do the replacements by hand in the bottom of this page.
The moded file is compatible with Zen Cart v1.3.8a and it's located at the directory 'extras' within this zip.
If you have not changed the original file and your Zen Cart version is 1.3.8a, you can safely replace the file 'admin/manufacturers.php' with the modified one. Just upload the 'admin' directory that is inside your 'extras' directory to your shop-root dir. ex. /home/username/public_html/shop or you can merge the 'admin' directory that is inside the 'extras' directory with the 'upload' directory.

Installation Instructions

If you receive a message that you don't have ionCube loaders you can:

  • Pay us to do it for you (if you are on a shared hosting, this feature maybe be locked by the hosting company, so we can only suggest you to move to another server)
  • Ask your host company to do it for you
  • Do yourself by going to your Cpanel -> PHP Config -> and activate ionCube loaders from there using a php.ini file (if you have ionCube already installed on your host).



Ok, I meet all the requiments, let's get started.

  1. Make a backup of your database and files.
  2. Uncompress the zip file that you downloaded from our Client Area to a temp folder on your computer.
  3. Inside the Zip, you will notice two folders: extras and uploads and one file called README.txt
  4. If your admin directory has a different name other than "admin", change it.
  5. Upload all files that are inside the folder "uploads" to your shop-root directory by using your preferable ftp software. Don't upload the folder "uploads", upload what's inside of it.
  6. Go to Customers -> Email Orders (if you have Admin Profiles mod, when you try to access this page you will get a 'Denied' warning, so you must go to Tools -> Admin Settings and allow access to this page and try to access it again). After you access this page Email Orders will be automatically installed and you will see a success message.
  7. If you don't to send old orders, append "?action=reset" to your URL. eg. http://www.yourshopaddress.com/admin/email_orders.php?action=reset

Manually editing manufacturers.php file

File: shop-root/admin/manufacturers.php

FIND:

$manufacturers_name = zen_db_prepare_input($_POST['manufacturers_name']);

AFTER THAT LINE ADD:

$manufacturers_email = zen_db_prepare_input($_POST['manufacturers_email']);

FIND:

$sql_data_array = array('manufacturers_name' => $manufacturers_name);

REPLACE WITH:

$sql_data_array = array('manufacturers_name' => $manufacturers_name, 'manufacturers_email' => $manufacturers_email);

FIND:

$manufacturers_query_raw = "select manufacturers_id, manufacturers_name, manufacturers_image, date_added, last_modified from " . TABLE_MANUFACTURERS . " order by manufacturers_name";

REPLACE WITH:

$manufacturers_query_raw = "select manufacturers_id, manufacturers_name, manufacturers_email, manufacturers_image, date_added, last_modified from " . TABLE_MANUFACTURERS . " order by manufacturers_name";

FIND:

$contents[] = array('text' => '<br>' . TEXT_MANUFACTURERS_NAME . '<br>' . zen_draw_input_field('manufacturers_name', '', zen_set_field_length(TABLE_MANUFACTURERS, 'manufacturers_name')));

AFTER THAT LINE ADD:

$contents[] = array('text' => '<br>' . TEXT_MANUFACTURERS_EMAIL . '<br>' . zen_draw_input_field('manufacturers_email', '', 100));

FIND:

$contents[] = array('text' => '<br />' . TEXT_MANUFACTURERS_NAME . '<br>' . zen_draw_input_field('manufacturers_name', $mInfo->manufacturers_name, zen_set_field_length(TABLE_MANUFACTURERS, 'manufacturers_name')));

AFTER THAT LINE ADD:

$contents[] = array('text' => '<br />' . TEXT_MANUFACTURERS_EMAIL . '<br>' . zen_draw_input_field('manufacturers_email', $mInfo->manufacturers_email, 100));

FIND:

$contents[] = array('text' => '<br>' . zen_info_image($mInfo->manufacturers_image, $mInfo->manufacturers_name));

AFTER THAT LINE ADD:

$contents[] = array('text' => '<br>' . $mInfo->manufacturers_email);

SAVE, CLOSE AND UPLOAD TO YOUR shop-root/admin DIR

After installing

  • Go to Catalog -> Manufacturers and edit each Manufacturer Email Address. If you don't type the email address for a particular Manufacturer, when you try to send a email order for him/her, you will get a error and the email will not be sent until you type his email address.
  • By default the software is set to work in Debug Mode, after you are done testing, you may want to change it to live mode, to do this go to Configuration -> Email Orders -> Debug Mode and set this to False. While debug mode is On, you will see a report at your screen like how the email message would be sent, but no emails will be send until you set debug mode to False.

Upgrading Instructions

  • Make a backup of your database and files.
  • Just upload the files that are inside 'uploads/admin' to your 'admin' dir and you are done. Once you access Email Orders, it will automatically detect and update your current version.

Settings Available

The settings below can be found at: Configuration -> Email Orders

  • Activate AutoSend: If you want the Email Orders to send emails automatically after each processed order, set this to True.
  • Debug Mode: If this is set to True, you will see the email that would be sent out, but it will not send any email until this is change to True.
  • Include Free Products: If you want to include Free Products on your emails, set this to True.
  • Maximum Emails per Batch: Set the maximum number of emails to be processed for each batch when AutoSend is used. Do not set this too high because of the send limit of emails on your host.
  • Minimum Order Status: Set the minimum order status the orders must be for the products to be available to be sent. You don't want pending orders being send out.
  • Send $0 Email Orders: If the Order Total is $0, would like to send it anyway? Set to false to not send the email when the Order is $0.00 (ex. after a coupon of 100% is applied towards the entire order, the order total will be $0, so if this is false, no one will receive a email)
  • Show Customer Details: Set if the email message sent to the manufacturers should contain the customer details as name, address, telephone, email, etc. Strongly recommended set this to false, because of privacy policy.

The setting below can be found at: Customers -> Email Orders

  • Send Old: You can resend products that have been sent already, when you access the Email Orders page, you will see a 'Send Old' button at the top of the page (allright, I'll move that button to the statistics panel :p). So you click the Send Old and do a search for the period that you want and send the products again as you do normally. Note: Products that have been sent will not disappear for this list, instead the column 'Sent Times' will increase by 1 each time you send the order. If you want to send new emails, just click the Send New button.

The setting below can be found at: Catalog -> Manufacturer -> Manufacturer New/Edit Page

  • Manufacturers Email: This is necessary if you want to send email to this manufacturer.

Tutorial

The first step is not necessary if your Shop is just installed or you don't have any admin besides you.

  • Go to Customers -> Email Orders.
  • In this page you will see a list of Products with their respective Manufacturers. Check the products (99% of the time you will leave all products checked - but you can un/check all the boxes at once - just click the link on the top of the checkboxes column) that you want your manufacturers to receive the email from it and press the button "Send". If everything nothing goes wrong, your manufacturers should receive a email right way with his bought products. Now you are done sending and the next batch/page (if there are remaining products) will be displayed and you press the button "Send" to start again. If failed to send the email out (manufacturer with no email address for example) the products will be displayed again until you you correct the email address at the Manufacturers page. After you are confortable using email orders, if you haven't done so, activate AutoSend and it will do it for you.

Emails Note

This module send a email for each order for each manufacturer that has products in the order. Ex. Order #1234 -> 3 Manufacturers envolved, 3 email messages will be sent out, Order #1235 -> The same 3 Manufacturers, 3 email will sent out for that and this particular order, total = 6 messages. Before complaining that the tool is not working, check your email settings at My Store -> E-Mail Options or ask your host to increase the limit of email messages that you can send per hour. Maybe you have reach this limit.

FAQ

  • One product does not appear on the list for me to send, why?
  • Check if this a product have a manufacturer set up on the Products Page. This is a free product and your configuration is set to 'False' to include free products.


Change Log

Version 1.0

Initial release

Version 1.1

Fixed discounts

Version 1.2

Included report to store owners

Version 1.3

Fixed minor bugs
Created Configuration Group

Version 1.4

Included Configuration to Include Free Products
Included Configuration to Send or not orders that are $0.00 

Version 1.5

Fixed some configurations

Version 1.6

Moved all the code to a class file - preparing to AutoSend feature

Version 1.7

Included initial test to AutoSend
Corrected Debug Mode messages

Version 2.0

Many improvements
Created Send Old Emails

Version 3.0

Created automatic installer
Rewritten mostly of the codes to better perfomance
Deleted some useless configurations

Version 3.1 ~ 3.6

Fixed minor bugs

Version 3.7

Included "Minimum Order Status" configuration

For Bugs, Suggestions and Requests, go to http://customscriptz.com