Foros del Web » Programando para Internet » PHP »

Lista de precios y productos PHP CUBECART 4

Estas en el tema de Lista de precios y productos PHP CUBECART 4 en el foro de PHP en Foros del Web. hola gente, bueno miren comparto con ustedes un codigo que hice y que funcina a medias... proque hace lo que tiene que hacer, pero lamentablemente ...
  #1 (permalink)  
Antiguo 30/03/2010, 11:59
Avatar de chuliano  
Fecha de Ingreso: marzo-2008
Ubicación: C. de Patagones - Argentina
Mensajes: 21
Antigüedad: 16 años, 1 mes
Puntos: 0
Lista de precios y productos PHP CUBECART 4

hola gente, bueno miren comparto con ustedes un codigo que hice y que funcina a medias... proque hace lo que tiene que hacer, pero lamentablemente al fina de la pagina me repite la pagina principal y no logro sacarla... alguien sabe como hacerlo???
esta es la web...

http://www.nickhard.com.ar/index.php?_a=listado_productos


Código PHP:
<style type="text/css">
.style1 {
    background-color: #000000;
    color: #FF0000;
    font-weight: bold;
    font-size: small
    border-color: #FF0000;
    text-decoration: none;
    border-width: 1px;
}
.style2 {
    background-color: #FFFFE1;
    color: #000000;
    font-weight: normal;
    font-size: small
    border-color: #000000;
    border-width: 1px;
    text-decoration: none;
}
A    {text-decoration: none;}
a {
    color: #000000;
}
a:visited {
    color: #000000;
}
a:hover {
    color: #FF0000;
}
.styleTabla {
    text-decoration: none;
    border-color: #000000;
    border-width: 1px;
}
</style>
<?php
$query 
"SELECT productId,  ".$glob['dbprefix']."CubeCart_inventory.cat_id, name, cat_name, price, 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";
$products $db->select($query);
$simbolo "&nbsp;uSs";
echo 
"<div style=\"background-color: #000000; color: #FFFFFF; font-weight: bold; font-size: large\"> LISTADO EN MODO PRUEBA - HACIENDO PRUEBAS</div>";
//////////////////////////////////////////////////////
echo "<table class=\"style1\" style=\"width: 100%\" border=\"1\" id=\"Exportar_a_Excel\">";
for (
$i=0$i<count($products); $i++){  
if(
$products[$i]['cat_id']!==$products[$i-1]['cat_id']){
echo 
"<tr bgcolor=\"#FFFFE1\">";
echo 
"<td class=\"style1\" style=\"font-size: small;\">".$products[$i]['cat_name']."</td>";
echo 
"<td class=\"style1\" style=\"font-size: small;\">Precio".$simbolo."</td>";
echo 
"<td class=\"style1\" style=\"font-size: small;\">stock</td>";
echo 
"</tr>";
}
if(
$products[$i]['stock_level']=="0"){
} elseif(
$products[$i]['stock_level']>="1"){
echo 
"<tr style=\"font-size: small; font-weight: normal; font-family: Arial, Helvetica, sans-serif;\">"
echo 
"<td class=\"style2\" style=\"font-size: small; font-weight: normal; font-family: Arial, Helvetica, sans-serif;\"><a  target=\"_blank\" href=\"index.php?_a=viewProd&amp;productId=".$products[$i]['productId']."\">".substr(strip_tags($products[$i]['name']), 0125)."..."."</a></td>";
if(
$products[$i]['price']<=$products[$i]['sale_price']){
echo 
"<td class=\"style2\" style=\"font-size: small; font-weight: normal; font-family: Arial, Helvetica, sans-serif;\">".$simbolo."&nbsp;".$products[$i]['price']."</td>"// FILA PRECIO
echo "<td class=\"style2\" style=\"font-size: small; font-weight: normal; font-family: Arial, Helvetica, sans-serif;\">".$products[$i]['stock_level']."</td>"// FILA STOCK
} elseif($products[$i]['sale_price']=="0.00"){
echo 
"<td class=\"style2\" style=\"font-size: small; font-weight: normal; font-family: Arial, Helvetica, sans-serif;\">".$simbolo."&nbsp;".$products[$i]['price']."</td>"// FILA PRECIO 
echo "<td class=\"style2\" style=\"font-size: small; font-weight: normal; font-family: Arial, Helvetica, sans-serif;\">".$products[$i]['stock_level']."</td>"// FILA STOCK
}else{
echo 
"<td class=\"style2\" style=\"font-size: small; font-weight: normal; font-family: Arial, Helvetica, sans-serif;\">".$simbolo."&nbsp;".$products[$i]['sale_price']."</td>"// FILA PRICE
echo "<td class=\"style2\" style=\"font-size: small; font-weight: normal; font-family: Arial, Helvetica, sans-serif;\">".$products[$i]['stock_level']."</td>"// FILA STOCK
}
}
echo 
"</tr>";
}
echo 
"</table>";
?>

Etiquetas: lista, precios, productos
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 21:57.