Jump to content
Sign in to follow this  
bmcewan

Purchase Without Account Updated & Admin Functionality

Recommended Posts

I can't find any helpful information about this particular topic. My client wants the purchase without account module but uses authorize.net. I've combined the two checkout_process.php files but authorize.net won't work if the purchase without account doesand vice versa. Can someone please help?

 

Here's the code for the file

<?php

/*

This file has been modified with updates for the new MS1 database structure

See comments marked MS1 modification on lines 100 and 116

Modified: April 25th, 2003

 

osCommerce 2.2 (Snapshot on November 10, 2002) Open Source E-Commerce Solutions

Authorizenet ADC Direct Connection

Updated: November 10, 2002

Author: Bao Nguyen

Email: baonguyenx@yahoo.com

 

Updated for: Authorize.net Consolidated v1.5

Date: March 24, 2004

Changes: Rewrote many of the customer info fields, also the order id is now inserted

into the database before it goes to processing so Authorize.net Consolidated

has an order ID to send to Authorize.net. However this means that failed orders

will also have an order ID.

Author: Austin Renfroe (Austin519)

Email: Austin519@aol.com

*/

 

include('includes/application_top.php');

 

// if the customer is not logged on, redirect them to the login page

if (!tep_session_is_registered('customer_id')) {

$navigation->set_snapshot(array('mode' => 'SSL', 'page' => FILENAME_CHECKOUT_PAYMENT));

tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));

}

 

if (!tep_session_is_registered('sendto')) {

tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));

}

 

if ( (tep_not_null(MODULE_PAYMENT_INSTALLED)) && (!tep_session_is_registered('payment')) ) {

tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));

}

 

// avoid hack attempts during the checkout procedure by checking the internal cartID

if (isset($cart->cartID) && tep_session_is_registered('cartID')) {

if ($cart->cartID != $cartID) {

tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));

}

}

 

include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_PROCESS);

 

// load selected payment module

require(DIR_WS_CLASSES . 'payment.php');

$payment_modules = new payment($payment);

//load selected shipping module

require(DIR_WS_CLASSES . 'shipping.php');

$shipping_modules=new shipping($shipping);

// Need to be included before Authorizenet ADC Direct Connection

require(DIR_WS_CLASSES . 'order.php');

$order = new order;

 

 

//************************************************************

// Authorizenet ADC Direct Connection

//************************************************************

$payment_modules->before_process();

require(DIR_WS_CLASSES . 'order_total.php');

$order_total_modules = new order_total;

 

$order_totals = $order_total_modules->process();

 

$sql_data_array = array('customers_id' => $customer_id,

'customers_name' => $order->customer['firstname'] . ' ' . $order->customer['lastname'],

'customers_company' => $order->customer['company'],

'customers_street_address' => $order->customer['street_address'],

'customers_suburb' => $order->customer['suburb'],

'customers_city' => $order->customer['city'],

'customers_postcode' => $order->customer['postcode'],

'customers_state' => $order->customer['state'],

'customers_country' => $order->customer['country']['title'],

'customers_telephone' => $order->customer['telephone'],

'customers_email_address' => $order->customer['email_address'],

'customers_address_format_id' => $order->customer['format_id'],

'delivery_name' => $order->delivery['firstname'] . ' ' . $order->delivery['lastname'],

'delivery_company' => $order->delivery['company'],

'delivery_street_address' => $order->delivery['street_address'],

'delivery_suburb' => $order->delivery['suburb'],

'delivery_city' => $order->delivery['city'],

'delivery_postcode' => $order->delivery['postcode'],

'delivery_state' => $order->delivery['state'],

'delivery_country' => $order->delivery['country']['title'],

'delivery_address_format_id' => $order->delivery['format_id'],

'billing_name' => $order->billing['firstname'] . ' ' . $order->billing['lastname'],

'billing_company' => $order->billing['company'], 'billing_street_address' => $order->billing['street_address'],

'billing_suburb' => $order->billing['suburb'],

'billing_city' => $order->billing['city'],

'billing_postcode' => $order->billing['postcode'],

'billing_state' => $order->billing['state'],

'billing_country' => $order->billing['country']['title'],

'billing_address_format_id' => $order->billing['format_id'],

'payment_method' => $order->info['payment_method'],

'cc_type' => $order->info['cc_type'],

'cc_owner' => $order->info['cc_owner'],

'cc_number' => $order->info['cc_number'],

'cc_expires' => $order->info['cc_expires'],

'date_purchased' => 'now()',

'orders_status' => $order->info['order_status'],

// the following field has been moved from orders to order_status_history

// 'comments' => $order->info['comments'],

'currency' => $order->info['currency'],

'currency_value' => $order->info['currency_value']);

tep_db_perform(TABLE_ORDERS, $sql_data_array);

$insert_id = tep_db_insert_id();

 

// Make sure the /catalog/includes/class/order.php is included

// and $order object is created before this!!!

if(MODULE_PAYMENT_AUTHORIZENET_STATUS) {

include(DIR_WS_MODULES . 'authorizenet_direct.php');

}

 

//************************************************************

 

// load the before_process function from the payment modules

$payment_modules->before_process();

for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) {

$sql_data_array = array('orders_id' => $insert_id,

'title' => $order_totals[$i]['title'],

'text' => $order_totals[$i]['text'],

'value' => $order_totals[$i]['value'],

'class' => $order_totals[$i]['code'],

'sort_order' => $order_totals[$i]['sort_order']);

tep_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array);

}

 

//the following lines were changed for the MS1 and snapshots after 2003-02-17 db structure

$customer_notification = (SEND_EMAILS == 'true') ? '1' : '0';

$sql_data_array = array('orders_id' => $insert_id,

'orders_status_id' => $order->info['order_status'],

'date_added' => 'now()',

'customer_notified' => $customer_notification,

'comments' => $order->info['comments']);

tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);

//end update to MS1

 

// initialized for the email confirmation

$products_ordered = '';

$subtotal = 0;

$total_tax = 0;

 

for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {

// Stock Update - Joao Correia

if (STOCK_LIMITED == 'true') {

if (DOWNLOAD_ENABLED == 'true') {

$stock_query_raw = "SELECT products_quantity, pad.products_attributes_filename

FROM " . TABLE_PRODUCTS . " p

LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES . " pa

ON p.products_id=pa.products_id

LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad

ON pa.products_attributes_id=pad.products_attributes_id

WHERE p.products_id = '" . tep_get_prid($order->products[$i]['id']) . "'";

// Will work with only one option for downloadable products

// otherwise, we have to build the query dynamically with a loop

$products_attributes = $order->products[$i]['attributes'];

if (is_array($products_attributes)) {

$stock_query_raw .= " AND pa.options_id = '" . $products_attributes[0]['option_id'] . "' AND pa.options_values_id = '" . $products_attributes[0]['value_id'] . "'";

}

$stock_query = tep_db_query($stock_query_raw);

} else {

$stock_query = tep_db_query("select products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");

}

if (tep_db_num_rows($stock_query)> 0) {

$stock_values = tep_db_fetch_array($stock_query);

// do not decrement quantities if products_attributes_filename exists

if ((DOWNLOAD_ENABLED != 'true') || (!$stock_values['products_attributes_filename'])) {

$stock_left = $stock_values['products_quantity'] - $order->products[$i]['qty'];

} else {

$stock_left = $stock_values['products_quantity'];

}

tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = '" . $stock_left . "' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");

if (($stock_left < 1) && (STOCK_ALLOW_CHECKOUT=='false')){

tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");

}

}

}

 

// Update products_ordered (for bestsellers list)

tep_db_query("update " . TABLE_PRODUCTS . " set products_ordered = products_ordered + " . sprintf('%d', $order->products[$i]['qty']) . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");

 

$sql_data_array = array('orders_id' => $insert_id,

'products_id' => tep_get_prid($order->products[$i]['id']),

'products_model' => $order->products[$i]['model'],

'products_name' => $order->products[$i]['name'],

'products_price' => $order->products[$i]['price'],

'final_price' => $order->products[$i]['final_price'],

'products_tax' => $order->products[$i]['tax'],

'products_quantity' => $order->products[$i]['qty']);

tep_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array);

$order_products_id = tep_db_insert_id();

 

//------insert customer choosen option to order--------

$attributes_exist = '0';

$products_ordered_attributes = '';

if (isset($order->products[$i]['attributes'])) {

$attributes_exist = '1';

for ($j=0, $n2<sizeof($order->products[$i]['attributes']); $j,$n2; $j++) {

if (DOWNLOAD_ENABLED == 'true') {

$attributes_query = "select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pad.products_attributes_maxdays, pad.products_attributes_maxcount , pad.products_attributes_filename

from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa

left join " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad

on pa.products_attributes_id=pad.products_attributes_id

where pa.products_id = '" . $order->products[$i]['id'] . "'

and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "'

and pa.options_id = popt.products_options_id

and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "'

and pa.options_values_id = poval.products_options_values_id

and popt.language_id = '" . $languages_id . "'

and poval.language_id = '" . $languages_id . "'";

$attributes = tep_db_query($attributes_query);

} else {

$attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . $order->products[$i]['id'] . "' and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . $languages_id . "' and poval.language_id = '" . $languages_id . "'");

}

$attributes_values = tep_db_fetch_array($attributes);

 

$sql_data_array = array('orders_id' => $insert_id,

'orders_products_id' => $order_products_id,

'products_options' => $attributes_values['products_options_name'],

'products_options_values' => $attributes_values['products_options_values_name'],

'options_values_price' => $attributes_values['options_values_price'],

'price_prefix' => $attributes_values['price_prefix']);

tep_db_perform(TABLE_ORDERS_PRODUCTS_ATTRIBUTES, $sql_data_array);

 

if ((DOWNLOAD_ENABLED == 'true') &&isset($attributes_values['products_attributes_filename']) && tep_not_null($attributes_values['products_attributes_filename'])) {

$sql_data_array = array('orders_id' => $insert_id,

'orders_products_id' => $order_products_id,

'orders_products_filename' => $attributes_values['products_attributes_filename'],

'download_maxdays' => $attributes_values['products_attributes_maxdays'],

'download_count' => $attributes_values['products_attributes_maxcount']);

tep_db_perform(TABLE_ORDERS_PRODUCTS_DOWNLOAD, $sql_data_array);

}

$products_ordered_attributes .= "\n\t" . $attributes_values['products_options_name'] . ' ' . $attributes_values['products_options_values_name'];

}

}

//------insert customer choosen option eof ----

$total_weight += ($order->products[$i]['qty'] * $order->products[$i]['weight']);

$total_tax += tep_calculate_tax($total_products_price, $products_tax) * $order->products[$i]['qty'];

$total_cost += $total_products_price;

 

$products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n";

}

 

// lets start with the email confirmation

//DDB- 041103 - Add test for PWA : no display of invoice URL if PWA customer

if (!tep_session_is_registered('noaccount'))

{

$email_order = STORE_NAME . "\n" .

EMAIL_SEPARATOR . "\n" .

EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . "\n" .

EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $insert_id, 'SSL', false) . "\n" .

EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n";

if ($order->info['comments'])

{

$email_order .= tep_db_output($order->info['comments']) . "\n\n";

}

$email_order .= EMAIL_TEXT_PRODUCTS . "\n" .

EMAIL_SEPARATOR . "\n" .

$products_ordered .

EMAIL_SEPARATOR . "\n";

} else {

$email_order = STORE_NAME . "\n" .

EMAIL_SEPARATOR . "\n" .

EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . "\n" .

EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n";

if ($order->info['comments']) {

$email_order .= tep_db_output($order->info['comments']) . "\n\n";

}

$email_order .= EMAIL_TEXT_PRODUCTS . "\n" .

EMAIL_SEPARATOR . "\n" .

$products_ordered .

EMAIL_SEPARATOR . "\n";

}

for ($i=0, $n<sizeof($order_totals); $i<$n; $i++) {

$email_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n";

}

 

if($order->content_type !='virtual'){

$email_order .= "\n" . EMAIL_TEXT_DELIVERY_ADDRESS . "\n" .

EMAIL_SEPARATOR . "\n" .

tep_address_label($customer_id, $sendto, 0, '', "\n") . "\n";

}

$email_order.="\n". EMAIL_TEXT_BILLING_ADDRESS . "\n" .

EMAIL_SEPARATOR . "\n" .

tep_address_label($customer_id, $billto, 0, '', "\n") . "\n\n";

if (is_object($$payment)) {

$email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" .

EMAIL_SEPARATOR . "\n";

$payment_class = $$payment;

$email_order .= $payment_class->title . "\n\n";

if ($payment_class->email_footer) {

$email_order .= $payment_class->email_footer . "\n\n";

}

}

tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

 

 

// send emails to other people

if (SEND_EXTRA_ORDER_EMAILS_TO != '') {

tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

}

 

// load the after_process function from the payment modules

$payment_modules->after_process();

 

$cart->reset(true);

 

// unregister session variables used during checkout

tep_session_unregister('sendto');

tep_session_unregister('billto');

tep_session_unregister('shipping');

tep_session_unregister('payment');

tep_session_unregister('comments');

 

tep_redirect(tep_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL'));

 

require(DIR_WS_INCLUDES . 'application_bottom.php');

?>

Edited by deedee

Share this post


Link to post
Share on other sites

sorry, entered the post twice and then deleted so ignore this post

Edited by deedee

Share this post


Link to post
Share on other sites

Hi

 

I have installed PWA v0.82 on top of the base OS commerce. I am still in testing mode but the products I purchase through Paypal are not shown in the orders section of admin.I compared the orders.php file provided with PWA with the orders.php shipped by Oscommerce and they are identical ( I used Beyond Compare to check this ).When I have completed my Paypal processing and select the Paypal button to return to website, then I get returned to catalog/order_info.php when I might have expected to be directed to order confirmation page.

 

I am teribly stuck and am unsure what I need to do next . Could anyone please help me

Edited by xjbhx

Share this post


Link to post
Share on other sites
Hi

 

I have installed PWA v0.82 on top of the base OS commerce. I am still in testing mode but the products I purchase through Paypal are not shown in the orders section of admin.I compared the orders.php file provided with PWA with the orders.php shipped by Oscommerce and they are identical ( I used Beyond Compare to check this ).When I have completed my Paypal processing and select the Paypal button to return to website, then I get returned to catalog/order_info.php when I might have expected to be directed to order confirmation page.

 

I am teribly stuck and am unsure what I need to do next . Could anyone please help me

 

For the changes to the admin/orders.php you have to fall back to the install_instructions.txt inside the contrib zip file.

It's a bit confusing but you need to apply those

OPEN AND MAKE CHANGES IN THIS FILE: /admin/orders.php 
change:  (v0.71)Changed the email section in admin/orders.php 
from:

[CODE]
 $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]);           tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT, $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);           $customer_notified = '1';         }

 

to:

// start pwa changes  $pwa_check_query= tep_db_query("select purchased_without_account from " . TABLE_ORDERS . " where orders_id = '" . tep_db_input($oID) . "'");$pwa_check= tep_db_fetch_array($pwa_check_query); if ($pwa_check['purchased_without_account'] != '1'){           $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]); } 
else {   $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]); }           tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT, $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

          $customer_notified = '1';         }

[/code]

 

For the Paypal return to your shop you must give the checkout_success.php as the file to return to (on the Paypal site that is).

PWA does not interfere with your Paypal orders so if something goes wrong there you probably have an issue with the Paypal contrib installed (if you have and if not it is normal behaviour of the standard osC Paypal module to not register the order if the customer does not return correctly to the shop. In that case it is advisable to install one of the available Paypal contribs).

Share this post


Link to post
Share on other sites

thank you for replying so quickly. I did as you suggested but no prggress I am afraid. There are no oders visible in Admin. Is there something else I should try ?

 

I did set paypal web settings to point at sucess confirmation but that does not seem to happen.

 

Pound to a penny its me doing something silly, after all so many people are sucessfully using this really useful feature.

Share this post


Link to post
Share on other sites
thank you for replying so quickly. I did as you suggested but no prggress I am afraid. There are no oders visible in Admin. Is there something else I should try ?

 

I did set paypal web settings to point at sucess confirmation but that does not seem to happen.

 

Pound to a penny its me doing something silly, after all so many people are sucessfully using this really useful feature.

 

So on the Paypal site you have set for your Profile->Website Payment Preferences:

http://www.yourdomain.com/checkout_success.php (or something like http://www.yourdomain.com/catalog/checkout_success.php depending on your osC installation) ?!

 

As for your orders not showing up: do you have a Paypal contrib installed or do your use the stock osC Paypal module ?

 

This is not the correct thread for this but anyhow.

Share this post


Link to post
Share on other sites

Hi,

 

I use the stock OSC Paypal module and in Paypal Web preferences set the redirect to http://www.ciimun.co.uk/catalog/checkout_success.php. Sorry about mentioning this here when the contributions are related to PWA. Somehow I wondered if the paypal redirect and PWA were connected in some way. Before I upgraded to PWA, OSC/Paypal and orders worked fine

 

Is there some different paypal module i should use in OSC ?

 

Am just beginning to wonder if I should revert to what I had before and then re-install PWA.

Edited by xjbhx

Share this post


Link to post
Share on other sites
Hi,

 

I use the stock OSC Paypal module and in Paypal Web preferences set the redirect to http://www.ciimun.co.uk/catalog/checkout_success.php. Sorry about mentioning this here when the contributions are related to PWA. Somehow I wondered if the paypal redirect and PWA were connected in some way. Before I upgraded to PWA, OSC/Paypal and orders worked fine

 

Is there some different paypal module i should use in OSC ?

 

Am just beginning to wonder if I should revert to what I had before and then re-install PWA.

 

In principle PWA should not affect your Paypal handling if installed correctly but if everything worked fine without PWA and not anymore with PWA there must be a conflict. I have both PWA 0.82 and the osC Paypal IPN integrated in my shop and as far as I can say they work nicely together (but mostly based on sandbox testing I have to add as I get rarely Paypal payment through the shop).

Have you tried a PWA test order with some other payment method (bank wire, pickup or anything else as Paypal) ?

The stock osC Paypal module works fine as long as your customer gets returned to the shop correctly and the order should be registered than. When something goes wrong however no order is registered and therefore ie. the osC team has developed a new Paypal module which already registers the order before going to the Paypal site. That might be confusing if a customer deliberately broke of the payment but otherwise you will have at least a knowledge of what has been ordered if the payment went through but the return to the shop went wrong.

If it is not too much hassle you might get rid of PWA first and decide if you think you will need a Paypal contrib and install and test that first before doing PWA again. Or just go through the PWA install again and double/triple check you didn't miss anything and/or put it on the wrong place(s).

Share this post


Link to post
Share on other sites

I have a problem with this application.

If I make an order to test the PWA in the shop (using cheque payment) , the order shows up in orders - when a customer makes an order using PWA, I get the payment but no order shows up so I have to email the customer and ask them what they ordered!

Anyone know what I've done wrong/how to fix it?

 

Thanks :(

Share this post


Link to post
Share on other sites

I installed PWA 0.82 and got no errors, and in admin under configuration/accounts PWA is set to True. However in the catalogue nothing is showing up and the standard osCommerce account login/create is still active there is no box showing the 3 options mentioned in the contribution. I have reread and checked the install and everything seems to be in place but nothing is showing up. If anyone has any ideas on this it would be greatly appreciated.


Your help and suggestions are greatly appreciated.

Thanks

Wayne

Share this post


Link to post
Share on other sites
I installed PWA 0.82 and got no errors, and in admin under configuration/accounts PWA is set to True.  However in the catalogue nothing is showing up and the standard osCommerce account login/create is still active there is no box showing the 3 options mentioned in the contribution.  I have reread and checked the install and everything seems to be in place but nothing is showing up.  If anyone has any ideas  on this it would be greatly appreciated.

 

Assuming you have catalog/includes/login_pwa.php and catalog/includes/login_acc.php in place and changed everyting accordingly you should see the three login options when you have at least one item in the cart and choose checkout. If you take the normal customer login option PWA will not show which seems logical.

 

HTH

Share this post


Link to post
Share on other sites
Assuming you have catalog/includes/login_pwa.php and catalog/includes/login_acc.php in place and changed everyting accordingly you should see the three login options when you have at least one item in the cart and choose checkout. If you take the normal customer login option PWA will not show which seems logical.

 

HTH

 

 

I have triple checked and everything seems to match, have checked install txt against mods. Here is exactly what i did of course I removed the CODE tags when I was installing the info. Does position in file for the non-replacement pieces of code make a difference? I put items in my cart, click checkout and it goes to the default osCommerce login page. If you want I will copy and paste each section I did from each file?

 

The following (7) files do not exist in OSC so you can upload them directly to the correct folders:

 

/catalog/Order_Info.php

/catalog/Order_Info_Process.php

/catalog/includes/login_pwa.php  (has the boxes stacked vertically, if you want side-by-side boxes rename this file to something else and use the login_pwa_optional.php as explained below)

/catalog/includes/login_pwa_optional.php  (this is for side-by-side boxes, if you want them this way rename this file to login_pwa.php and upload it instead of the above file)

/catalog/includes/login_acc.php

/catalog/includes/modules/Order_Info_Check.php

/catalog/includes/languages/english/images/buttons/button_create_account.gif

 

Old Files no longer used with this contribution:

****0.70 DELETED :      /catalog/includes/modules/Order_Info_Process.php

 

STEP 3:Go into your server's backend and use a SQL tool such as PHPMYADMIN to run the following SQL scripts. Make sure you have backed up your database first:

 

ALTER TABLE customers ADD purchased_without_account TINYINT(1) UNSIGNED DEFAULT '0' NOT NULL AFTER customers_id;

ALTER TABLE customers ADD INDEX (purchased_without_account);

INSERT INTO configuration_group VALUES (40, 'Accounts', 'Configuration of Account settings', 40, 1);

INSERT INTO configuration VALUES ('', 'Purchase Without Account', 'PWA_ON','true','Allow Customers to purchase without an account', 40, 1, '2003-04-08 13:07:44', '2003-04-08 12:10:51', NULL, 'tep_cfg_select_option(array(\'true\', \'false\'),');

ALTER TABLE orders ADD purchased_without_account TINYINT (1) UNSIGNED DEFAULT '0' NOT NULL;

 

STEP 4:You still need to open some files and add some lines also, follow the instructions below and you should be ready in no time.

 

****************************************************************

OPEN AND MAKE CHANGES IN THIS FILE:  /catalog/includes/filenames.php

 

//Begin Checkout Without Account Modifications

  define('FILENAME_PWA_PWA_LOGIN', 'login_pwa.php');

  define('FILENAME_PWA_ACC_LOGIN', 'login_acc.php');

  define('FILENAME_CHECKOUT', 'Order_Info.php');

  define('FILENAME_ORDER_INFO', 'Order_Info.php');

  define('FILENAME_ORDER_INFO_PROCESS', 'Order_Info_Process.php');

 

***************************************************************

 

OPEN AND MAKE CHANGES IN THIS FILE: /catalog/includes/languages/english.php

 

// Begin Checkout Without Account Modifications

define('IMAGE_BUTTON_CREATE_ACCOUNT', 'Create Account');

define('NAV_ORDER_INFO', 'Order Info');

 

******************************************************************

 

OPEN AND MAKE CHANGES IN THIS FILE: /catalog/includes/languages/english/login.php

 

// Begin Checkout Without Account v0.70 changes

 

define('PWA_FAIL_ACCOUNT_EXISTS', 'An account already exists for the email address <i>{EMAIL_ADDRESS}</i>.  You must login here with the password for that account before proceeding to checkout.');

// Begin Checkout Without Account v0.60 changes

define('HEADING_CHECKOUT', '<font size="2">Proceed Directly to Checkout</font>');

define('TEXT_CHECKOUT_INTRODUCTION', 'Proceed to Checkout without creating an account. By choosing this option none of your user information will be kept in our records, and you will not be able to review your order status, nor keep track of your previous orders.');

define('PROCEED_TO_CHECKOUT', 'Proceed to Checkout without Registering');

 

******************************************************************

 

OPEN AND MAKE CHANGES IN THIS FILE: /catalog/create_account.php

change:

(v0.71) CODE

if ($check_email['total'] > 0) {

$error = true;

$messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_ERROR_EXISTS);

}

 

[/code]

 

to this:

 

 if ($check_email['total'] > 0)
 {  //PWA delete account
     $get_customer_info = tep_db_query("select customers_id, customers_email_address, purchased_without_account from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'");
   $customer_info = tep_db_fetch_array($get_customer_info);
   $customer_id = $customer_info['customers_id'];
   $customer_email_address = $customer_info['customers_email_address'];
   $customer_pwa = $customer_info['purchased_without_account'];
   if ($customer_pwa !='1')
   {
       $error = true;
       $messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_ERROR_EXISTS);
   } else {
     tep_db_query("delete from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . $customer_id . "'");
     tep_db_query("delete from " . TABLE_CUSTOMERS . " where customers_id = '" . $customer_id . "'");
     tep_db_query("delete from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . $customer_id . "'");
     tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . $customer_id . "'");
     tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . $customer_id . "'");
     tep_db_query("delete from " . TABLE_WHOS_ONLINE . " where customer_id = '" . $customer_id . "'");
   }
     }
 // END

 

If the email address they are trying to register exists they will get the

normal error if it's a normal account.

If it's a PWA account the account will be deleted and the create account process will proceed as if it never existed.

 

******************************************************************

OPEN AND MAKE CHANGES IN THIS FILE: /admin/orders.php

change:  (v0.71)Changed the email section in admin/orders.php

from:

 

  $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]);           tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT, $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);           $customer_notified = '1';         }

 

to:

// start pwa changes  $pwa_check_query= tep_db_query("select purchased_without_account from " . TABLE_ORDERS . " where orders_id = '" . tep_db_input($oID) . "'");$pwa_check= tep_db_fetch_array($pwa_check_query); if ($pwa_check['purchased_without_account'] != '1'){           $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]); }
else {   $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]); }           tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT, $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

          $customer_notified = '1';         }

 

******************************************************************


Your help and suggestions are greatly appreciated.

Thanks

Wayne

Share this post


Link to post
Share on other sites
I have triple checked and everything seems to match, have checked install txt against mods.  Here is exactly what i did of course I removed the CODE tags when I was installing the info.  Does position in file for the non-replacement pieces of code make a difference?  I put items in my cart, click checkout and it goes to the default osCommerce login page.  If you want I will copy and paste each section I did from each file?

 

 

I think you need something like this in the top of checkout_shipping :

 

// if there is nothing in the customers cart, redirect them to the shopping cart page

if ($cart->count_contents() < 1) {

tep_redirect(tep_href_link(FILENAME_SHOPPING_CART), 'NONSSL'); // to the empty shopping cart

}

 

// if the customer is not logged on, redirect them to the login page

if (!tep_session_is_registered('customer_id')) {

$navigation->set_snapshot();

if (PWA_ON == 'true') {

tep_redirect(tep_href_link(FILENAME_CHECKOUT, '', 'SSL')); // to PWA order information

} else {

tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); // to login page

}

}

 

 

where FILENAME_CHECKOUT reflects order_info.php


Treasurer MFC

Share this post


Link to post
Share on other sites
I have triple checked and everything seems to match, have checked install txt against mods.  Here is exactly what i did of course I removed the CODE tags when I was installing the info.  Does position in file for the non-replacement pieces of code make a difference?  I put items in my cart, click checkout and it goes to the default osCommerce login page.  If you want I will copy and paste each section I did from each file?

 

Is this

<?php
if (PWA_ON == 'false') {
require(DIR_WS_INCLUDES . FILENAME_PWA_ACC_LOGIN);
} else {
require(DIR_WS_INCLUDES . FILENAME_PWA_PWA_LOGIN);
}
?>

in your catalog/login.php somewhere near the bottom ?

It must be something like this otherwise it gets hard to explain !

Share this post


Link to post
Share on other sites
I think you need something like this in the top of checkout_shipping :

 

// if there is nothing in the customers cart, redirect them to the shopping cart page

  if ($cart->count_contents() < 1) {

    tep_redirect(tep_href_link(FILENAME_SHOPPING_CART), 'NONSSL'); // to the empty shopping cart

  }

 

// if the customer is not logged on, redirect them to the login page

  if (!tep_session_is_registered('customer_id')) {

    $navigation->set_snapshot();

    if (PWA_ON == 'true') {

      tep_redirect(tep_href_link(FILENAME_CHECKOUT, '', 'SSL'));  // to PWA order information

    } else {

        tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));  // to login page

    }

  }

where FILENAME_CHECKOUT reflects order_info.php

 

 

I have the same propblem as FHceramics, all installed and still going to create account. I put this code in, and the code worked. But that is not what this contrib is supposed to do. I do not have the options to create an acount or not.

2dogrc

Share this post


Link to post
Share on other sites
Is this

<?php
if (PWA_ON == 'false') {
require(DIR_WS_INCLUDES . FILENAME_PWA_ACC_LOGIN);
} else {
require(DIR_WS_INCLUDES . FILENAME_PWA_PWA_LOGIN);
}
?>

in your catalog/login.php somewhere near the bottom ?

It must be something like this otherwise it gets hard to explain !

 

ok, thanks, I adjusted the position of the login codeand now have the 3 boxes and they seem to be working, but must have missed something as the osCommerce standard 2 boxes are right below them. Any suggestions where I might look?


Your help and suggestions are greatly appreciated.

Thanks

Wayne

Share this post


Link to post
Share on other sites
ok, thanks, I adjusted the position of the login codeand now have the 3 boxes and they seem to be working,  but must have missed something as the osCommerce standard 2 boxes are right below them. Any suggestions where I might look?

 

Wayne,

 

I am not sure what you mean ? You have the correct login screen now and moved the PWA login code to the top in login_pwa.php which doesn't workout as you expected ?!

It is standard with PWA that you see 3 login options, the 2 normal ones and the extra PWA login.

Share this post


Link to post
Share on other sites
Wayne,

 

I am not sure what you mean ? You have the correct login screen now and moved the PWA login code to the top in login_pwa.php which doesn't workout as you expected ?!

It is standard with PWA that you see 3 login options, the 2 normal ones and the extra PWA login.

 

What I have is the 3 pwa login boxes, the non account, create account and login account which is what I'm supposed to have but right below these 3, are the oscommerce create and login boxes as well, I have 5 boxes on my page. Here is how the boxes are laid out; I know these are not the right names but you can see what I mean.

1 non account

2 create account

3login to account

4 create account 5 login to account

 

so I obviously misplaced a piece of code or missed removing a piece, so if some has a suggestion I would appreciate it.


Your help and suggestions are greatly appreciated.

Thanks

Wayne

Share this post


Link to post
Share on other sites
What I have is the 3 pwa login boxes, the non account, create account and login account which is what I'm supposed to have but right below these 3, are the oscommerce create and login boxes as well, I have 5 boxes on my page.  Here is how the boxes are laid out;  I know these are not the right names but you can see what I mean.

                                  1 non account

                                  2 create account

                                  3login to account

                    4 create account  5  login to account

 

so I obviously misplaced a piece of code or missed removing a piece, so if some has a suggestion I would appreciate it.

 

Hard to tell this way I am afraid, those last two definitely shouldn't be there. Somewhere in your login.php there still must be an error/misplaced part of code.

Did you implement the PWA coding for the login.php by hand or just copied the provided file with the contibution ?

In the last case the fault must be somewhere else and/or due to some other changes you maybe did ?!

Share this post


Link to post
Share on other sites

I'm having a problem that for the life of me... I can't understand. I installed PWA .82 and once i did when I try to "proceed to check" or "login" i get the following error:

 

Fatal error: Cannot redeclare tep_db_connect() (previously declared in /home/musieng2/public_html/store/includes/functions/database.php:13) in /home/musieng2/public_html/store/includes/functions/database.php on line 13

 

So i thought I might have done something wrong in the installation so I used Text Wrangler to compare a new PWA download to what was uploaded and everything was perfect....

 

does anyone know why I'm getting this error?

 

You can see an example of it here:

http://www.musica360.com/store


My Contribution

Music Download Store Template

http://www.oscommerce.com/community/contributions,4275

Share this post


Link to post
Share on other sites

Hello all,

 

I have the shipping status contribution and my orders.php is a little modified. How can i integrate these to contribtuions. I am getting stuck at this part:

 

OPEN AND MAKE CHANGES IN THIS FILE: /admin/orders.php

change: (v0.71)Changed the email section in admin/orders.php

from:

 

  $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]);           tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT, $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);           $customer_notified = '1';         }

 

to:

// start pwa changes  $pwa_check_query= tep_db_query("select purchased_without_account from " . TABLE_ORDERS . " where orders_id = '" . tep_db_input($oID) . "'");$pwa_check= tep_db_fetch_array($pwa_check_query); if ($pwa_check['purchased_without_account'] != '1'){           $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]); } 
else {   $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]); }           tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT, $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

          $customer_notified = '1';         }

 

Here is my orders.php:

 

<?php

/*

$Id: orders.php,v 1.112 2003/06/29 22:50:52 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions

 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License

*/

 require('includes/application_top.php');

 

 require(DIR_WS_CLASSES . 'currencies.php');

 

 $currencies = new currencies();

 

 

 

 $orders_statuses = array();

 

 $orders_status_array = array();

 

 $orders_status_query = tep_db_query("select orders_status_id, orders_status_name from " . TABLE_ORDERS_STATUS . " where language_id = '" . (int)$languages_id . "'");

 

 while ($orders_status = tep_db_fetch_array($orders_status_query)) {

 

   $orders_statuses[] = array('id' => $orders_status['orders_status_id'],

 

                              'text' => $orders_status['orders_status_name']);

 

   $orders_status_array[$orders_status['orders_status_id']] = $orders_status['orders_status_name'];

 

 }

 

 

 

 $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');

 

 

 

 if (tep_not_null($action)) {

 

   switch ($action) {

 

     case 'update_order':

 

       $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);

 

       $status = tep_db_prepare_input($HTTP_POST_VARS['status']);

 

       $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']);

 

               $confirmation_no = tep_db_prepare_input($HTTP_POST_VARS['confirmation_no']);

 

               $ship_date= tep_db_prepare_input($HTTP_POST_VARS['ship_date']);

 

               $delivery_date = tep_db_prepare_input($HTTP_POST_VARS['delivery_date']);

 

 

 

       $order_updated = false;

 

               $check_status_query = tep_db_query("select customers_name, customers_email_address, orders_status, date_purchased, ship_date, confirmation_no, delivery_date from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");

 

       $check_status = tep_db_fetch_array($check_status_query);

 

 

 

               $display_ship_date = $check_status['ship_date'];

 

               $display_confirmation_no = $check_status['confirmation_no'];

 

               $display_delivery_date = $check_status['delivery_date'];

 

 

 

               if (tep_not_null($confirmation_no)) {

 

         tep_db_query("update " . TABLE_ORDERS . " set confirmation_no = '" . tep_db_input($confirmation_no) . "', last_modified = now() where orders_id = '" . (int)$oID . "'");

 

           }

 

               if (tep_not_null($ship_date)) {

 

         tep_db_query("update " . TABLE_ORDERS . " set ship_date = '" . tep_db_input($ship_date) . "', last_modified = now() where orders_id = '" . (int)$oID . "'");

 

           }

 

               if (tep_not_null($delivery_date)){

 

                 tep_db_query("update " . TABLE_ORDERS . " set delivery_date = '" . tep_db_input($delivery_date) . "', last_modified = now() where orders_id = '" . (int)$oID . "'");

 

       }

 

       if ( ($check_status['orders_status'] != $status) | tep_not_null($comments)) {

 

         tep_db_query("update " . TABLE_ORDERS . " set orders_status = '" . tep_db_input($status) . "', last_modified = now() where orders_id = '" . (int)$oID . "'");

 

 

 

         $customer_notified = '0';

 

         if (isset($HTTP_POST_VARS['notify']) && ($HTTP_POST_VARS['notify'] == 'on')) {

 

           $notify_comments = '';

 

           if (isset($HTTP_POST_VARS['notify_comments']) && ($HTTP_POST_VARS['notify_comments'] == 'on')) {

 

             $notify_comments = sprintf(EMAIL_TEXT_COMMENTS_UPDATE, $comments) . "\n\n";

 

           }

 

           //if status is "in transit" or "delivered" include delivery confirmation number and ship date in e-mail

 

                       if ($status == '9998'){

 

                       $email = EMAIL_FONT . STORE_NAME . "\n" . EMAIL_THANKYOU . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . EMAIL_TEXT_ORDER_NUMBER2 . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]) . EMAIL_TEXT_STATUS_UPDATE2 . "\n\n" . EMAIL_TEXT_SHIP_DATE . $ship_date . "\n\n" . EMAIL_TEXT_CONFIRMATION_NO . $confirmation_no . EMAIL_TEXT_CONFIRMATION_NO2 . "\n\n" . EMAIL_TEXT_QUESTIONS;

 

 

 

           tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT, $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

 

 

 

           $customer_notified = '1';

 

                       }

 

                       elseif ($status == '3'){

 

                       $email = EMAIL_FONT . STORE_NAME . "\n" . EMAIL_THANKYOU . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . EMAIL_TEXT_ORDER_NUMBER2 . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]) . EMAIL_TEXT_STATUS_UPDATE2 . "\n\n" . EMAIL_TEXT_SHIP_DATE . $display_ship_date . "\n\n" . EMAIL_TEXT_CONFIRMATION_NO . $display_confirmation_no . EMAIL_TEXT_CONFIRMATION_NO2 . "\n\n" . EMAIL_TEXT_DELIVERY_DATE . $delivery_date . "\n\n" . EMAIL_TEXT_QUESTIONS;

 

 

 

           tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT, $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

 

 

 

           $customer_notified = '1';

 

                       }

 

                       //else don't include them

 

           else {

 

                       $email = EMAIL_FONT . STORE_NAME . "\n" . EMAIL_THANKYOU . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . EMAIL_TEXT_ORDER_NUMBER2 . ' ' . $oID . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]) . EMAIL_TEXT_STATUS_UPDATE2;

 

 

 

           tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT, $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

 

 

 

           $customer_notified = '1';

 

                       }

 

         }

 

 

 

         tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified, comments) values ('" . (int)$oID . "', '" . tep_db_input($status) . "', now(), '" . tep_db_input($customer_notified) . "', '" . tep_db_input($comments)  . "')");

 

 

 

         $order_updated = true;

 

       }

 

 

 

       if ($order_updated == true) {

 

        $messageStack->add_session(SUCCESS_ORDER_UPDATED, 'success');

 

       } else {

 

         $messageStack->add_session(WARNING_ORDER_NOT_UPDATED, 'warning');

 

       }

 

 

 

       tep_redirect(tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action')) . 'action=edit'));

 

       break;

 

     case 'deleteconfirm':

 

       $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);

 

 

 

       tep_remove_order($oID, $HTTP_POST_VARS['restock']);

 

 

 

       tep_redirect(tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action'))));

 

       break;

 

   }

 

 }

 

 

 

 if (($action == 'edit') && isset($HTTP_GET_VARS['oID'])) {

 

   $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);

 

 

 

   $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");

 

   $order_exists = true;

 

   if (!tep_db_num_rows($orders_query)) {

 

     $order_exists = false;

 

     $messageStack->add(sprintf(ERROR_ORDER_DOES_NOT_EXIST, $oID), 'error');

 

   }

 

 }

 

 

 

 include(DIR_WS_CLASSES . 'order.php');

 

 require('get_attribute_value_code.php');

?>

 

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

 

<html <?php echo HTML_PARAMS; ?>>

 

<head>

 

<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">

 

<title><?php echo TITLE; ?></title>

 

<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">

 

<script language="javascript" src="includes/general.js"></script>

<script language="javascript"><!--

function popupWindow(url) {

 window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res

izable=yes,copyhistory=no,width=650,height=500,screenX=150,screenY=150,top=150,le

ft=150')

}

//--></script>

</head>

 

<script language="javascript" src="includes/general.js"></script>

 

</head>

 

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">

 

<!-- header //-->

 

<?php

 

 require(DIR_WS_INCLUDES . 'header.php');

 

?>

 

<!-- header_eof //-->

 

 

 

<!-- body //-->

 

<table border="0" width="100%" cellspacing="2" cellpadding="2">

 

 <tr>

 

   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">

 

<!-- left_navigation //-->

 

<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>

 

<!-- left_navigation_eof //-->

 

   </table></td>

 

<!-- body_text //-->

 

   <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">

 

<?php

 

 if (($action == 'edit') && ($order_exists == true)) {

 

   $order = new order($oID);

 

?>

 

     <tr>

 

       <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">

 

         <tr>

 

           <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>

 

           <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?></td>

                  <td class="pageHeading" align="right">

 

                  <?php echo '<a href="' . tep_href_link("edit_orders.php", tep_get_all_get_params(array('action'))) . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a>   '; ?>

 

                  <?php echo '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action'))) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?>

 

                  </td>

 

         </tr>

 

       </table></td>

 

     </tr>

 

     <tr>

 

       <td><table width="100%" border="0" cellspacing="0" cellpadding="2">

 

         <tr>

 

           <td colspan="3"><?php echo tep_draw_separator(); ?></td>

 

         </tr>

 

         <tr>

 

           <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2">

 

             <tr>

 

               <td class="main" valign="top"><b><?php echo ENTRY_CUSTOMER; ?></b></td>

 

               <td class="main"><?php echo tep_address_format($order->customer['format_id'], $order->customer, 1, '', '<br>'); ?></td>

 

             </tr>

 

             <tr>

 

               <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>

 

             </tr>

 

             <tr>

 

               <td class="main"><b><?php echo ENTRY_TELEPHONE_NUMBER; ?></b></td>

 

               <td class="main"><?php echo $order->customer['telephone']; ?></td>

 

             </tr>

 

             <tr>

 

               <td class="main"><b><?php echo ENTRY_EMAIL_ADDRESS; ?></b></td>

 

               <td class="main"><?php echo '<a href="mailto:' . $order->customer['email_address'] . '"><u>' . $order->customer['email_address'] . '</u></a>'; ?></td>

 

             </tr>

 

           </table></td>

 

           <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2">

 

             <tr>

 

               <td class="main" valign="top"><b><?php echo ENTRY_SHIPPING_ADDRESS; ?></b></td>

 

               <td class="main"><?php echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, '', '<br>'); ?></td>

 

             </tr>

 

           </table></td>

 

           <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2">

 

             <tr>

 

               <td class="main" valign="top"><b><?php echo ENTRY_BILLING_ADDRESS; ?></b></td>

 

               <td class="main"><?php echo tep_address_format($order->billing['format_id'], $order->billing, 1, '', '<br>'); ?></td>

 

             </tr>

 

           </table></td>

 

         </tr>

 

       </table></td>

 

     </tr>

 

     <tr>

 

       <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

 

     </tr>

 

     <tr>

 

       <td><table border="0" cellspacing="0" cellpadding="2">

 

         <tr>

 

           <td class="main"><b><?php echo ENTRY_PAYMENT_METHOD; ?></b></td>

 

           <td class="main"><?php echo $order->info['payment_method']; ?></td>

 

         </tr>

 

<tr>

 

           <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

 

         </tr>

 

<?php

 

                 if (tep_not_null($order->shipping['ship_date'])) {

 

?>

 

                 <tr>

 

                   <td class="main"><b><?php echo ENTRY_SHIP_DATE; ?></b></td>

 

                       <td class="main"><?php echo $order->shipping['ship_date']; ?></td>

 

                 </tr>

 

<?php

 

         }

 

                 if (tep_not_null($order->shipping['confirmation_no']))  {

 

?>

 

                 <tr>

 

                   <td class="main"><b><?php echo ENTRY_CONFIRMATION_NO; ?></b></td>

 

                       <td class="main"><?php echo $order->shipping['confirmation_no']; ?></td>

 

                 </tr>

 

 

 

<?php

 

         }

 

                 if (tep_not_null($order->shipping['delivery_date']))  {

 

?>

 

                 <tr>

 

                   <td class="main"><b><?php echo ENTRY_DELIVERY_DATE; ?></b></td>

 

                       <td class="main"><?php echo $order->shipping['delivery_date']; ?></td>

 

                 </tr>

 

<?php

 

         }

 

?>

 

<?php

 

   if (tep_not_null($order->info['cc_type']) || tep_not_null($order->info['cc_owner']) || tep_not_null($order->info['cc_number'])) {

 

?>

 

         <tr>

 

           <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

 

         </tr>

 

         <tr>

 

           <td class="main"><?php echo ENTRY_CREDIT_CARD_TYPE; ?></td>

 

           <td class="main"><?php echo $order->info['cc_type']; ?></td>

 

         </tr>

 

         <tr>

 

           <td class="main"><?php echo ENTRY_CREDIT_CARD_OWNER; ?></td>

 

           <td class="main"><?php echo $order->info['cc_owner']; ?></td>

 

         </tr>

 

         <tr>

 

           <td class="main"><?php echo ENTRY_CREDIT_CARD_NUMBER; ?></td>

 

           <td class="main"><?php echo $order->info['cc_number']; ?></td>

 

         </tr>

 

         <tr>

 

           <td class="main"><?php echo ENTRY_CREDIT_CARD_EXPIRES; ?></td>

 

           <td class="main"><?php echo $order->info['cc_expires']; ?></td>

 

         </tr>

 

<?php

 

   }

 

?>

 

       </table></td>

 

     </tr>

 

     <tr>

 

       <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

 

     </tr>

 

     <tr>

 

       <td><table border="0" width="100%" cellspacing="0" cellpadding="2">

 

         <tr class="dataTableHeadingRow">

 

           <td class="dataTableHeadingContent" colspan="2"><?php echo TABLE_HEADING_PRODUCTS; ?></td>

 

           <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS_MODEL; ?></td>

 

           <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TAX; ?></td>

 

           <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PRICE_EXCLUDING_TAX; ?></td>

 

           <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PRICE_INCLUDING_TAX; ?></td>

 

           <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TOTAL_EXCLUDING_TAX; ?></td>

 

           <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TOTAL_INCLUDING_TAX; ?></td>

 

         </tr>

 

<?php

 

   for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {

    $returns_check_query = tep_db_query("SELECT r.rma_value, rp.products_id FROM " . TABLE_RETURNS . " r, " . TABLE_RETURNS_PRODUCTS_DATA . " rp where r.returns_id = rp.returns_id and r.order_id = '" . $oID . "' and rp.products_id = '" . $order->products[$i]['id'] . "' ");

if (!tep_db_num_rows($returns_check_query)){

$return = ' ';

} else {

$returns = tep_db_fetch_array($returns_check_query);

$return_link = '<a href=' . tep_href_link(FILENAME_RETURNS, 'cID=' . $returns['rma_value']) . '><font color=red><b><i>Returns</b></i></font></a>';

}

 

     echo '          <tr class="dataTableRow">' . "\n" .

 

          '            <td class="dataTableContent" valign="top" align="right">' . $order->products[$i]['qty'] . ' x</td>' . "\n" .

 

          '            <td class="dataTableContent" valign="top">' . $order->products[$i]['name'] . '  ' . $return_link;

 

 

 

     if (isset($order->products[$i]['attributes']) && (sizeof($order->products[$i]['attributes']) > 0)) {

 

       for ($j = 0, $k = sizeof($order->products[$i]['attributes']); $j < $k; $j++) {

 

         echo '<br><nobr><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'];

 

         if ($order->products[$i]['attributes'][$j]['price'] != '0') echo ' (' . $order->products[$i]['attributes'][$j]['prefix'] . $currencies->format($order->products[$i]['attributes'][$j]['price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . ')';

 

         echo '</i></small></nobr>';

 

       }

 

     }

 

 

 

     echo '            </td>' . "\n" .

 

          '            <td class="dataTableContent" valign="top">' . $order->products[$i]['model'] .  get_attribute_value_code($oID, $order->products[$i]['product_id']) . '</td>' . "\n" .

 

          '            <td class="dataTableContent" align="right" valign="top">' . tep_display_tax_value($order->products[$i]['tax']) . '%</td>' . "\n" .

 

          '            <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format($order->products[$i]['final_price'], true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n" .

 

          '            <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']), true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n" .

 

          '            <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format($order->products[$i]['final_price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n" .

 

          '            <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n";

 

     echo '          </tr>' . "\n";

 

   }

 

?>

 

         <tr>

 

           <td align="right" colspan="8"><table border="0" cellspacing="0" cellpadding="2">

 

<?php

 

   for ($i = 0, $n = sizeof($order->totals); $i < $n; $i++) {

 

     echo '              <tr>' . "\n" .

 

          '                <td align="right" class="smallText">' . $order->totals[$i]['title'] . '</td>' . "\n" .

 

          '                <td align="right" class="smallText">' . $order->totals[$i]['text'] . '</td>' . "\n" .

 

          '              </tr>' . "\n";

 

   }

 

?>

 

           </table></td>

 

         </tr>

 

       </table></td>

 

     </tr>

 

     <tr>

 

       <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

 

     </tr>

 

     <tr>

 

       <td class="main"><table border="1" cellspacing="0" cellpadding="5">

 

         <tr>

 

           <td class="smallText" align="center"><b><?php echo TABLE_HEADING_DATE_ADDED; ?></b></td>

 

           <td class="smallText" align="center"><b><?php echo TABLE_HEADING_CUSTOMER_NOTIFIED; ?></b></td>

 

           <td class="smallText" align="center"><b><?php echo TABLE_HEADING_STATUS; ?></b></td>

 

           <td class="smallText" align="center"><b><?php echo TABLE_HEADING_COMMENTS; ?></b></td>

 

         </tr>

 

<?php

 

   $orders_history_query = tep_db_query("select orders_status_id, date_added, customer_notified, comments from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . tep_db_input($oID) . "' order by date_added");

 

   if (tep_db_num_rows($orders_history_query)) {

 

     while ($orders_history = tep_db_fetch_array($orders_history_query)) {

 

       echo '          <tr>' . "\n" .

 

            '            <td class="smallText" align="center">' . tep_datetime_short($orders_history['date_added']) . '</td>' . "\n" .

 

            '            <td class="smallText" align="center">';

 

       if ($orders_history['customer_notified'] == '1') {

 

         echo tep_image(DIR_WS_ICONS . 'tick.gif', ICON_TICK) . "</td>\n";

 

       } else {

 

         echo tep_image(DIR_WS_ICONS . 'cross.gif', ICON_CROSS) . "</td>\n";

 

       }

 

       echo '            <td class="smallText">' . $orders_status_array[$orders_history['orders_status_id']] . '</td>' . "\n" .

 

            '            <td class="smallText">' . nl2br(tep_db_output($orders_history['comments'])) . ' </td>' . "\n" .

 

            '          </tr>' . "\n";

 

     }

 

   } else {

 

       echo '          <tr>' . "\n" .

 

            '            <td class="smallText" colspan="5">' . TEXT_NO_ORDER_HISTORY . '</td>' . "\n" .

 

            '          </tr>' . "\n";

 

   }

 

?>

 

       </table></td>

 

     </tr>

 

     <tr>

 

       <td class="main"><br><b><?php echo TABLE_HEADING_COMMENTS; ?></b></td>

 

     </tr>

 

     <tr>

 

       <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>

 

     </tr>

 

     <tr><?php echo tep_draw_form('status', FILENAME_ORDERS, tep_get_all_get_params(array('action')) . 'action=update_order'); ?>

 

       <td class="main"><?php echo tep_draw_textarea_field('comments', 'soft', '60', '5'); ?></td>

 

     </tr>

 

     <tr>

 

       <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

 

     </tr>

 

 <tr>

 

           <td class="main"><b><?php echo ENTRY_CONFIRMATION_NO;?></b><?php echo tep_draw_input_field('confirmation_no'); ?>

 

               </td>

 

         </tr>

 

         <tr>

 

         <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '11'); ?></td>

 

         </tr>

 

         <tr>

 

           <td class="main"><b><?php echo ENTRY_SHIP_DATE;?></b><?php echo tep_draw_input_field('ship_date'); ?></td>

 

         </tr>

 

     <tr>

 

       <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

 

     </tr>

 

               <tr>

 

           <td class="main"><b><?php echo ENTRY_DELIVERY_DATE;?></b><?php echo tep_draw_input_field('delivery_date'); ?></td>

 

         </tr>

 

     <tr>

 

       <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

 

     </tr>

 

     <tr>

 

       <td><table border="0" cellspacing="0" cellpadding="2">

 

         <tr>

 

           <td><table border="0" cellspacing="0" cellpadding="2">

 

             <tr>

 

               <td class="main"><b><?php echo ENTRY_STATUS; ?></b> <?php echo tep_draw_pull_down_menu('status', $orders_statuses, $order->info['orders_status']); ?></td>

 

             </tr>

 

             <tr>

 

               <td class="main"><b><?php echo ENTRY_NOTIFY_CUSTOMER; ?></b> <?php echo tep_draw_checkbox_field('notify', '', true); ?></td>

 

               <td class="main"><b><?php echo ENTRY_NOTIFY_COMMENTS; ?></b> <?php echo tep_draw_checkbox_field('notify_comments', '', true); ?></td>

 

             </tr>

 

           </table></td>

 

           <td valign="top"><?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE); ?></td>

 

         </tr>

 

       </table></td>

 

     </form></tr>

 

     <tr>

 

<td colspan="2" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ORDERS_PACKINGSLIP, 'oID=' . $HTTP_GET_VARS['oID']) . '" TARGET="_blank">' . tep_image_button('button_packingslip.gif', IMAGE_ORDERS_PACKINGSLIP) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS_INVOICE, 'oID=' . $HTTP_GET_VARS['oID']) . '" TARGET="_blank">' . tep_image_button('button_invoice.gif', IMAGE_ORDERS_INVOICE) . '</a>'; ?>

                             <?php echo '<a href="http://www.fedex.com/Tracking?tracknumbers=' . $order->shipping['confirmation_no'] . '&action=track&language=english&cntry_code=us&mps=y&ascend_header=1&imageField=Track" TARGET="_blank">' . tep_image_button('button_fedextrack.gif', IMAGE_ORDERS_TRACKING) . '</a>'; ?>

                             <?php echo '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action'))) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>

 

     </tr>

 

<?php

 

 } else {

 

?>

 

     <tr>

 

       <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">

 

         <tr>

 

           <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>

 

           <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?></td>

 

           <td align="right"><table border="0" width="100%" cellspacing="0" cellpadding="0">

 

             <tr><?php echo tep_draw_form('orders', FILENAME_ORDERS, '', 'get'); ?>

 

               <td class="smallText" align="right"><?php echo HEADING_TITLE_SEARCH . ' ' . tep_draw_input_field('oID', '', 'size="12"') . tep_draw_hidden_field('action', 'edit'); ?></td>

        <?php  echo tep_draw_hidden_field(tep_session_name(), tep_session_id()); ?>

             </form></tr>

 

             <tr><?php echo tep_draw_form('status', FILENAME_ORDERS, '', 'get'); ?>

 

               <td class="smallText" align="right"><?php echo HEADING_TITLE_STATUS . ' ' . tep_draw_pull_down_menu('status', array_merge(array(array('id' => '', 'text' => TEXT_ALL_ORDERS)), $orders_statuses), '', 'onChange="this.form.submit();"'); ?></td>

       <?php  echo tep_draw_hidden_field(tep_session_name(), tep_session_id()); ?>

             </form></tr>

 

           </table></td>

 

         </tr>

 

       </table></td>

 

     </tr>

 

     <tr>

 

       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">

 

         <tr>

 

           <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">

 

             <tr class="dataTableHeadingRow">

 

               <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CUSTOMERS; ?></td>

 

               <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ORDER_TOTAL; ?></td>

 

               <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_DATE_PURCHASED; ?></td>

 

               <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_STATUS; ?></td>

 

               <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td>

 

             </tr>

 

<?php

 

   if (isset($HTTP_GET_VARS['cID'])) {

 

     $cID = tep_db_prepare_input($HTTP_GET_VARS['cID']);

 

     $orders_query_raw = "select o.orders_id, o.customers_name, o.customers_id, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . (int)$cID . "' and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by orders_id DESC";

 

   } elseif (isset($HTTP_GET_VARS['status'])) {

 

     $status = tep_db_prepare_input($HTTP_GET_VARS['status']);

 

     $orders_query_raw = "select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and s.orders_status_id = '" . (int)$status . "' and ot.class = 'ot_total' order by o.orders_id DESC";

 

   } else {

 

     $orders_query_raw = "select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by o.orders_id DESC";

 

   }

 

   $orders_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $orders_query_raw, $orders_query_numrows);

 

   $orders_query = tep_db_query($orders_query_raw);

 

   while ($orders = tep_db_fetch_array($orders_query)) {

 

   if ((!isset($HTTP_GET_VARS['oID']) || (isset($HTTP_GET_VARS['oID']) && ($HTTP_GET_VARS['oID'] == $orders['orders_id']))) && !isset($oInfo)) {

 

       $oInfo = new objectInfo($orders);

 

     }

 

 

 

     if (isset($oInfo) && is_object($oInfo) && ($orders['orders_id'] == $oInfo->orders_id)) {

 

       echo '              <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=edit') . '\'">' . "\n";

 

     } else {

 

       echo '              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID')) . 'oID=' . $orders['orders_id']) . '\'">' . "\n";

 

     }

 

?>

 

               <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $orders['orders_id'] . '&action=edit') . '">' . tep_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . '</a> ' . $orders['customers_name']; ?></td>

 

               <td class="dataTableContent" align="right"><?php echo strip_tags($orders['order_total']); ?></td>

 

               <t

Share this post


Link to post
Share on other sites

Just a question for everyone who installed PWA...is there any noticeable difference in sales statistics after the installation? Anyone willing to share his/her experience?


- The Jackal

Share this post


Link to post
Share on other sites

I just noticed something the other day. Customers are still being created. I thought the new updated versions of PWA were supposed to prevent a Customer from being created when PWA is chosen.

Share this post


Link to post
Share on other sites
I just noticed something the other day.  Customers are still being created.  I thought the new updated versions of PWA were supposed to prevent a Customer from being created when PWA is chosen.

 

Pick up the thread around from the link below and it might help (read before and after the post below).:

http://forums.oscommerce.com/index.php?sho...ic=40352&st=820

all the best

Chris

(Just to be clear - I have no lingering customer records now.

Share this post


Link to post
Share on other sites

hey all,

 

Will this contribution work with edit orders or shipping status? Any one have a working file? If anyone does id apperciate it, im desperate enough that i will buy the code from you as well.

 

Thanks

Danny

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×