public function getTemplateLowPrice($site = 'US', $internal = false, $share_template = false, $sku = '') { if ($share_template == false) { $sql = "select accountLocation from account where id = " . $this->account_id; $result = mysql_query($sql, eBayListing::$database_connect); $row = mysql_fetch_assoc($result); $accountLocation = $row['accountLocation']; } if (!empty($_REQUEST)) { $sku = $sku == '' ? $_REQUEST['SKU'] : $sku; if ($_REQUEST['ListingType'] == "Chinese" || $_REQUEST['ListingType'] == "Dutch") { $type = "auction"; } elseif ($_REQUEST['ListingType'] == "FixedPriceItem" || $_REQUEST['ListingType'] == "StoresFixedPrice") { $type = "fix"; } else { $type = $_REQUEST['type']; } $currency = $_REQUEST['Currency']; $ShippingServiceCost1 = !empty($_REQUEST['ShippingServiceCost']) ? $_REQUEST['ShippingServiceCost'] : $_REQUEST['ShippingServiceCost1']; $shippingTemplateId = $_REQUEST['shippingTemplateId']; $shippingTemplateName = $_REQUEST['shippingTemplateName']; if (empty($_REQUEST['StartPrice'])) { $price = $_REQUEST['BuyItNowPrice']; } elseif (empty($_REQUEST['BuyItNowPrice'])) { $price = $_REQUEST['StartPrice']; } elseif (!empty($_REQUEST['StartPrice']) && !empty($_REQUEST['BuyItNowPrice'])) { $price = min($_REQUEST['StartPrice'], $_REQUEST['BuyItNowPrice']); } else { $price = $_REQUEST['price']; } } $ShippingServiceCost1 = $this->getTemplateShippingCost1($ShippingServiceCost1, $shippingTemplateName, $shippingTemplateId); if ($this->lowest_price) { $skuLowPrice = eBayListing::getSkuLowPriceS($sku, $currency, $accountLocation, $site); } else { $skuLowPrice = 0; } $lowPrice = $skuLowPrice - $ShippingServiceCost1; if ($type == "auction") { if ($price > 0.01 && $price < 0.99) { $lowPrice += 0.1; } elseif ($price > 1 && $price < 9.9) { $lowPrice += 0.25; } } if ($internal == false) { echo $lowPrice; } return $lowPrice; }
public function getSkuLowSoldPrice() { $sql = "select accountLocation from account where id = " . $this->account_id; $result = mysql_query($sql, eBayListing::$database_connect); $row = mysql_fetch_assoc($result); $accountLocation = $row['accountLocation']; $skuLowPrice = eBayListing::getSkuLowPriceS($_REQUEST['sku'], $_REQUEST['currency'], $accountLocation, $_REQUEST['site']); $shippingCost1 = $this->getShippingCost1ByTemplateName($_REQUEST['shippingTemplate']); $lowPrice = $skuLowPrice - $shippingCost1; if ($_REQUEST['type'] == "auction") { if ($_REQUEST['price'] > 0.01 && $_REQUEST['price'] < 0.99) { $lowPrice += 0.1; } elseif ($_REQUEST['price'] > 1 && $_REQUEST['price'] < 9.9) { $lowPrice += 0.25; } } echo $lowPrice; }