To sort the additional images in the order they are uploaded, complete the following steps:
$pair_data = db_get_hash_array("SELECT pair_id, image_id, detailed_id, type FROM ?:images_links WHERE object_id = ?i AND object_type = ?s", 'pair_id', $object_id, $object_type);
$pair_data = db_get_hash_array("SELECT pair_id, image_id, detailed_id, type FROM ?:images_links WHERE object_id = ?i AND object_type = ?s ORDER BY pair_id", 'pair_id', $object_id, $object_type);
After that the images will be sorted by the pair_id
. The pair_id of every next image equals the pair_id of the previous image + 1, so the images will be sorted in the order they are uploaded.
If you have made changes in a template but they are not displayed, please try clearing the template cache. In order to do it, in the administration panel of your store go to Administration → Storage → Clear cache.
Questions & Feedback
Have any questions that weren't answered here? Need help with solving a problem in your online store? Want to report a bug in our software? Find out how to contact us.