Post by spitos » Fri Sep 02, 2011 10:19 am

Do you know how to set the limit of featured products displayed in 1.5.1.1? At the moment it shows however many are listed in the featured module and I can't find any way to do this after searching in the forums.

Image
Google Analytics Expert - Advanced e-commerce tracking, Product & options reporting, transaction/conversion reporting, Google Adwords conversion & profit reporting, goal & funnel reporting, event tracking, site search tracking, multi-store compatibility, EU Cookie Law compliance and works with any theme or checkout! Easy vqmod install. Get it here


User avatar
Active Member

Posts

Joined
Mon May 23, 2011 6:19 pm
Location - UK

Post by snappyfish » Sun Sep 04, 2011 10:03 pm

The answer is in your own question.

Active Member

Posts

Joined
Thu Apr 14, 2011 4:36 am

Post by Johnathan » Sun Sep 04, 2011 11:31 pm

There's no way to do this through the admin currently. Here's a quick edit that can limit the number displayed in the module to 5. (Replace that with whatever number you want.)

IN:

Code: Select all

/catalog/controller/module/featured.php
BEFORE:

Code: Select all

foreach ($products as $product_id) { 
ADD:

Code: Select all

$products = array_slice($products, 0, 5); 

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by grgr » Mon Sep 05, 2011 12:24 am

I kind of agree with snappyfish!

However, if you want to do this then maybe you also want to show some different products each time and then in which case instead of adding:

Code: Select all

		$products = array_slice($products, 0, 5);
Add this:

Code: Select all

	shuffle($products);
		$products = array_slice($products, 0, 5);
That should provide a bit of randomization.

-
Image Image Image Image
VIEW ALL EXTENSIONS * EXTENSION SUPPORT * WEBSITE * CUSTOM REQUESTS


User avatar
Active Member

Posts

Joined
Mon Mar 28, 2011 4:08 pm
Location - UK

Post by spitos » Mon Sep 05, 2011 4:03 pm

snappyfish wrote:The answer is in your own question.
It wasn't really answered in my own question and that would be pretty obvious anyway .... This might explain my question :)

It seems that my post was moved by a moderator from here:
http://forum.opencart.com/viewtopic.php ... 21#p193021

So using Qphoria's mod, I wanted to have say 30 featured items in admin, but randomly show a set limit of 8 in the front end. So rather than having the same 6 items show in different positions, i'd like to have 6 random featured products from the 30 show.

It now works a treat!

Thanks for your help guys ;)

Image
Google Analytics Expert - Advanced e-commerce tracking, Product & options reporting, transaction/conversion reporting, Google Adwords conversion & profit reporting, goal & funnel reporting, event tracking, site search tracking, multi-store compatibility, EU Cookie Law compliance and works with any theme or checkout! Easy vqmod install. Get it here


User avatar
Active Member

Posts

Joined
Mon May 23, 2011 6:19 pm
Location - UK

Post by xlam » Sat Nov 24, 2012 3:24 am

Johnathan wrote:There's no way to do this through the admin currently. Here's a quick edit that can limit the number displayed in the module to 5. (Replace that with whatever number you want.)

IN:

Code: Select all

/catalog/controller/module/featured.php
BEFORE:

Code: Select all

foreach ($products as $product_id) {
ADD:

Code: Select all

$products = array_slice($products, 0, 5);
hello...is working for me on OC 1.5.1.3

Baju Muslim Baju Pria Baju Anak Baju Korea Sparepart Printer Baju Muslim JNE Surabaya


New member

Posts

Joined
Sun Dec 25, 2011 2:58 pm
Who is online

Users browsing this forum: No registered users and 34 guests