Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Sign in to follow this  
Deskdirect

Tried Catalog Anywhere

Recommended Posts

I've tried both contribs - Catalog Anywhere and the Catalog Anywhere with Catagories - and neither seem to work. I tweaked the code to show product images but am clueless as to how to get the product link to work.

 

Is there a reliable contrib that will allow me to show products on other pages at my site?

Share this post


Link to post
Share on other sites

I've tried to modify this code to work. I managed to get it to display the images but the product links are still broken.

 

HELP!

 

<?php
echo "<table width=\"$table_width%\" align=\"$table_align\" cellspacing=\"$table_cspace\" cellpadding=\"$table_cpadd\"><tr>";
$tdwidth = round($table_width/$prod_col) - 1;
$connection = mysql_connect("$db_server","$db_user","$db_pass")
or die("Couldn't make connection.");


$db = mysql_select_db("$db_name", $connection)
or die("Couldn't select database.");

if (!$pl) {$pl = "0";}
if (!$ph) {$ph = $num_products;}


$sqlcount = "SELECT * FROM `products` ORDER BY 'products_model'";
$sql = "SELECT * FROM `products` p, `products_to_categories` p2c  where p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id = '" . $category_display . "' ORDER BY RAND() DESC LIMIT $pl, $num_products";

$sql_result = mysql_query($sql,$connection)
or die("Couldn't execute query.");
$sqlcount_result = mysql_query($sqlcount,$connection)
or die("Couldn't execute query.");

$num = mysql_numrows($sqlcount_result);
mysql_free_result($sqlcount_result);

//echo 
$num;
$prod_result = ($prod_col + 1)/2;
//echo 
$prod_result;
$i = 1;




while ($row = mysql_fetch_array($sql_result)) {

$id = $row["products_id"];
$model = $row["products_model"];
$image = $row["products_image"];
$price = $row["products_price"];
   $sql2 = "SELECT `products_name` FROM `products_description` WHERE products_id = '$products_id' LIMIT 1";
$sql2_result = mysql_query($sql2,$connection)	or die("Couldn't execute query.");
$row2 = mysql_fetch_array($sql2_result);
 $name = $row2["0"];
 $products_image_replace = str_replace("/", "/", $image);
 $products_price_replace = str_replace("", "", $price);	
 $idiv = $i/2;

if ($idiv == $prod_result) {
echo "</tr><tr>";
$i = 1;
} else {
}
echo "<td align=\"center\" width=\"$tdwidth%\" class=\"content\">";
if ($product_info_link == "1") {
if ($product_image == "1") {
echo "<a href=\"http://$domain_name/$catalog_folder_name/product_info.php/products_id=$products_id\" target=\"_blank\"><img src=\"http://$domain_name/$catalog_folder_name/images/$products_image_replace\" width=\"$image_width\" height=\"$image_height\" border=\"0\"><br>$name</a><br>";
} else {
echo "<a href=\"http://$domain_name/$catalog_folder_name/product_info.php/products_id=$products_id\" target=\"_blank\">$name</a><br>";
}
} else {
if ($product_image == "1") {
echo "<img src=\"http://$domain_name/$catalog_folder_name/images/$products_image_replace\" width=\"$image_width\" height=\"$image_height\" border=\"0\"><br>$name<br>";
} else {
echo "$name<br>";
}
}
if ($product_price == "1") {
echo "\$$products_price_replace<br>";
} else {
}
if ($product_buy_link == "1") {
echo "<a href=\"http://$domain_name/$catalog_folder_name/default.php/action/buy_now/products_id=products_$id\">Buy Now</a></td>";
} else {
}
$i++;
}


mysql_free_result($sql_result);
mysql_close($connection);
?>
</table>

<?php
echo "<table width=\"$table_width%\" align=\"$table_align\" cellspacing=\"$table_cspace\" cellpadding=\"$table_cpadd\"><tr><td align=\"center\"><form action=\"$PHP_SELF\" method=\"get\">";
if (!$pl || ($pl == 0)) {
} else {
$prepl = $pl - $num_products;
echo "[<a href=\"$PHP_SELF?pl=$prepl\">Previous</a>] ";
}
echo "<select name=\"pl\" onChange=\"this.form.submit();\" size=\"1\"><option value=\"\" SELECTED>Page Jump</option>";
$page_count = round($num / ($num_products)) - 1;
$j = 0;
while ($j <= $page_count) {
$page = $j+1;
$newpl1 = $num_products*$j;
if ($j == 0) {
$newpl = "0";
} else {
$newpl = ($j*$num_products)+1;
}
echo "<option value=\"$newpl\">$page</option>";
$j++;
}
$nextpl = $num_products + $pl;
echo "</select> [<a href=\"$PHP_SELF?pl=$nextpl\">Next</a>]</form></td></tr></table>";

Share this post


Link to post
Share on other sites
Guest

Hello..!

 

Is there something new about this Contrib..?

Have any1 got Catalog Anywhere (With Categories) mod works with milestone2.2?

 

Thank You..! :thumbsup:

 

--h-

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×