Author Topic: Featured Module Only Displaying 5 items  (Read 6955 times)

g_spud

  • Beginner
  • *
  • Posts: 1
Featured Module Only Displaying 5 items
« on: March 08, 2012, 09:30:04 am »
Having a problem with VM2 in that it only displays 5 items in the front end of Feature Products..  It does the same with top ten products.
I have gone in to the backend and selected about 10 of each but it doesn't work.

Also just one other thing. I'd like to change the Heading "Featured Products" to "Feature Home Plans" aswell.

Any advice would be appreciated.

sveibern

  • Beginner
  • *
  • Posts: 26
Re: Featured Module Only Displaying 5 items
« Reply #1 on: March 15, 2012, 08:57:37 am »
I have the same problem, only 5 products showing. But not in the module, only if I set "Show featured" in VM configuration. If I set up a Featured module, I can get as many products I want. Does anyone know why?

g_spud: You can change it in the language file: language/en-GB/en-GB.com_virtuemart.ini

zani

  • Beginner
  • *
  • Posts: 1
Re: Featured Module Only Displaying 5 items
« Reply #2 on: March 19, 2012, 14:05:53 pm »
FOLDER components/com_virtuemart/views/virtuemart/

open view.html.php

Search and Modify ('featured', 4) ('latest', 4) ('topten', 4)


Replace 4

Change the preferred number

sveibern

  • Beginner
  • *
  • Posts: 26
Re: Featured Module Only Displaying 5 items
« Reply #3 on: March 19, 2012, 21:50:31 pm »
Thanks! A bit strange that this isn't configurable in the adminsystem...

16vmini

  • Beginner
  • *
  • Posts: 23
Re: Featured Module Only Displaying 5 items
« Reply #4 on: March 31, 2012, 18:12:14 pm »
cheers , fixed my problem as well .. done seem strange its missed from admin ... but thats life .. its free ...

Matt

kasperghost

  • Beginner
  • *
  • Posts: 3
Re: Featured Module Only Displaying 5 items
« Reply #5 on: May 25, 2012, 05:05:01 am »
USE AT YOUR OWN RISK ON A TEST SERVER FIRST! CONSIDER I'M A NEWBIE TOO...

Adding a Virtuemart Settings extra field for max featured products
------------------------------------------------------------------------------------
wanted to use featured products with the added functionality(from module) without adding any unneccecary modules
for me it works perfectly but i havent done any extensive testing on this...
USE AT YOUR OWN RISK!

MAKE THE FOLLOWING CHANGES!
administrator\components\com_virtuemart\views\config\tmpl
default_templates.php
line 180
===============
          <tr>
         <td class="key">
             <?php echo JText::_('COM_VIRTUEMART_ADMIN_CFG_FEATURED_PRODUCTS_MAXIMUM') ?>
         </td>
         <td>
             <input type="text" name="featured_products_maximum" size="4" class="inputbox" value="<?php echo $this->config->get('featured_products_maximum') ?>" />
         </td>
          </tr>
===============

adding the field inside configuration of virtuemart
administrator\components\com_virtuemart\
virtuemart.cfg
line 60
===============
    featured_products_maximum=5
===============

adding the actual code that sets the maximum featured products
components\com_virtuemart\views\virtuemart
view.html.php
Line 70 or
Find:
===============
         if (VmConfig::get('show_featured', 1)) {
            $products['featured'] = $productModel->getProductListing('featured', 5);
           $productModel->addImages($products['featured'],1);
         }
===============

Change with:
===============
         if (VmConfig::get('show_featured', 1)) {
           $featuredvar = VmConfig::get('featured_products_maximum');
            $products['featured'] = $productModel->getProductListing('featured', $featuredvar);
           $productModel->addImages($products['featured'],1);
         }
===============

adding a name for the field in settings (also it can be translated)
administrator\language\en-GB
en-GB.com_virtuemart.ini
Line 80
===============
COM_VIRTUEMART_ADMIN_CFG_FEATURED_PRODUCTS_MAXIMUM="Set maximum featured products"
===============

Have a nice day guys! :)

ps. does anyone know how to add a button 'add to cart' ?