DebugIsEnabled())
{
echo "
Base URL: " .$baseUrl. "
";
echo "Images Base URL: " . $imagesUrl . "
";
if (isset($platformVersion) && ($platformVersion != ''))
{
echo "Platform version: " . $platformVersion . "
";
}
}
}
function GetListingRow($zencartProvider, $listingRowFromDb, $availability, $productDecription,$originalPrice, $finalPrice, $baseUrl, $reftracking, $catList, $siteImagesUrl, $shippingPrice)
{
// 8 - products_name
// 14 - brand
// 0 - products_id
// 17 - codprod
// 2 - products_image
$listingRow;
if($this->DebugIsEnabled())
{
$listingRow = "" . $this->FixEncodingToUTF8($listingRowFromDb[8]) . " | " . $listingRowFromDb[14] . " | " . "N/A" . " | " . $this->FixEncodingToUTF8($productDecription) . " | " . round($originalPrice,2) . " | " . round($finalPrice,2) . " | " . $listingRowFromDb[0] . " | " . $baseUrl."index.php?main_page=product_info&products_id=".$listingRowFromDb[0].$reftracking . " | " . $availability . " | " . $this->FixEncodingToUTF8($catList) . " | " . $siteImagesUrl .$listingRowFromDb[2] . " | " . $shippingPrice . " | " . $listingRowFromDb[16] ." |
";
}
else
{
$statement = $zencartProvider->pdoProvider->query("SELECT uri FROM ceon_uri_mappings WHERE main_page='product_info' AND current_uri=1 AND associated_db_id=".$listingRowFromDb[0], PDO::FETCH_BOTH);
if ($row = $statement->fetch()){
$link=$baseUrl. substr($row[0],1);
}else{
$link=$baseUrl. "index.php?main_page=product_info&products_id=" .$listingRowFromDb[0]. $reftracking;
}
$listingRow = $this->FixEncodingToUTF8($listingRowFromDb[8]) ."|". $listingRowFromDb[14] ."|". "N/A" . "|" . $this->FixEncodingToUTF8($productDecription) ."|". round($originalPrice,2) . "|" . round($finalPrice,2) ."|". $listingRowFromDb[0] ."|". $link ."|". $availability ."|". $this->FixEncodingToUTF8($catList) ."|". $siteImagesUrl .$listingRowFromDb[2] ."|". $shippingPrice . "|" . $listingRowFromDb[16] . " ";
}
return $listingRow;
}
function GetSqlListingQueryString($productsTable, $specialsTable, $manufacturerTable, $productsDescriptionTable, $productToCategoriesTable, $categoriesTable, $categoriesDescriptionTable, $languageId)
{
return StringFunctions::Format($this->queryListingStringFormat, $productsTable, $specialsTable, $manufacturerTable, $productsDescriptionTable, $productToCategoriesTable, $categoriesTable, $categoriesDescriptionTable, $languageId);
}
/******************************************************
* *
* @description: Print data related to language *
* *
*******************************************************/
public function PrintLanguageRow($languageRow)
{
echo "" . $languageRow[0] . " | " . $languageRow[1] . " | " . "N/A" . " | " . $languageRow[2] . " | ";
}
/*******************************************************
* *
* @description: Print Categories Tree starting *
* from a category Id *
* *
*******************************************************/
function GetCategoryTreeString($categoriesTree, $categoryId)
{
if(!isset($categoriesTree[$categoryId]))
{
return 'No category with id ' . $categoryId;
}
$categories = array();
$parentId = $categoryId;
// search towards higher level
do
{
if(!isset($categoriesTree[$parentId]))
{
break;
}
$currentCategory = $categoriesTree[$parentId];
foreach ($currentCategory as $key => $value)
{
array_push($categories, strtolower($key));
$parentId = $value;
}
}
while ($parentId >= 1);
return count($categories) == 0 ?
strtolower($categoriesTree[0]) :
implode(';', array_reverse($categories));
}
/******************************************************
* *
* @description: Print Complete Categories Tree *
* *
*******************************************************/
function PrintCategoriesTree($categoriesTree)
{
if ($this->DebugIsEnabled())
{
echo "";
if ((!isset($categoriesTree)|| (sizeof($categoriesTree) == 0)))
{
echo "No category available |
";
echo "
";
return;
}
echo "Categories Tree |
";
foreach ($categoriesTree as $key)
{
while (list($key , $value) = each($categoriesTree))
{
$outputString ="";
echo "Category id " . $key . " - " . key($value);
if (current($value) != 0)
{
$outputString = " ==> Parents: " . $this->GetCategoryTreeString($categoriesTree, current($value));
echo $outputString . " |
";
}
}
}
echo "";
}
}
/******************************************************
* *
* @description: Print Details for installed *
* Shipping methods *
* *
*******************************************************/
function PrintInstalledShippingDetails($shippingdetails)
{
if ($this->DebugIsEnabled())
{
echo "Installed Shipping details : ";
echo "
";
echo "";
echo " Type | Cost | Status | Handling Fee | Tax class | ";
echo "
";
foreach($shippingdetails as $method)
{
echo "";
echo "" . $method["type"] . " | ";
if (isset($method["cost"]))
{
echo " " . $method["cost"] . " | ";
}
else
{
echo " Not available | ";
}
if (isset($method["status"]))
{
echo " " . $method["status"] . " | ";
}
else
{
echo " Not available | ";
}
if (isset($method["handling"]))
{
echo " " . $method["handling"] . " | ";
}
else
{
echo " Not available | ";
}
if (isset($method["tax_class"]))
{
echo " ";
if ($method["tax_class"] == 0)
{
echo "None";
}
else
{
echo $method["tax_class"];
}
echo " | ";
}
else
{
echo " Not available | ";
}
}
echo "
";
echo "
";
echo " ";
}
}
}
?>