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

gre4aniy

Newbie
  
  • Posts

    2
  • Joined

  • Last visited

gre4aniy's Achievements

Newbie

Newbie (1/14)

  • First Post
  • Conversation Starter
  • Week One Done
  • One Month Later
  • One Year In

Recent Badges

1

Reputation

  1. Прошу помощи разобраться в вопросе. Нужно вывести под карточкой товара на странице категории сколько о нем оставлено отзывов. Заранее спасибо
  2. я вывел все товары магазина таким образом: в файл catalog/controller/common/header.php добавил $query = 'SELECT product_id FROM oc_product'; $res = $this->db->query($query); foreach($res->rows as $result){ $data['products'][] = array( 'product_id' => $result['product_id'], ); } а в шаблон шапки catalog/view/theme/default/template/common/header.tpl <?php $total=0; foreach ($products as $product) { $total=$total+1; } echo $total; ?> echo $total выведет все товары из таблицы oc_product, а для того чтобы вывести только активные товары то нужно в запросе к базе сделать условие, например по столбцу status $query = 'SELECT product_id FROM oc_product WHERE status="1"';
Guest
×
  • 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.