Author Topic: Default image sort order in products and sorting images  (Read 4464 times)

Offline webdevmerc

  • Full Member
  • ***
  • Posts: 172
  • Karma: +32/-1
    • View Profile
Default image sort order in products and sorting images
« on: May 08, 2015, 09:39:44 AM »
Did the recent upgrade remove the option to sort images in the product media tab?  I remember being able to do that in maybe version 1.1.8, but didn't see where to do it in 1.2.1.

Also, I was trying to figure out where the default sort order of images occurs in the DB and it seems to be based on the database entry in the resource_map table and when the row is initially added.  However, changing the sort entry in that table only changes the image order in the Media tab in the admin tool, but on a product and overall page, it still shows the old order.

I can unlink and relink the image and that works, but would take too long to process hundreds of images.

Does anyone have any pointers as to where to look?  I thought the image order was based on filename originally, but that doesn't seem to be the case.

Sorry if this has been asked before, I but I searched and didn't see anything and old topics show the old method working.

Offline webdevmerc

  • Full Member
  • ***
  • Posts: 172
  • Karma: +32/-1
    • View Profile
Re: Default image sort order in products and sorting images
« Reply #1 on: May 08, 2015, 12:30:05 PM »
Ok, I found where I can change it as I was not clicking on the product "title" tab where I can put a sort number to display them in a certain order.

Does anyone know where this is stored in the DB?  I can change the number manually in resource_map, but it doesn't seem to update the picture in the product and overall store page.

Thanks for your time and ideas.

Offline llegrand

  • Hero Member
  • *****
  • Posts: 1798
  • Karma: +520/-7
    • View Profile
Re: Default image sort order in products and sorting images
« Reply #2 on: May 08, 2015, 01:51:30 PM »
You are in the right place to do it manually I believe.   Have you tried clearing in the cache within system > cache?
and also your web browser.  The cart has a robust caching system that works well for the customers, but a bit of a hindrance when developing or changing.

Lee

Offline webdevmerc

  • Full Member
  • ***
  • Posts: 172
  • Karma: +32/-1
    • View Profile
Re: Default image sort order in products and sorting images
« Reply #3 on: May 08, 2015, 02:07:21 PM »
Yes, I've tried clearing the cache in both the system and browser...

From looking at the database and the resource_description and other tables, it seems to sort the images by when that entry is added into the database so if one picture is imported before another (I don't know how it gets the order), then your pictures will show up in a random order.


That said, a work around that may help everyone else here is that you can specify the "sort" order before you do your product data import so if you just specify in your import spreadsheet for field:

"resource_map[1].sort_order" (and any other image you might have)

as the order you want, then you can control what it does and the image order without having to manually click on hundreds of items to remap them all.

As you may have thousands of images, this can save you tons of time if you ever had to rebuild your site from scratch or if you are loading and deleting things during development and testing...


 

Powered by SMFPacks Social Login Mod