News:

Support the VirtueMart project and become a member

Main Menu

How to display all product images on the Category page?

Started by hopinn, October 04, 2016, 15:27:24 PM

Previous topic - Next topic

hopinn

I used this code beneath in "../components/com_virtuemart/views/category/tmpl/default.php" but only the first category image shows up. Where do i go wrong? thank you!

      <?php
   
         // List all Images
         if (count($this->category->images) > 0) {
       
             foreach ($this->category->images as $image) { // Loop through the results
     
               $ImgLink = $image->file_url;
               $ImgTitle = $this->category->category_name;
         
           
            echo '<img src="'.$ImgLink.'" alt="" title="'.$ImgTitle.'" />';
           
           
                           }
                        }
      ?>

PRO