Jump to content

Featured products


Recommended Posts

 

hello guys
I'm just chart using this fantastic program
I noticed a lack
for the precision in the showcase initial
"I use the default theme"
I always show the same products
I would like if possible
run products to display
I use version 1.5.6.2.
how can I fix it?

sorry for my english.

thanks

Link to comment
Share on other sites

Locate this in homefeatured.php

 

HomeFeatured::$cache_products = $category->getProducts((int)Context::getContext()->language->id, 1, ($nb ? $nb : 8), 'position');

 

change it to

 

 

HomeFeatured::$cache_products = $category->getProducts((int)Context::getContext()->language->id, 1, ($nb ? $nb : 8), 'position', false, true, true);

 

 

then refresh your cache

Link to comment
Share on other sites

I love the idea of being able to do this as well. I would have one more idea to add to it. What if you could have it display random items that are on sale only? Would that be possible? I have looked to see if there was a module for that but did not see one.

Link to comment
Share on other sites

I am trying to figure out where to put the 'AND'  but I have to admit, I am very lost when looking at this code. I'm not familiar with the syntax used in the string. What does the '1' mean? I am trying to look up the -> function but can't find it in any of my PHP books. They are a couple of years old and this all changes so fast I should just throw them away I guess. Can someone please explain how this string works and what it all means? Or at least where I can buy a book that has this stuff in it?

 

Thanks

Bill

Link to comment
Share on other sites

This is simply mySQL, I don't recommend messing with it without proper knowledge. But in any case, it must be put after the WHERE clause, like

 

WHERE something = whaterver

AND on_sale = 1

 

It means the on_sale column in the database must be equal to 1

Link to comment
Share on other sites

Sorry, I guess I was a little vague with my reply. I understand PHP and MySQL but I'm a couple of years out of date on the newer stuff.

 

There is no where clause in this DB call that I can see. The 1 I was referring to was in the line below. I get the on_sale=1 part. However, that does not work if I'm using a catalog rule for pricing, does it?

 

HomeFeatured::$cache_products = $category->getProducts((int)Context::getContext()->language->id, 1, ($nb ? $nb : 8), 'position', false, true, true);

 

I am new to Prestashop and I'm trying to learn the ways things are done within this code. Like I said my books are from 2008 and NONE if this looks anything what is in there. I figured is someone could break down what all this means it would help me understand better what is going on with this line and the rest of Prestashop too. Sort of a "Teach a man to fish, feed him for life" kind of thing.

 

Thanks for your replies. I really do appreciate it. Please enjoy your vacation though. All this can wait.

 

Bill

Link to comment
Share on other sites

  • 2 weeks later...
×
×
  • Create New...