kunglao Posted June 16, 2014 Share Posted June 16, 2014 hello guysI'm just chart using this fantastic programI noticed a lackfor the precision in the showcase initial"I use the default theme"I always show the same productsI would like if possiblerun products to displayI use version 1.5.6.2.how can I fix it?sorry for my english.thanks Link to comment Share on other sites More sharing options...
NemoPS Posted June 16, 2014 Share Posted June 16, 2014 Do you mean you want to display random products in the featured module? Link to comment Share on other sites More sharing options...
kunglao Posted June 16, 2014 Author Share Posted June 16, 2014 yes in the home pageThere are 20 productsbut I though I would add more than 20the site shows me always the sameif you want to change how I do? Link to comment Share on other sites More sharing options...
NemoPS Posted June 17, 2014 Share Posted June 17, 2014 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 More sharing options...
kunglao Posted June 17, 2014 Author Share Posted June 17, 2014 I followed your instructionsbut the window and 'disappearedthere is no longer any productI restored the original file and re-emergence andhow can I fix it?THANK YOU Link to comment Share on other sites More sharing options...
NemoPS Posted June 18, 2014 Share Posted June 18, 2014 Enable error reporting as described in my signature, apply the change and see what error it gives you, I might have forgotten a comma somewhere Link to comment Share on other sites More sharing options...
kunglao Posted June 18, 2014 Author Share Posted June 18, 2014 (edited) hello,does not appear any errorhowever, the window disappears and appears only a big "?"the center of the default theme. check the attach doc1.doc Edited June 18, 2014 by kunglao (see edit history) Link to comment Share on other sites More sharing options...
kunglao Posted June 19, 2014 Author Share Posted June 19, 2014 you have any other ideas?I can send you my file homefeatured.phpto see if there are problems?thanks Link to comment Share on other sites More sharing options...
NemoPS Posted June 20, 2014 Share Posted June 20, 2014 Can you attach it here? A question mark is definitely not normal Link to comment Share on other sites More sharing options...
kunglao Posted June 21, 2014 Author Share Posted June 21, 2014 view the attachment thanks homefeatured.php Link to comment Share on other sites More sharing options...
dodgebill Posted June 21, 2014 Share Posted June 21, 2014 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 More sharing options...
NemoPS Posted June 24, 2014 Share Posted June 24, 2014 I'll check the php file as soon as I'm back from my vacation As for the other question, to get on sale products you must add AND p.on_sale = 1 To the where clause Link to comment Share on other sites More sharing options...
dodgebill Posted June 24, 2014 Share Posted June 24, 2014 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 More sharing options...
NemoPS Posted June 25, 2014 Share Posted June 25, 2014 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 More sharing options...
dodgebill Posted June 25, 2014 Share Posted June 25, 2014 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 More sharing options...
kunglao Posted July 4, 2014 Author Share Posted July 4, 2014 news? Link to comment Share on other sites More sharing options...
Recommended Posts