Author Topic: Random with desc  (Read 1190 times)

ZA

  • Guest
Random with desc
« on: August 03, 2010, 16:46:14 pm »
Hi all!
I'm working on my new site and i'm using virtuemart.
I want to have on my frontpage some random products with short description.
I've done this http://forum.virtuemart.net/index.php?topic=55104.msg184282#msg184282 and this http://forum.virtuemart.net/index.php?topic=64564.msg213915#msg213915 ...it works, but the problem is that i've published latest_products module on my site, and in this module i don't want to display the short description, just the name, price and the thumb image...but with the settings mentionated above this module is changing as well..

Beside this, I've tryed something else...
1.added
Quote
product_s_desc
in the second sql interogation, so i've obteined this:
Code: [Select]
else {
   $q  = "SELECT DISTINCT product_sku, product_s_desc FROM #__{vm}_product WHERE ";
   $q .= "product_parent_id='' AND vendor_id='".$_SESSION['ps_vendor_id']."' ";
   $q .= "AND #__{vm}_product.product_publish='Y' ";
   if( CHECK_STOCK && PSHOP_SHOW_OUT_OF_STOCK_PRODUCTS != "1") {
      $q .= " AND product_in_stock > 0 ";
   }
   $q .= "ORDER BY product_name DESC";
}
2.added
Code: [Select]
$product_s_desc = $db->f('product_s_desc'); before the "if($db->num_rows() == 0) {" code

After all this i've added
Code: [Select]
echo $product_s_desc where i wanted to show the short description.
It works, but the problem is that i have the same short description to all my random products ..i guess it's missing something in the code..

mbit

  • Jr. Member
  • **
  • Posts: 323
Re: Random with desc
« Reply #1 on: March 10, 2011, 11:42:15 am »
did you fix that?