Post by shamshair » Mon Mar 12, 2012 4:03 pm

*****************Thanks A Lot For this great sharing*********************

Newbie

Posts

Joined
Fri Dec 23, 2011 3:12 am

Post by 3antz » Sat Mar 24, 2012 12:07 pm

Hi Q, thanks for the free mod. Is there a way to only show products which are available in stock?

Active Member

Posts

Joined
Sun Oct 02, 2011 6:52 pm

Post by Klimskady » Mon Apr 16, 2012 6:19 am

Thanks for this Q!.

Active Member

Posts

Joined
Tue Jun 07, 2011 7:57 am

Post by Pr3W » Wed Dec 12, 2012 8:15 am

3antz wrote:Hi Q, thanks for the free mod. Is there a way to only show products which are available in stock?
I have the same doubt.

Mauro G. Jr


User avatar
Newbie

Posts

Joined
Wed Dec 12, 2012 8:06 am
Location - Brasil

Post by jty » Sun Dec 23, 2012 9:20 am

3antz wrote:Hi Q, thanks for the free mod. Is there a way to only show products which are available in stock?
in stock is controlled by the field p.quantity
so, to only show products in stock we need to add p.quantity > 0 somewhere
to do it without touching the getProduct function in model (because it's use elsewhere for other purposes, I added p.quantity > 0 into the latest.php controller file like this. Look for the words "here" in the following code.

Code: Select all

$results = $this->model_catalog_product->getProducts($data);
		// randomise latest - from
		// http://forum.opencart.com/viewtopic.php?f=131&t=32570&start=20
		srand((float)microtime() * 1000000);
		shuffle($results); 
		$results = array_slice($results, 0, $setting['limit']);
		//
		
		foreach ($results as $result) {
		  // here
		  if ($result['quantity'] > 0) {
		  // end here
			if ($result['image']) {
				$image = $this->model_tool_image->resize($result['image'], $setting['image_width'], $setting['image_height']);
			} else {
				$image = false;
			}
						
			// blaa blaa blaa code deleted
			
			$this->data['products'][] = array(
				'product_id' => $result['product_id'],
				// blaa blaa blaa code deleted
				'href'    	 => $this->url->link('product/product', 'product_id=' . $result['product_id']),
			);
		  // here
		 }
		  // end here
		}

		if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/latest.tpl')) {
		// blaa blaa blaa code deleted

jty
Active Member

Posts

Joined
Sat Aug 30, 2008 8:19 am

Post by xtr3mx7 » Thu Dec 27, 2012 11:43 pm

thanks for the share Q, works perfectly on 1.5.4 :)

New member

Posts

Joined
Mon Jul 13, 2009 1:02 am

Post by HASHR » Sun Feb 17, 2013 3:51 am

This worked perfectly for us! We appreciate it.
Cheers,
HASHR

Dropbox | http://my.cur.lv/dropbox
GoDaddy | 20% off with WOWBITCOIN code
Earn BTC | https://coinurl.com/index.php?ref=socialsales


User avatar
Newbie

Posts

Joined
Sun Feb 17, 2013 3:37 am


Post by scot » Wed Apr 10, 2013 12:37 am

AWESOME! "Latest" Works on 1.5.5.1 Thank You!

Newbie

Posts

Joined
Sat Jan 21, 2012 4:13 am

Post by labeshops » Thu May 02, 2013 12:12 am

exactly what I needed for my specials! Works perfectly! Thanks.

Running Opencart v3.0.3.2 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA

Post by qixbix » Fri Jul 19, 2013 8:06 pm

perfect - thankkss :)

Newbie

Posts

Joined
Fri Jul 05, 2013 7:52 pm

Post by bobmartinusa » Mon Jul 22, 2013 9:54 pm

Qphoria wrote:Created vqmods for random latest, featured, bestsellers, and specials using the new no-strain method

What does "no-strain" mean?
Normally items are randomized by using the "rand()" mysql command. The problem with this is that the more products you have, the more items that must be randomized on the database. If you have a lot of products, it puts a large strain on the database having to randomize them all first, then only grabbing 10 of them.

So this mod uses a better method. It will pull more than the limit set and randomize them with php which is much faster and less intensive. Then return only the limit requested. Removing strain from the database.
One of the best mods for opencart and in my opinion it has to be added to the core files of opencart.

I installed in 1.5.5.1 and it works like a breeze

method of installing :

1) Download the file that you want ( I installed all)
2) just copy and paste in the xml folder of your vqmod in site installation directory.

Done...............Enjoy

New member

Posts

Joined
Sat Mar 16, 2013 5:39 pm

Post by therugworld » Sun Sep 01, 2013 12:39 am

This module works great - 1.5.3 - randomly shows products in the module out of the chosen products in the back end module settings.

http://www.TheRugWorld.co.uk - Rugs, Carpet, Vinyl & Laminates! FREE UK Delivery - Worldwide Shipping!


New member

Posts

Joined
Sat Mar 10, 2012 1:12 am
Location - London

Post by teknology3d » Tue Nov 12, 2013 8:43 am

Works great! Thanks!

New member

Posts

Joined
Tue Nov 16, 2010 8:33 am

Post by matte2k » Mon Nov 18, 2013 3:54 am

Using 1.5.5.1 All work great but I think "home", were I have both bestseller, feature and specials module, load a couple of seconds slower now then before!

Should it be like that?

Active Member

Posts

Joined
Thu Mar 01, 2012 7:07 pm

Post by stokeyblokey » Wed Nov 27, 2013 7:59 am

I have not noticed any difference on my site with just the Specials randomized matte2k...

Thanks Qphoria for a great little bit of code, working flawlessly in OC1.5.6 with the additional stock check added in ;D

Stokey

Stokey


User avatar
Active Member

Posts

Joined
Sat Aug 31, 2013 10:19 pm

Post by MaviATES » Sun Jan 05, 2014 6:05 am

Qphoria wrote:Created vqmods for random latest, featured, bestsellers, and specials using the new no-strain method

What does "no-strain" mean?
Normally items are randomized by using the "rand()" mysql command. The problem with this is that the more products you have, the more items that must be randomized on the database. If you have a lot of products, it puts a large strain on the database having to randomize them all first, then only grabbing 10 of them.

So this mod uses a better method. It will pull more than the limit set and randomize them with php which is much faster and less intensive. Then return only the limit requested. Removing strain from the database.
Thanks a lot it works v1.5.6 :)

Newbie

Posts

Joined
Fri Aug 09, 2013 3:56 am

Post by stokeyblokey » Wed Mar 26, 2014 6:57 pm

Can Qphoria or anyone tell me how to include the stock check (like the code provided by jty) into the Featured products module?

I have tried but get undefined index errors and no products show up in the front-end of the store, just the empty Featured box...

I suspect this will involve a bit more coding than I am capable of!

Cheers,

Stokey

Stokey


User avatar
Active Member

Posts

Joined
Sat Aug 31, 2013 10:19 pm

Post by Goncharenko » Fri Jun 27, 2014 4:20 pm

Can anyone confirm this works with the latest version?

New member

Posts

Joined
Sun Mar 18, 2012 9:21 am

Post by Qphoria » Mon Jun 30, 2014 9:17 pm

Goncharenko wrote:Can anyone confirm this works with the latest version?
It does

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by applesmiles » Sat Aug 02, 2014 1:20 pm

works perfectly for 1.5.4 thanks :-*

Newbie

Posts

Joined
Mon May 20, 2013 5:45 pm
Who is online

Users browsing this forum: No registered users and 39 guests