News:

Support the VirtueMart project and become a member

Main Menu

Featured Module Only Displaying 5 items

Started by g_spud, March 08, 2012, 09:30:04 AM

Previous topic - Next topic

g_spud

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

#1
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

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

Thanks! A bit strange that this isn't configurable in the adminsystem...

16vmini

cheers , fixed my problem as well .. done seem strange its missed from admin ... but thats life .. its free ...

Matt

kasperghost

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' ?