Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Настройка вывода доп. фото товара


Recommended Posts

Как сделать автоматическую сортировку вывода доп. изображений товара по имени файла?

 

Т.е. сейчас имеем такие настройки

image.thumb.png.0ea289ca6244699c28d1141933d70a73.png

и такой вывод

image.png.711fca2df3776ae4ad4082dc424c7194.png

Имена фоток такие

Wolf_301053_1.jpg

Wolf_301053_2.jpg

Wolf_301053_3.jpg

 

Я хочу настроить такой вывод фоток товара в карточке

image.png.f063e6b308925234100c8215cdbee00f.png

 

Но без вот таких заморочек с каждым товаром

image.thumb.png.a9dabb22d1708b32b2e901f18c33ca5a.png

 

Можно как-то допилить через код автоматическую сортировку по имени файла если не указан порядок сортировки в админке?

Или хотя бы просто автоматом по имени файла и пофиг на настройки порядка?

Link to comment
Share on other sites


/catalog/model/catalog/product.php

    public function getProductImages($product_id) {
        $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_image WHERE product_id = '" . (int)$product_id . "' ORDER BY sort_order ASC");

 

меняешь sort_order на image и все

Link to comment
Share on other sites

17 hours ago, Stealth421 said:

/catalog/model/catalog/product.php

    public function getProductImages($product_id) {
        $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_image WHERE product_id = '" . (int)$product_id . "' ORDER BY sort_order ASC");

 

меняешь sort_order на image и все

супер, то, что надо! спасибо!

Link to comment
Share on other sites


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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.