Post by robster » Thu Sep 09, 2010 6:00 pm

Hi

I am now nearly fully recovered from my 10 year bout of "zencart-itus" and am loving OpenCart.

I do miss one small feature (or maybe not so small I dunno???) that zencart has:

The 'Latest Products' (or as zencart call it - 'New products for xxxmonth') is random new products that change everytime the page is refreshed. The 'newness' of these products is set in admin, for example, added in last 30 days, 60 days, 90 days, etc. There is also a link that allows visitors to see ALL new products not just the 8 or 12 or whatever that are shown on the home page. Is this feature available with OpenCart?

This randomness also applies to 'Specials' and 'Featured Products' in so much as the module shows a limited but changing random selection of these but with a link to show all. This works great and would be excellent on OpenCart

As it is just now, how would a visitor to the site see ALL Latest, Featured or Specials not just the few listed in the respective modules? So for example if I had 100 Specials, but the Specials module just showed 8 (coz 100 would mean a very long scrolling web page) how would they see all 100?

As usual I might be missing something obvious (Q may like to comment here) and there may be a better topic to put this post so mod please move if you feel appropriate!

Thanks

robster

I know my place...!


User avatar
Active Member

Posts

Joined
Tue Jul 13, 2010 8:08 pm
Location - North Yorkshire, UK

Post by mystifier » Thu Sep 09, 2010 9:59 pm

Regarding Special Offers. The sidebox, sensibly, show a resticted set controlled by limit in Admin->Extensions->Modules->Specials. With 100 Special Offers, the sidebox might show 6 examples; clicking on the Special Offers link would show paginated pages (configurable in Admin) of all 100.

The sort order is defined by getProductSpecials() in catalog\model\catalog\product.php

To make random specials appear each time the box is refreshed, you would simply need to replace the existing sort stuff (which seems strangely over-complicated):

Code: Select all

$sort_data = array(
	'pd.name',
	'p.sort_order',
	'special',
	'rating',
	'p.price',
	'p.model'
);
			
if (in_array($sort, $sort_data)) {
	if ($sort == 'pd.name' || $sort == 'p.model') {
		$sql .= " ORDER BY LCASE(" . $sort . ")";
	} else {
		$sql .= " ORDER BY " . $sort;
	}
} else {
	$sql .= " ORDER BY p.sort_order";	
}
		
if ($order == 'DESC') {
	$sql .= " DESC";
} else {
	$sql .= " ASC";
}
With:

Code: Select all

$sql .= " ORDER BY Rand()";
Similar would apply to any module, such as Featured. Simply change the sort order to Rand() in the underlying query.

(SELECT * FROM Table ORDER BY Rand() LIMIT 6 would show 6 random records from Table)

Free v1.4.9 Extensions: Default Specials | Improved Search | Customer Activity Report | Customer Groups | Royal Mail With Handling | Improved Product Page | Random Products | Stock Report | All Products


User avatar
Active Member

Posts

Joined
Tue May 18, 2010 5:15 pm

Post by robster » Thu Sep 09, 2010 11:42 pm

Hi and thanks for the reply.

Everything is understood, except I maybe missing something here again lol but:
clicking on the Special Offers link would show paginated pages (configurable in Admin) of all 100
I can't see any clickable link!!

robster
Last edited by robster on Fri Sep 10, 2010 12:26 am, edited 1 time in total.

I know my place...!


User avatar
Active Member

Posts

Joined
Tue Jul 13, 2010 8:08 pm
Location - North Yorkshire, UK

Post by robster » Fri Sep 10, 2010 12:26 am

Ahhhh forget that last post - I see the link at the top of the page. Doh!!

How would I see ALL Featured products - this is my main desire... (well not my main desire.... but you know what I mean :))

robster

I know my place...!


User avatar
Active Member

Posts

Joined
Tue Jul 13, 2010 8:08 pm
Location - North Yorkshire, UK

Post by mystifier » Fri Sep 10, 2010 1:02 am

I have a free Extension (in Extensions at the top of this page) to show ALL Products which adds a similar link to Special Offers (which should be in the core ;) ).

Free v1.4.9 Extensions: Default Specials | Improved Search | Customer Activity Report | Customer Groups | Royal Mail With Handling | Improved Product Page | Random Products | Stock Report | All Products


User avatar
Active Member

Posts

Joined
Tue May 18, 2010 5:15 pm

Post by Qphoria » Fri Sep 10, 2010 1:36 am

agreed

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by robster » Fri Sep 10, 2010 1:50 am

Q, i like your 'Featured Side Box' module and have gotten that from your store - and pretty much everything else too :P

How would I show ALL Featured Products and not be restricted to those 8 or whatever set to show in featured box?

robster

I know my place...!


User avatar
Active Member

Posts

Joined
Tue Jul 13, 2010 8:08 pm
Location - North Yorkshire, UK
Who is online

Users browsing this forum: No registered users and 330 guests