Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/units/orders/orders_item.php
Show First 20 Lines • Show All 87 Lines • ▼ Show 20 Line(s) | |||||
} | } | ||||
return $ret; | return $ret; | ||||
} | } | ||||
/** | /** | ||||
* Checks if tangible items are present in order | * Checks if tangible items are present in order | ||||
* | * | ||||
* @return bool | * @return boolean | ||||
*/ | */ | ||||
function HasTangibleItems() | public function HasTangibleItems() | ||||
{ | { | ||||
$oi_table = TABLE_PREFIX . 'OrderItems'; | |||||
if ( $this->IsTempTable() ) { | |||||
$oi_table = $this->Application->GetTempName($oi_table, 'prefix:' . $this->Prefix); | |||||
} | |||||
$sql = 'SELECT COUNT(*) | $sql = 'SELECT COUNT(*) | ||||
FROM '.TABLE_PREFIX.'OrderItems orditems | FROM ' . $oi_table . ' orditems | ||||
LEFT JOIN '.TABLE_PREFIX.'Products p ON p.ProductId = orditems.ProductId | LEFT JOIN ' . TABLE_PREFIX . 'Products p ON p.ProductId = orditems.ProductId | ||||
WHERE (orditems.OrderId = '.$this->GetID().') AND (p.Type = '.PRODUCT_TYPE_TANGIBLE.')'; | WHERE (orditems.OrderId = ' . $this->GetID() . ') AND (p.Type = ' . PRODUCT_TYPE_TANGIBLE . ')'; | ||||
return $this->Conn->GetOne($sql) ? true : false; | |||||
return $this->Conn->GetOne($sql) > 0; | |||||
} | } | ||||
/** | /** | ||||
* Calculates tax value of order items based on billing & shipping country specified | * Calculates tax value of order items based on billing & shipping country specified | ||||
* | * | ||||
* @return double | * @return double | ||||
*/ | */ | ||||
function getTaxPercent() | function getTaxPercent() | ||||
▲ Show 20 Lines • Show All 268 Lines • Show Last 20 Lines |