VirtueMart Forum

VirtueMart 2 + 3 + 4 => Frontend Modules => Topic started by: g_spud on March 08, 2012, 09:30:04 AM

Title: Featured Module Only Displaying 5 items
Post by: g_spud 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.
Title: Re: Featured Module Only Displaying 5 items
Post by: sveibern 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
Title: Re: Featured Module Only Displaying 5 items
Post by: zani 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
Title: Re: Featured Module Only Displaying 5 items
Post by: sveibern on March 19, 2012, 21:50:31 PM
Thanks! A bit strange that this isn't configurable in the adminsystem...
Title: Re: Featured Module Only Displaying 5 items
Post by: 16vmini 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
Title: Re: Featured Module Only Displaying 5 items
Post by: kasperghost 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' ?