Jump to content

chuliano
 Share

Recommended Posts

Hello, I have a question.

A few years ago I developed a list of automatic prodcutos with coin dollars and pesos (currency of my country) to cubecart 4. my question is, how can I transfer it to cubecart 5 ???

This is the full code

<style>
.style_titulos {
	background-color: #CEDFFF;
	color: #000;
	border-color: #FF0000;
	/*text-transform:uppercase;*/
	text-decoration: none;
	border-width: 0px;
	background-repeat: repeat-x;
	font-size: 16px;
}
.style_activado {
	background-color: #7C7C7C;
	color: #FFF;
	border-color: #000000;
	border-width: 1px;
	text-decoration: none;
	text-indent:10px;
	font-size: small;
}
.style_activado a{
	text-decoration: none;
	color: #FFF;
}
.style_desactivado {
	background-color: #7C7C7C;
	color: #B6B6B6;
	border-color: #000000;
	border-width: 1px;
	text-indent:10px;
	font-size: small;
	text-decoration: line-through;
}
.style_desactivado a {
	text-decoration: line-through;
	color: #B6B6B6;
}
a:visited {
	color: #FFFC;
}
a:hover {
	color: #EA9900;
}
</style>
<?php
ob_start();
//////////////////////////////////////////////////////
if(!defined('CC_INI_SET')){ die("Access Denied"); }
permission("statistics", 'read', true);

require($glob['adminFolder'].CC_DS."includes".CC_DS."header.inc.php");
/////////////////////////////////////////
require_once ("ini.inc.php");
// archivo ini, sin zlib.output_compression ini.inc.php propio
require_once ("includes".CC_DS."global.inc.php");
require_once ("includes".CC_DS."functions.inc.php");
require_once ("classes".CC_DS."db".CC_DS."db.php");
////////////////////////
// BUILD SUB CATEGORIES
////////////////////////
$query = "SELECT productId,  ".$glob['dbprefix']."CubeCart_inventory.cat_id, name, cat_name, date_added, price, disabled, sale_price, useStockLevel, stock_level, productCode FROM ".$glob['dbprefix']."CubeCart_inventory INNER JOIN  ".$glob['dbprefix']."CubeCart_category ON  ".$glob['dbprefix']."CubeCart_inventory.cat_id =  ".$glob['dbprefix']."CubeCart_category.cat_id ORDER BY cat_name ASC, price ASC, name ASC";
$db = new db();
$products = $db->select($query);
$simbolo = "&nbsp;$"; // pesos
$simboloD = "&nbsp;uSs"; // dolares
////////////////////////////
// carga monedas
require($glob['adminFolder'].CC_DS."includes".CC_DS."cotizacion.inc.php");
// fin moneda
////////////////////////////
$coti = $currencies[0]['value'];
$PESOS = number_format($coti, 2, ',', ' '); // con solo 2 decimales
/////////////////////////////////////////////////////////////
echo "<table width="100%" border="0" cellpadding="3" cellspacing="1" class="mainTable">";
echo "<tr>";
echo "<td colspan="2" class="tdTitle">Estadisticas de productos - precio - stock - valorizado</td>";
echo "</tr>";
echo "<tr>";
echo "<td colspan="2">";
echo "<ul>";
echo "<li><a href="http://www.nickhard.com.ar/tienda/admin.php?_g=stats/index" class="txtLink"><< Volver</a></li>";
echo "</ul>";
echo "</td>";
echo "</tr>";
echo "</table>";
/////////////////////////////////////////////////////////////
echo "<table class="style_titulos" style="width: 100%" border="1" id="Exportar_a_Excel">";
echo "<tr>";
echo  "<td class="style_activado" width="100%" colspan="6">LISTADO DE PRECIOS USO INTERNO - &nbsp;Cotizaci&oacute;n:&nbsp;".$simbolo."&nbsp;".$PESOS."</td>";
echo "</tr>";
for ($i=0; $i<count($products); $i++){  
if($products[$i]['cat_id']!==$products[$i-1]['cat_id']){
echo "<tr bgcolor="#FFFFE1">";
echo "<td class="style_titulos"> :: ".$products[$i]['cat_name']."</td>";
//echo "<td class="style_titulos">Precio".$simbolo."&nbsp;(Pesos)<h style="color:red" >Oferta</h></td>";
echo "<td class="style_titulos">Precio".$simbolo."&nbsp;(Pesos)</td>";
echo "<td class="style_titulos">Stock</td>";
echo "<td class="style_titulos">Valorizado de stock</td>";
echo "</tr>";
echo "<tr>";
}
///////////////////////////////
// COMIENZO DEL IF RPINCIPAL //
///////////////////////////////
////////////////////////////////////////////////////
// SI EL STOCK ES 0 ENTONCES NO CREA NINGUNA FILA //
////////////////////////////////////////////////////
//echo "<td id="6" style="background-color: #FFFFE1; color: #FF0000; font-weight: bold; font-size: small">".substr(strip_tags($products[$i]['name']), 0, 85)."... (NO/FUERA DE STOCK)"."</td>";
//////////////////////////////////////////////////////////
// COMIENZO SI EL STOCK ES 1 O MAYOR A 1 ENTONCES CREA LAS FILAS //
//////////////////////////////////////////////////////////
////////////////////////////
// COMIENZO DEL IF OFERTA //
////////////////////////////
// if($products[$i]['disabled']){
if($products[$i]['stock_level']<="0"){
//////////////////////////////////////////
// Fin productos desactivados
// si el producto esta desactivado
// directamente no se muestra en la lista
//////////////////////////////////////////
} else if(!$products[$i]['disabled']){
echo "<td class="style_activado" ><a target="_blank" href="http://nickhard.com.ar/tienda/index.php?_a=viewProd&amp;productId=".$products[$i]['productId']."">".substr(strip_tags($products[$i]['name']), 0, 125)."..."."</a></td>"; // FILA PRODUCTO
// solo ver un precio, oferta o fijo.
//////////////////////////////////////////
//echo "<td class="style_activado">".$simbolo."&nbsp;".round($products[$i]['price']*$coti)." (".$simbolo."&nbsp;".round($products[$i]['sale_price']*$coti).")</td>"; // FILA PRECIO 

if($products[$i]['sale_price']<="0"){
echo "<td class="style_activado">".$simbolo."&nbsp;".round($products[$i]['price']*$coti)."</td>"; // FILA PRECIO 
}else{
//echo "<td class="style_activado" style="color:red">".$simbolo."&nbsp;".round($products[$i]['sale_price']*$coti)."</td>"; // FILA PRECIO 
echo "<td class="style_activado">".$simbolo."&nbsp;".round($products[$i]['sale_price']*$coti)."&nbsp;(Oferta)</td>"; // FILA PRECIO 
}	
// solo ver un precio, oferta o fijo.
//////////////////////////////////////////
echo "<td class="style_activado">".$products[$i]['stock_level']."</td>"; // FILA PRICE
// valorizado	
if($products[$i]['sale_price']<="0"){
echo "<td class="style_activado">".$simbolo."&nbsp;".round($products[$i]['price']*$coti)*$products[$i]['stock_level']."</td>"; // FILA PRICE
}else{
//echo "<td class="style_activado" style="color:red">".$simbolo."&nbsp;".round($products[$i]['sale_price']*$coti)."</td>"; // FILA PRECIO 
echo "<td class="style_activado">".$simbolo."&nbsp;".round($products[$i]['sale_price']*$coti)*$products[$i]['stock_level']."</td>"; // FILA PRICE
}	
// valorizado
/*activado desactivados funciona */
}
echo "</tr>";
}
echo "</table>";
//////////////////////////////////////////////
?>
<style>
.navTitle2 {
	padding: 0px;
	font-size: 12px;
}
</style>

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...