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

Порядок отображения фотографий в админке (в товаре) и порядок отображения артикулов в фроненде блока custom section (тема journal 2)


mine
 Share

Recommended Posts

Добрый день!

 

Есть 2 вопроса, вдруг кто сталкивался:

 

1. При добавлении товара в админке - выбираем изображение... и как здесь реализовать, чтобы изображения в папке были отсортированы по дате или по имени в обратном порядке?

 

2. Есть в теме Journal2 блок custom section (отображает продукты из категорий и при клике "по табам" (см. вложенные) - подгружает товары из категорий. Как настроить в этом блоке выборку артикулов по дате?

 

В категориях нашел где менять, а здесь никак, может знает кто?

Заранее спасибо.

journal2_custom_sections.php

custom_sections_category.twig

custome-section_preview.jpg

Link to comment
Share on other sites


  • 2 weeks later...

Из рубрики сам шучу и сам смеюсь. По второй части вопроса (про custom section)

 

в сatalog/model/journal2/product.php

 

     public function getProductsByCategory($category_id, $limit = 5) {
        return $this->model_catalog_product->getProducts(array(
            'filter_category_id' => $category_id,
            'start' => 0,
            'limit' => $limit
        ));
    }

 

добавляем

            'sort'  => 'p.date_added',
            'order' => 'DESC',

 

    public function getProductsByCategory($category_id, $limit = 5) {
        return $this->model_catalog_product->getProducts(array(
            'sort'  => 'p.date_added',
            'order' => 'DESC',
            'filter_category_id' => $category_id,
            'start' => 0,
            'limit' => $limit
        ));
    }

 

Edited by mine
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.