Jump to content

Additional Images on product


Debyink

Recommended Posts

Setting up my new V6 store (been with CC since V3 old stores still running on V4) and just doing some final tweaks before I fully upload all my products.

A couple of products will have multiple product options, I've uploaded my images and in their respective image folder they are in alphabetical order, I've added my main image to the product and then added the other included images to the product. No matter how I try to add them (tried adding 1 by 1 and clearing cache each time) the images won't stay in alphabetical order. Is there a way to keep image carousel in alphabetical order.  https://shop.inkylicious.co.uk/versafine-clair-ink-pad-set-of-6

 

 

Link to comment
Share on other sites

Fetching the collection of images for the gallery (image carousel) is not straightforward, and has little opportunity to maintain any sort of order.

You will need to make an edit to the core code to try this experiment:

In /classes/catalogue.class.php, near line 2075, find:

private function _productGallery($product_id = false)

About 13 lines later, find:

if (($gallery = $GLOBALS['db']->select('`'.$GLOBALS['config']->get('config', 'dbprefix').'CubeCart_image_index` AS `i` INNER JOIN `'.$GLOBALS['config']->get('config', 'dbprefix').'CubeCart_filemanager` AS `f` ON i.file_id = f.file_id', false, 'i.product_id = '.$product_id, 'ORDER BY i.main_img DESC'))) {

Near the end of that statement is:

'ORDER BY i.main_img DESC'

Change that to:

'ORDER BY i.main_img DESC, f.filename ASC'

It is important to keep the main image at the top of the result set, but all images that are not the main image are now sorted by their filename. Hopefully.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...