RosesCCRS Posted October 17, 2013 Share Posted October 17, 2013 I have done the following thanks to Pascal who gave me these instructions earlier this year: Q: In Catalog > Products, Is there a way to changing the ID order? For instance, I want the item #12 listed as #2?A: Go to catalog->Products, and select just above the products list on the left the option filter by category. Then select a category for which you want to change the order. Some arrows will appear in the products list on the right (just next to 'action' column)Then drag/click the products, using these arrows, to the desired position.Also check: Preferences->Products: Pagination block: Default order by: Set this to 'Position inside category' I have done this but the products do not move on the home page. Am I missing something? Thanks in advance for your help! Link to comment Share on other sites More sharing options...
PrestaNinja Posted October 17, 2013 Share Posted October 17, 2013 Hello, Then what order are they showing? Could you post (or pm) your store URL? Link to comment Share on other sites More sharing options...
vekia Posted October 17, 2013 Share Posted October 17, 2013 you're talking about home featured products module? 1 Link to comment Share on other sites More sharing options...
RosesCCRS Posted October 17, 2013 Author Share Posted October 17, 2013 Yes. Link to comment Share on other sites More sharing options...
RosesCCRS Posted October 17, 2013 Author Share Posted October 17, 2013 I am using Kinro's Agile Multi Seller modules and will potentially have many, hopefully hundreds of different sellers selling their art. I have one requirement for them and it is that they only put up a couple of items at a time so that one artist does not dominate the entire front page for instance. I do need the ability however to re-sort the front page products in case someone puts too many, etc. Link to comment Share on other sites More sharing options...
PrestaNinja Posted October 17, 2013 Share Posted October 17, 2013 So just to be clear, you want to do that manually? I have done this but the products do not move on the home page You went to category and sort them manually and it didn't work? For all categories or only Home? Link to comment Share on other sites More sharing options...
RosesCCRS Posted October 17, 2013 Author Share Posted October 17, 2013 I want the artists who list to fall into line, latest at the top and so on BUT I do want the ability to re-sort when I need to in the back office. I went to all categories, there is only one called "artist creations" and "home" and re-sorted them but nothing changed on the home page. Link to comment Share on other sites More sharing options...
PrestaNinja Posted October 17, 2013 Share Posted October 17, 2013 First try clearing cache, in advance parameters > performances, clear smarty cache (or check force compilation and save). Did the order change in the "artist creations" category? Link to comment Share on other sites More sharing options...
RosesCCRS Posted October 17, 2013 Author Share Posted October 17, 2013 I answered above but....this topic was just closed: http://www.prestashop.com/forums/topic/269904-solved-featured-products-order/?do=findComment&comment=1420922. Could that alteration code be causing the issue? Link to comment Share on other sites More sharing options...
RosesCCRS Posted October 17, 2013 Author Share Posted October 17, 2013 (edited) PrestaNinja, I have never tried that....is it safe to do? I won't risk losing anything? Thank you so much for your help! Edited October 17, 2013 by ABI International (see edit history) Link to comment Share on other sites More sharing options...
PrestaNinja Posted October 17, 2013 Share Posted October 17, 2013 (edited) Oh you modified the homefeatured.php file... yes it will reverse the order. Add // before this line and save the file and try again // $products = array_reverse($products); Edit: yes it is safe to clear the cache Edited October 17, 2013 by PrestaNinja (see edit history) 2 Link to comment Share on other sites More sharing options...
RosesCCRS Posted October 17, 2013 Author Share Posted October 17, 2013 (edited) I made an error. The code was never added: open homefeatured.php file and change:$products = $category->getProducts((int)Context::getContext()->language->id, 1, ($nb ? $nb : 8));to: $products = $category->getProducts((int)Context::getContext()->language->id, 1, ($nb ? $nb : 8));$products = array_reverse($products);i just added one line: $products = array_reverse($products); I added it with your suggestion, adding the //. So after adding the code above, I was able to move the products around BUT the products are not being added by date created, or latest entry on the top of the list. So I am back to square one. I have my settings in Preferences > Products > Pagination > Product Add Date > and either ascending or descending, nothing changes. It is like that feature is dead. Please help.... Edited October 17, 2013 by ABI International (see edit history) Link to comment Share on other sites More sharing options...
RosesCCRS Posted October 18, 2013 Author Share Posted October 18, 2013 Anyone? Link to comment Share on other sites More sharing options...
PrestaNinja Posted October 18, 2013 Share Posted October 18, 2013 If you order by date, then you won't be able to manually change their position... Put this instead: $products = $category->getProducts((int)Context::getContext()->language->id, 1, ($nb ? $nb : 8), 'date_add', 'DESC'); //$products = array_reverse($products); 1 Link to comment Share on other sites More sharing options...
RosesCCRS Posted October 18, 2013 Author Share Posted October 18, 2013 Thanks PrestaNinja. It did not seem to do anything. I can move the products around in the back office but nothing changes on the front page. I have someone put the code in for me, I am not able. So to clarify, when you said "Put this instead..." Could you clarify instead of what? I appreciate your help very much. Link to comment Share on other sites More sharing options...
vekia Posted October 18, 2013 Share Posted October 18, 2013 hello, by default products are sorted "by position" that you defined in "home" category (catalog > products > filter by category "home") if you open homefeatured.php file, you can find there code: $products = $category->getProducts((int)Context::getContext()->language->id, 1, ($nb ? $nb : 8)); instead of this code use code mentioned above by PrestaNinja 2 Link to comment Share on other sites More sharing options...
RosesCCRS Posted October 19, 2013 Author Share Posted October 19, 2013 My friend is trying to make this work. He said, "There was never a number 8 in the original code. There was a 10 in the code. That's why I'm thinking there's another location with the same file name?" Any thoughts? Link to comment Share on other sites More sharing options...
PrestaNinja Posted October 19, 2013 Share Posted October 19, 2013 My friend is trying to make this work. He said, "There was never a number 8 in the original code. There was a 10 in the code. That's why I'm thinking there's another location with the same file name?" Any thoughts? The number 8 comes from the topic you mentioned (http://www.prestashop.com/forums/topic/269904-solved-featured-products-order/?do=findComment&comment=1420922). But the 8 is not really important, you can put 10 instead. This number is just the default number of products in category if nothing is mentioned in back office. There is only one location for this file, so you can safely make the modification! 1 Link to comment Share on other sites More sharing options...
RosesCCRS Posted October 19, 2013 Author Share Posted October 19, 2013 Ok. Thank you. Sadly, it did not solve the problem. This is what he did: Where you see: $products = $category->getProducts((int)Context::getContext()->language->id, 1, ($nb ? $nb : 8)); Add this instead: $products = $category->getProducts((int)Context::getContext()->language->id, 1, ($nb ? $nb : 8), 'date_add', 'DESC'); //$products = array_reverse($products); Link to comment Share on other sites More sharing options...
PrestaNinja Posted October 19, 2013 Share Posted October 19, 2013 Can you tell me then, what is the order they are showing now...? Link to comment Share on other sites More sharing options...
RosesCCRS Posted October 19, 2013 Author Share Posted October 19, 2013 They are in the order of date added: latest first. I notice that if I set the Preferences >Products: Pagination block: Default order by: Set this to 'Position inside category' and I go to the search by category, the changes I made in re-sorting work. It is just the featured products area where they are not working. Link to comment Share on other sites More sharing options...
RosesCCRS Posted October 19, 2013 Author Share Posted October 19, 2013 Can you suggest any other code? This is a function I need to operate the business properly. Thanks a million for your time and attention. Link to comment Share on other sites More sharing options...
vekia Posted October 19, 2013 Share Posted October 19, 2013 homefeatured block doesn't use order defined in preferences > Products tab in back office. 1 Link to comment Share on other sites More sharing options...
RosesCCRS Posted October 19, 2013 Author Share Posted October 19, 2013 So, does this mean there is nothing I can do? Link to comment Share on other sites More sharing options...
PrestaNinja Posted October 20, 2013 Share Posted October 20, 2013 I'm not sure what you really want to do anymore... If you want to sort them by latest added and still be able to sort them by position, then the code provided by Vekia in the last thread was good. But you just needed to sort them from the end of the list. For example: product1 product2 product3 product4 Will display product4 product3 product2 product1 If for example, you want to put product1 at the second place, then you have to start from the end of the list: order in admin back office: product2 product3 product1 (second position from end of the list) product4 1 Link to comment Share on other sites More sharing options...
RosesCCRS Posted October 20, 2013 Author Share Posted October 20, 2013 (edited) open homefeatured.php file and change: $products = $category->getProducts((int)Context::getContext()->language->id, 1, ($nb ? $nb : 8));to: $products = $category->getProducts((int)Context::getContext()->language->id, 1, ($nb ? $nb : 8)); $products = array_reverse($products); i just added one line: $products = array_reverse($products); Ok, so if we put the above code, the latest added product will be at the top of the list AND I will be able to reposition any of them AND that will be effective on the Featured/Home page? We did this before and it did sort it properly, meaning the latest added was at the top, so that worked BUT it would not reflect any moves I made in the back office. They remained in the order placed. As per your example, I would move #2 to position #4 but the Featured page did not reflect that change. Thank you for your patience with me :-) Edited October 20, 2013 by ABI International (see edit history) Link to comment Share on other sites More sharing options...
RosesCCRS Posted October 21, 2013 Author Share Posted October 21, 2013 (edited) Well I have NO idea what changed but we put in the code above (again) and it now works. It did not work for before and I am baffled. THANKS SO MUCH FOR YOUR HELP! You all are life savers! Edited October 21, 2013 by ABI International (see edit history) Link to comment Share on other sites More sharing options...
PrestaNinja Posted October 21, 2013 Share Posted October 21, 2013 I'm glad that your problem is now solved ! 1 Link to comment Share on other sites More sharing options...
RosesCCRS Posted October 28, 2013 Author Share Posted October 28, 2013 Yippee, thank you! Link to comment Share on other sites More sharing options...
yeblina Posted April 16, 2014 Share Posted April 16, 2014 Hello everybody, I did - product in category order and I have clicked on filter to filter only products on home page, but there are so many that drug and drop is unusefull, it takes forever to go from the product which is in the end ( for example has numb.300) to put it as a firts one by drag and drop...using the arrows - I do not even think about it, it is even worse..does anybody know how to order by myself the products on home page in an easier way?? Thank you very much for your help! Link to comment Share on other sites More sharing options...
Recommended Posts