deech123 Posted August 29, 2010 Share Posted August 29, 2010 Hi guys,Is there anybody who managed to show all your promotions (that you can see in promotions/aanbiedingen) to be shown on the first page?On my site I show features products, but I want to show also my promotion articles, this is why people come to my site :-)any idea how I can add an extra module like feature products but with my promotions or how I can change the feature product query into the promotion query?thanks in advance for any tip or link.Deech Link to comment Share on other sites More sharing options...
rocky Posted August 29, 2010 Share Posted August 29, 2010 Try this module. Link to comment Share on other sites More sharing options...
deech123 Posted August 29, 2010 Author Share Posted August 29, 2010 Thanks Rocky,that's exactly what I need :-) Link to comment Share on other sites More sharing options...
rocky Posted August 29, 2010 Share Posted August 29, 2010 If your issue is resolved, please edit your first post and add [sOLVED] to the front of the title. Link to comment Share on other sites More sharing options...
deech123 Posted August 30, 2010 Author Share Posted August 30, 2010 Rocky I will, but can you just give me one tip?in his query I want to show the random records.this is his line : $products = Product::getPricesDrop(intval($cookie->id_lang), 0, $nb); $products = Product::getPricesDrop(intval($cookie->id_lang), intval($p) - 0, (intval($nb ? $nb : 4)), false, $orderBy, $orderWay); any idea, everything I change result in hack attempt Link to comment Share on other sites More sharing options...
rocky Posted August 30, 2010 Share Posted August 30, 2010 The easiest way is to add the following line after getting the specials: shuffle($products); Link to comment Share on other sites More sharing options...
deech123 Posted August 30, 2010 Author Share Posted August 30, 2010 Hi rockyIf I change the code in to this : $products = Product::getPricesDrop(intval($cookie->id_lang), 0, $nb); $products = Product::getPricesDrop(intval($cookie->id_lang), intval($p) - 0, (intval($nb ? $nb : 4)), false, $orderBy, $orderWay); $products = shuffle($products); then I get a empty box with price 0, no picture?what could be wrong? Link to comment Share on other sites More sharing options...
rocky Posted August 30, 2010 Share Posted August 30, 2010 I've corrected my code above. Try again. Link to comment Share on other sites More sharing options...
deech123 Posted August 30, 2010 Author Share Posted August 30, 2010 rocky this is better but still not good enough :-)when I have 8 products in promotion and show only 4 then the shuffle does it work but does not take the other 4 products in mixed order, only the First 4 and there it shuffled , but still the same 4... the rest not.hope I'm telling this clear enough :-)thx in advance Link to comment Share on other sites More sharing options...
rocky Posted August 31, 2010 Share Posted August 31, 2010 The only solution then it to hack PrestaShop's code, which I don't like to do. You will need to change line 1201 of classes/Product.php from: static public function getPricesDrop($id_lang, $pageNumber = 0, $nbProducts = 10, $count = false, $orderBy = NULL, $orderWay = NULL, $beginning = false, $ending = false, $withDiscount = 0) to: static public function getPricesDrop($id_lang, $pageNumber = 0, $nbProducts = 10, $count = false, $orderBy = NULL, $orderWay = NULL, $beginning = false, $ending = false, $withDiscount = 0, $random = false) and change line 1258 from: ORDER BY '.(isset($orderByPrefix) ? pSQL($orderByPrefix).'.' : '').'`'.pSQL($orderBy).'`'.' '.pSQL($orderWay).' to: ORDER BY '.($random ? 'RAND()' : ((isset($orderByPrefix) ? pSQL($orderByPrefix).'.' : '').'`'.pSQL($orderBy).'`'.' '.pSQL($orderWay))).' then change the module's code from: $products = Product::getPricesDrop(intval($cookie->id_lang), intval($p) - 0, (intval($nb ? $nb : 4)), false, $orderBy, $orderWay); to: $products = Product::getPricesDrop(intval($cookie->id_lang), intval($p) - 0, (intval($nb ? $nb : 4)), false, $orderBy, $orderWay, false, false, 0, true); 3 Link to comment Share on other sites More sharing options...
deech123 Posted August 31, 2010 Author Share Posted August 31, 2010 works like a charm.I also did a change for the prices without reduction in percentage and there was an error when clients see the prices without tva then the old price was still price with tva, so I changed it :-)thanks for you rocking help :-) Link to comment Share on other sites More sharing options...
Irminsul Posted September 20, 2011 Share Posted September 20, 2011 Hello I am searching for a similar solution, as module mentioned above. But since it's no longer available - is there any other module, which works in similar way? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now