Author Topic: all product in same category on product detailed page  (Read 555 times)

encreplus

  • Jr. Member
  • **
  • Posts: 187
    • Dr-ink
  • VirtueMart Version: 3.0.10
all product in same category on product detailed page
« on: November 03, 2015, 21:41:50 pm »
How can i show all products available in the same category of the product a user is watching in the product detail page

Im using VM3 3.0.10 and joomla 3.4.5

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 26428
  • Always on vacation
    • Jenkin Hill Internet
Re: all product in same category on product detailed page
« Reply #1 on: November 03, 2015, 23:40:41 pm »
You can add the related category, when clicked on it will open to show the products, but I know of no way to show all those products.
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VM3.2.10 on Joomla 3.8.3 PHP 7.0.25

Testing VM3.2.10.9700 on J3.8.3

lindapowers

  • Full Member
  • ***
  • Posts: 1335
  • If you're going through hell, keep going.
    • Venta de naranjas online y mandarinas
  • Skype Name: manu.gonzalez91
  • VirtueMart Version: Latest avi
Re: all product in same category on product detailed page
« Reply #2 on: November 04, 2015, 00:05:15 am »
Using related products
http://www.comenaranjas.com - Navel oranges and clementines from Spain

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10272
  • VirtueMart Version: 3+
Re: all product in same category on product detailed page
« Reply #3 on: November 04, 2015, 10:26:22 am »
use the product module, category filter turned on, set the quantity to as high as you need it
I do NOT do development work for hire.

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 26428
  • Always on vacation
    • Jenkin Hill Internet
Re: all product in same category on product detailed page
« Reply #4 on: November 04, 2015, 12:18:31 pm »
Ah yes! I had not realised that Milbo has removed the product limit for relateds. Layout could do with some styling, though.
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VM3.2.10 on Joomla 3.8.3 PHP 7.0.25

Testing VM3.2.10.9700 on J3.8.3

melix

  • Beginner
  • *
  • Posts: 3
Re: all product in same category on product detailed page
« Reply #5 on: August 06, 2017, 23:41:58 pm »
Hi,
I have read all topics regarding this thread, and nothing is able to automatize the process.
Here is the VM 1.1.X piece of hack that allowed showing other products of the same category in product_detail page (old flypage).

Would it be possible someone translate it for VM 3.x ? It would be chic on his part ! 8)

Code: [Select]
<?php   // find all the other products in this category

  
$q "SELECT p.product_id, p.product_name, p.product_sku, p.product_thumb_image, c.category_name, c.category_flypage
            FROM #__{vm}_product p,#__{vm}_product_category_xref pc, #__{vm}_category c
            WHERE p.product_publish='Y' AND pc.product_id = p.product_id AND pc.category_id = c.category_id AND c.category_id = '
$category_id' AND p.product_id != '$product_id'
            ORDER BY p.product_sku "
;

$i=0;
$max=4//entry by row

$db = new ps_DB;
$db->query$q );
if( $db->next_record() )  {
echo 
'Autres coloris de la collection "'.$db->f('category_name').'"<br />';
   
$flypage $db->f('category_flypage');
   
$db->reset();
   echo 
'<br><table style="width:100%">';
    while( 
$db->next_record() ) { 

if ($i && $i $max == 0)
    {
        echo 
'</tr><tr>';
    }

   echo 
'<td style="padding-right: 10px">';
?>

     
      <a href="<?php  $sess->purl(URL "index.php?page=shop.product_details&flypage=$flypage&product_id=" $db->f("product_id") . "&category_id=$category_id?>">
      <img src="<?php echo $mosConfig_live_site;?>/components/com_virtuemart/shop_image/product/<?php $db->p("product_thumb_image");?>"
  title = <?php $db->p("product_sku"?> alt = <?php $db->p("product_sku"?>>
  <br /><?php echo $db->p("product_name"?>
      </a>
      <?php
  
   echo 
'<hr /></td>';
   
$i++;
   } 
//while
echo '</tr></table>';
// if
?>