Ok this is for anyone who wants to install this contribution. You'll see from my posts above that I have a lot of trouble getting this to work, and this is compounded by the lack of installation support.
So I struggled on and found a lot of errors in the code and corrected them... whilst re-writing the installation instructions to make this contribution easier install.
So here's how to install this contribution with the edited code.... just cut and paste
Step 1:
--------
BACKUP your database and any files that will be amended before beginning
Step 2:
--------
Back up the files you are about to edit that are listed below incase you make an error.
Step 3:
--------
Open db/quickbooks_integration.sql file and run this as a SQL Querry on your server, It will prepare the database for this
module.
Step 4:
--------
Now copy the files in code_files folder to their respective places on your server. As an example open folder admin and copy
the contents to your server in the directory admin; Then open admin/includes and copy the files to the admin/includes
directory on your server and so on. DO NOT copy the folders as they will over right your directories.
Step 5:
--------
Upload the quickbooks folder containing the Import and export folders to your catalouge directory
Step 6:
--------
MODIFY the following files: (don't forget to back up)
File: admin/includes/application_top.php
Find:
// set application wide parameters
$configuration_query = tep_db_query('select configuration_key as cfgKey, configuration_value as cfgValue from ' .
TABLE_CONFIGURATION);
while ($configuration = tep_db_fetch_array($configuration_query)) {
define($configuration['cfgKey'], $configuration['cfgValue']);
}
Add below:
//set quickbooks parameters
$quickbooks_configuration_query = tep_db_query('select configuration_key as cfgKey, configuration_value as cfgValue from
' . TABLE_QUICKBOOKS_CONFIG);
while ($quickbooks_configuration = tep_db_fetch_array($quickbooks_configuration_query)) {
define($quickbooks_configuration['cfgKey'], $quickbooks_configuration['cfgValue']);
}
File: admin/includes/classes/box.php
Find:
?>
Replace with:
function simpleBox($contents){
return $this->tableBlock($contents);
}
?>
File: admin/includes/classes/order.php
Find:
$order_query = tep_db_query("select customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, currency, currency_value, date_purchased, orders_status, last_modified from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'");
Replace with:
$order_query = tep_db_query("select customers_name, customers_id, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, currency, currency_value, date_purchased, orders_status, last_modified from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'");
Find:
$totals_query = tep_db_query("select title, text from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$order_id . "' order by sort_order");
Replace with:
$totals_query = tep_db_query("select title, text from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$order_id . "' order by sort_order");
$order_total_query = tep_db_query("select text from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$order_id . "' and class = 'ot_total'");
$order_total = tep_db_fetch_array($order_total_query);
$shipping_method_query = tep_db_query("select title,value from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$order_id . "' and class = 'ot_shipping'");
$shipping_method = tep_db_fetch_array($shipping_method_query);
Find:
$this->info = array('currency' => $order['currency'],
'currency_value' => $order['currency_value'],
Replace with:
$this->info = array('order_id' => $order_id,
'currency' => $order['currency'],
'currency_value' => $order['currency_value'],
'total' => strip_tags($order_total['text']),
'shipping_method' => ((substr($shipping_method['title'], -1) == ':') ?
substr(strip_tags($shipping_method['title']), 0, -1) : strip_tags($shipping_method['title'])),
'shipping_cost' => strip_tags($shipping_method['value']),
Find:
$this->customer = array('name' => $order['customers_name'],
'company' => $order['customers_company'],
Replace with:
$this->customer = array('id' => $order['customers_id'],
'name' => $order['customers_name'],
'company' => $order['customers_company'],
Find:
$orders_products_query = tep_db_query("select orders_products_id, products_name, products_model, products_price, products_tax, products_quantity, final_price from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$order_id . "'");
Replace with:
$orders_products_query = tep_db_query("select orders_products_id, products_name, products_model, products_price, products_tax, products_quantity, products_warehouse_location, final_price from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$order_id . "'");
Find:
while ($orders_products = tep_db_fetch_array($orders_products_query)) {
$this->products[$index] = array('qty' => $orders_products['products_quantity'],
'name' => $orders_products['products_name'],
Replace with:
while ($orders_products = tep_db_fetch_array($orders_products_query)) {
$this->products[$index] = array('qty' => $orders_products['products_quantity'],
'name' => $orders_products['products_name'],
'products_warehouse_location' => $orders_products['products_warehouse_location'],
File: admin/includes/column_left.php
Find:
require(DIR_WS_BOXES . 'configuration.php');
require(DIR_WS_BOXES . 'catalog.php');
Replace with:
require(DIR_WS_BOXES . 'configuration.php');
require(DIR_WS_BOXES . 'catalog.php');
require(DIR_WS_BOXES . 'quickbooks.php');
File: admin/includes/configure.php
Find:
define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backups/');
Replace with:
define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backups/');
define('DIR_WS_JAVASCRIPT', DIR_WS_INCLUDES . 'javascript/');
File: admin/includes/database_tables.php
Find:
define('TABLE_ORDERS_PRODUCTS_DOWNLOAD', 'orders_products_download');
define('TABLE_ORDERS_STATUS', 'orders_status');
define('TABLE_ORDERS_STATUS_HISTORY', 'orders_status_history');
define('TABLE_ORDERS_TOTAL', 'orders_total');
Replace with:
define('TABLE_ORDERS_PRODUCTS_DOWNLOAD', 'orders_products_download');
define('TABLE_ORDERS_STATUS', 'orders_status');
define('TABLE_ORDERS_STATUS_HISTORY', 'orders_status_history');
define('TABLE_ORDERS_TOTAL', 'orders_total');
define('TABLE_QUICKBOOKS_CONFIG', 'quickbooks_configuration');
define('TABLE_QUICKBOOKS_CUSTOM_FIELDS_TO_PRODUCTS', 'quickbooks_custom_fields_to_products');
define('TABLE_QUICKBOOKS_SESSION', 'quickbooks_session');
define('TABLE_QUICKBOOKS_IMPORT_LOG', 'quickbooks_import_log');
define('TABLE_QUICKBOOKS_TO_OSCOMMERCE_CATEGORIES', 'q_to_o_categories');
File: admin/includes/filenames.php
Find:
?>
Replace with:
define('FILENAME_QUICKBOOKS_PREREQUISITES', 'quickbooks_prerequisites.php');
define('FILENAME_QUICKBOOKS_UPDATE_PRODUCTS', 'quickbooks_update_products.php');
define('FILENAME_QUICKBOOKS_CUSTOM_FIELDS', 'quickbooks_custom_fields.php');
define('FILENAME_QUICKBOOKS_UPDATE_LOG','quickbooks_update_log.php');
define('FILENAME_QUICKBOOKS_CONFIGURATION', 'quickbooks_configuration.php');
define('FILENAME_QUICKBOOKS_EXPORT_ORDERS', 'quickbooks_export_orders.php');
?>
File: admin/includes/functions/general.php
Find:
?>
Replace with:
////
// need to get a unique naming format for export by orders
function tep_get_name_export_orders($accountId, $first_name = "", $last_name = "", $company_name){
$name_export_orders = '';
switch (QUICKBOOKS_NAME_FORMAT){
case 'Last Name, First Name':
$name_export_orders = ucfirst($last_name) . ', ' . ucfirst($first_name);
break;
case 'Last Name, First Name (osCommerce Acct. Number)':
$name_export_orders = ucfirst($last_name) . ', ' . ucfirst($first_name) . ' (' . $accountId . ')';
break;
case 'First Name Last Name' :
$name_export_orders = ucfirst($first_name) . ' ' . ucfirst($last_name);
break;
case 'First Name Last Name (osCommerce Acct. Number)':
$name_export_orders = ucfirst($first_name) . ' ' . ucfirst($last_name) . ' (' . $accountId . ')';
break;
case 'Company Name (osCommerce Acct. Number)':
if ($company_name)
$name_export_orders = ucfirst($company_name) . ' (' . $accountId . ')';
else
$name_export_orders = ucfirst($last_name) . ', ' . ucfirst($first_name) . ' (' . $accountId . ')';
break;
case 'Company Name' :
if ($company_name)
$name_export_orders = ucfirst($company_name);
else
$name_export_orders = ucfirst($last_name) . ', ' . ucfirst($first_name);
break;
default:
break;
}
return $name_export_orders;
}
/**
* Retrieves the QUICKBOOKS category equivalence for a given model id
* @param String $model_name
* @return String $quickbooks_category
*/
function tep_get_quickbooks_category($model_name){
$query = tep_db_query("select quickbooks_categories from " . TABLE_QUICKBOOKS_TO_OSCOMMERCE_CATEGORIES . " where
model_id ='" . $model_name . "'");
$categories = tep_db_fetch_array($query);
if ($categories['quickbooks_categories']) {
return $categories['quickbooks_categories'];
}
else {
return $model_name;
}
}
/**
* Prepares a folder for upload
* @param String folder path and name
* @return void
*/
function prepare_folder_for_upload($folder_name){
//if not exists, create it
if (!is_dir($folder_name))
mkdir($folder_name);
//if not writable, make it writable
if (!is_writable){
chmod($folder_name, '0777');
}
}
?>
File: admin/includes/languages/english.php
Find:
define('BOX_CATALOG_SPECIALS', 'Specials');
define('BOX_CATALOG_PRODUCTS_EXPECTED', 'Products Expected');
Replace with:
define('BOX_CATALOG_SPECIALS', 'Specials');
define('BOX_CATALOG_PRODUCTS_EXPECTED', 'Products Expected');
//categories box text in includes/boxes/quickbooks.php
define('BOX_HEADING_QUICKBOOKS', 'QuickBooks');
define('BOX_QUICKBOOKS_PREREQUISITES', 'Prerequisites');
define('BOX_QUICKBOOKS_UPDATE_PRODUCTS', 'Update Products');
define('BOX_QUICKBOOKS_CUSTOM_FIELDS', 'Custom Fields');
define('BOX_QUICKBOOKS_UPDATE_LOG', 'Update Log');
define('BOX_QUICKBOOKS_EXPORT_ORDERS', 'Export Orders');
define('BOX_QUICKBOOKS_CONFIGURATION', 'Configuration');
Find:
define('IMAGE_UPDATE_CURRENCIES', 'Update Exchange Rate');
define('IMAGE_UPLOAD', 'Upload');
Replace with:
define('IMAGE_UPDATE_CURRENCIES', 'Update Exchange Rate');
define('IMAGE_UPLOAD', 'Upload');
define('IMAGE_ARCHIVE', 'Archive');
define('IMAGE_EXPORT', 'Export');
Find:
define('TEXT_DISPLAY_NUMBER_OF_TAX_ZONES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> tax zones)');
define('TEXT_DISPLAY_NUMBER_OF_TAX_RATES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> tax rates)');
define('TEXT_DISPLAY_NUMBER_OF_ZONES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> zones)');
Replace with:
define('TEXT_DISPLAY_NUMBER_OF_TAX_ZONES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> tax zones)');
define('TEXT_DISPLAY_NUMBER_OF_TAX_RATES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> tax rates)');
define('TEXT_DISPLAY_NUMBER_OF_ZONES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> zones)');
define('TEXT_DISPLAY_NUMBER_OF_IMPORT_SESSIONS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> import sessions)');
define('TEXT_DISPLAY_NUMBER_OF_IMPORT_PRODUCTS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> import products)');
File: admin/includes/languages/espanol.php
Find:
define('BOX_CATALOG_SPECIALS', 'Ofertas');
define('BOX_CATALOG_PRODUCTS_EXPECTED', 'Próximamente');
Replace with:
define('BOX_CATALOG_SPECIALS', 'Ofertas');
define('BOX_CATALOG_PRODUCTS_EXPECTED', 'Próximamente');
//categories box text in includes/boxes/quickbooks.php
define ('BOX_HEADING_QUICKBOOKS', 'QuickBooks');
define('BOX_QUICKBOOKS_PREREQUISITES', 'Prerequisites');
define ('BOX_QUICKBOOKS_UPDATE_PRODUCTS', 'Productos De la Actualizacion');
define('BOX_QUICKBOOKS_CUSTOM_FIELDS', 'Campos De encargo');
define ('BOX_QUICKBOOKS_UPDATE_LOG', 'Actualizacion Log');
define ('BOX_QUICKBOOKS_EXPORT_ORDERS', 'Ordenes De la Exportacion');
define ('BOX_QUICKBOOKS_CONFIGURATION', 'Configuraciguracion');
Find:
define('IMAGE_UPDATE_CURRENCIES', 'Actualizar Cambio de Moneda');
define('IMAGE_UPLOAD', 'Subir');
Replace with:
define('IMAGE_UPDATE_CURRENCIES', 'Actualizar Cambio de Moneda');
define('IMAGE_UPLOAD', 'Subir');
define('IMAGE_ARCHIVE', 'Archive');
define('IMAGE_EXPORT', 'Export');
Find:
define('TEXT_DISPLAY_NUMBER_OF_TAX_CLASSES', 'Viendo del <b>%d</b> al <b>%d</b> (de <b>%d</b> tipos de impuesto)');
define('TEXT_DISPLAY_NUMBER_OF_ZONES', 'Viendo del <b>%d</b> al <b>%d</b> (de <b>%d</b> zonas)');
Replace with:
define('TEXT_DISPLAY_NUMBER_OF_TAX_CLASSES', 'Viendo del <b>%d</b> al <b>%d</b> (de <b>%d</b> tipos de impuesto)');
define('TEXT_DISPLAY_NUMBER_OF_ZONES', 'Viendo del <b>%d</b> al <b>%d</b> (de <b>%d</b> zonas)');
define('TEXT_DISPLAY_NUMBER_OF_IMPORT_SESSIONS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> import sessions)');
define('TEXT_DISPLAY_NUMBER_OF_IMPORT_PRODUCTS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> import products)');
File: admin/includes/languages/german.php
Find:
define('BOX_CATALOG_SPECIALS', 'Sonderangebote');
define('BOX_CATALOG_PRODUCTS_EXPECTED', 'erwartete Artikel');
Replace with:
define('BOX_CATALOG_SPECIALS', 'Sonderangebote');
define('BOX_CATALOG_PRODUCTS_EXPECTED', 'erwartete Artikel');
//categories box text in includes/boxes/quickbooks.php
define('BOX_HEADING_QUICKBOOKS', 'QuickBooks');
define('BOX_QUICKBOOKS_PREREQUISITES', 'Prerequisites');
define('BOX_QUICKBOOKS_UPDATE_PRODUCTS', 'Update Products');
define('BOX_QUICKBOOKS_CUSTOM_FIELDS', 'Custom Fields');
define('BOX_QUICKBOOKS_UPDATE_LOG', 'Update Log');
define('BOX_QUICKBOOKS_EXPORT_ORDERS', 'Export Orders');
define('BOX_QUICKBOOKS_CONFIGURATION', 'Configuration');
Find:
define('IMAGE_UPDATE_CURRENCIES', 'Wechselkurse aktualisieren');
define('IMAGE_UPLOAD', 'Hochladen');
Replace with:
define('IMAGE_UPDATE_CURRENCIES', 'Wechselkurse aktualisieren');
define('IMAGE_UPLOAD', 'Hochladen');
define('IMAGE_ARCHIVE', 'Archive');
define('IMAGE_EXPORT', 'Export');
Find:
define('TEXT_DISPLAY_NUMBER_OF_TAX_RATES', 'Angezeigt werden <b>%d</b> bis <b>%d</b> (von insgesamt <b>%d</b> Steuersätzen)');
define('TEXT_DISPLAY_NUMBER_OF_ZONES', 'Angezeigt werden <b>%d</b> bis <b>%d</b> (von insgesamt <b>%d</b> Bundesländern)');
Replace with:
define('TEXT_DISPLAY_NUMBER_OF_TAX_RATES', 'Angezeigt werden <b>%d</b> bis <b>%d</b> (von insgesamt <b>%d</b> Steuersätzen)');
define('TEXT_DISPLAY_NUMBER_OF_ZONES', 'Angezeigt werden <b>%d</b> bis <b>%d</b> (von insgesamt <b>%d</b> Bundesländern)');
define('TEXT_DISPLAY_NUMBER_OF_IMPORT_SESSIONS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> import sessions)');
define('TEXT_DISPLAY_NUMBER_OF_IMPORT_PRODUCTS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> import products)');
File: admin/includes/stylesheet.css
At the end of the file add this:
.okText { font-family: Verdana, Arial, sans-serif; font-size: 10px; color: #14a005; }
.visibilityOff {visibility:hidden;}
.visibilityOn {visibility:visible;}
Hope this helps others.... Halfhidden