Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Problem Order total not in admin


Victortella

Recommended Posts

  • 4 weeks later...

The problem is with the SQL that is used to generate the list. The SQL has an LEFT JOIN on the orders_totals table but part of the condition for the JOIN is stuck in the WHERE clause. This clause is causing the problem.

 

Need to update the orders.php file and change the following SQL statements to move the WHERE clause into the LEFT JOIN clause. Change the SQL from:

 

select count(*) as total from orders o

left join orders_total ot on (o.orders_id = ot.orders_id),

orders_status s

where o.orders_status = s.orders_status_id and s.language_id = '1'

and ot.class = 'ot_total'

 

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 orders o

left join orders_total ot on (o.orders_id = ot.orders_id),

orders_status s

where o.orders_status = s.orders_status_id and s.language_id = '1'

and ot.class = 'ot_total'

order by o.orders_id DESC limit 0, 20

 

To:

 

select count(*) as total from orders o

left join orders_total ot on (o.orders_id = ot.orders_id) and ot.class = 'ot_total',

orders_status s

where o.orders_status = s.orders_status_id and s.language_id = '1'

 

 

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 orders o

left join orders_total ot on (o.orders_id = ot.orders_id) and ot.class = 'ot_total' ,

orders_status s

where o.orders_status = s.orders_status_id and s.language_id = '1'

 

order by o.orders_id DESC limit 0, 20

Link to comment
Share on other sites

  • 2 months later...

I do a search and replace for this string in admin/orders.php and NONE of this code appears there.... And I still do not show any orders. Nor do I get any emails when an order is made. And Yes I have added additional email addresses.

 

NONE of the stuff that I have downloaded helps either. I think I have just about read EVERYTHING on this forum about this issue and nothing seems to work. Any other ideas?????

Link to comment
Share on other sites

  • 1 month later...
  • 4 weeks later...
Thanks pbwebguy, that fixes it straight away.

 

It's between lines 353 - 368 in Admin/orders.php

 

Make sure you delete the "," after the end of the left join inner braces ( & ) and then put a "," after adding (as pbwebguy said:)

and ot.class = 'ot_total'

samuraibot,

 

What version is that from? I am using this(bear with me I am SO new at this)...

orders.php,v 1.112 2003/06/29

 

I am pretty sure I am in the right place but I don't see any of the wrong code there. I am in admin/orders.php

 

I am having this same problem and it is driving me nuts.

Any further help is much appreciated!

 

Thanks!

 

Tiffany

www.theposiepatch.com

Link to comment
Share on other sites

  • 2 weeks later...

I am using the same version and the code is different.

 

It just stoped working. Can some help us. Nick

 

This is the code from 353 to 375

 

<?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";

}

?>

Link to comment
Share on other sites

  • 8 months later...

Have you tried going to Admin>Modules>Order Total and either installing if not previously installed or selecting each component then choosing edit>update (no changes likely necessary)?

Just fixed essentially the same problem for me.

Link to comment
Share on other sites

  • 2 months later...

This fix from Vger worked for me.

 

 

This is a problem with MySQL 4.1 and osCommerce. In admin/includes/classes/split_page_results.php, around line 37 you'll see these two lines of code:

 

$offset = ($max_rows_per_page * ($current_page_number - 1));

$sql_query .= " limit " . $offset . ", " . $max_rows_per_page;

 

Sandwich these lines of code between the two lines above:

 

if ($offset < 0)

{

$offset = 0 ;

}

 

That should resolve the problem.

 

Vger

 

http://www.oscommerce.com/forums/index.php?sho...26entry697026

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...