Index: branches/5.3.x/units/orders/orders_item.php =================================================================== diff -u -N -r16106 -r16398 --- branches/5.3.x/units/orders/orders_item.php (.../orders_item.php) (revision 16106) +++ branches/5.3.x/units/orders/orders_item.php (.../orders_item.php) (revision 16398) @@ -1,6 +1,6 @@ IsTempTable() ) { + $oi_table = $this->Application->GetTempName($oi_table, 'prefix:' . $this->Prefix); + } + $sql = 'SELECT COUNT(*) - FROM '.TABLE_PREFIX.'OrderItems orditems - LEFT JOIN '.TABLE_PREFIX.'Products p ON p.ProductId = orditems.ProductId - WHERE (orditems.OrderId = '.$this->GetID().') AND (p.Type = '.PRODUCT_TYPE_TANGIBLE.')'; - return $this->Conn->GetOne($sql) ? true : false; + FROM ' . $oi_table . ' orditems + LEFT JOIN ' . TABLE_PREFIX . 'Products p ON p.ProductId = orditems.ProductId + WHERE (orditems.OrderId = ' . $this->GetID() . ') AND (p.Type = ' . PRODUCT_TYPE_TANGIBLE . ')'; + + return $this->Conn->GetOne($sql) > 0; } /**