Index: branches/5.2.x/units/orders/orders_tag_processor.php =================================================================== diff -u -N -r16516 -r16738 --- branches/5.2.x/units/orders/orders_tag_processor.php (.../orders_tag_processor.php) (revision 16516) +++ branches/5.2.x/units/orders/orders_tag_processor.php (.../orders_tag_processor.php) (revision 16738) @@ -1,6 +1,6 @@ -1)); + if ( $this->orderExists($params) ) { + $params['render_as'] = $params['item_render_as']; + $tag_params = array_merge($params, array('per_page' => -1)); - $o_items = $this->Application->ProcessParsedTag(rtrim('orditems.' . $this->Special, '.'), 'PrintList', $tag_params); + $o_items = $this->Application->ProcessParsedTag( + rtrim('orditems.' . $this->Special, '.'), + 'PrintList', + $tag_params + ); + } if ( $o_items ) { if ( isset($params['header_render_as']) ) { @@ -202,9 +209,7 @@ function CartNotEmpty($params) { - $object = $this->getObject($params); - - if ($object->GetDBField('Status') != ORDER_STATUS_INCOMPLETE || $object->GetID() == FAKE_ORDER_ID) { + if ( !$this->orderExists($params) ) { return 0; } @@ -219,6 +224,24 @@ return 0; } + /** + * Checks order is exists. + * + * @param array $params Tag params. + * + * @return boolean + */ + protected function orderExists(array $params) + { + $object = $this->getObject($params); + + if ( $object->GetDBField('Status') != ORDER_STATUS_INCOMPLETE || $object->GetID() == FAKE_ORDER_ID ) { + return false; + } + + return true; + } + function CartIsEmpty($params) { return $this->CartNotEmpty($params) ? false : true;