Перейти до вмісту
Пошук в
  • Детальніше...
Шукати результати, які ...
Шукати результати в ...

Karenchiks

Новачок
  
  • Публікації

    3
  • З нами

  • Відвідування

Відвідувачі профілю

Блок відвідувачів профілю відключений і не буде доступний широкому іншим користувачам

Karenchiks's Achievements

Newbie

Newbie (1/14)

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

Recent Badges

1

Репутація

  1. никак не могу найти в чем причина ошибки Parse error: syntax error, unexpected 'protected' (T_PROTECTED) in /home/user/site.ru/docs/catalog/controller/extension/feed/yandex_sitemap.php on line 66 <?php class ControllerExtensionFeedYandexSitemap extends Controller { public function index() { if ($this->config->get('yandex_sitemap_status')) { $output = '<?xml version="1.0" encoding="UTF-8"?>'; $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'; $this->load->model('catalog/product'); $this->load->model('tool/image'); $products = $this->model_catalog_product->getProducts(); foreach ($products as $product) { $output .= '<url>'; $output .= '<loc>' . $this->url->link('product/product', 'product_id=' . $product['product_id']) . '</loc>'; $output .= '<changefreq>weekly</changefreq>'; $output .= '<priority>1.0</priority>'; $output .= '</url>'; } $this->load->model('catalog/category'); $output .= $this->getCategories(0); $this->load->model('catalog/manufacturer'); $manufacturers = $this->model_catalog_manufacturer->getManufacturers(); foreach ($manufacturers as $manufacturer) { $output .= '<url>'; $output .= '<loc>' . $this->url->link('product/manufacturer/info', 'manufacturer_id=' . $manufacturer['manufacturer_id']) . '</loc>'; $output .= '<changefreq>weekly</changefreq>'; $output .= '<priority>0.7</priority>'; $output .= '</url>'; $products = $this->model_catalog_product->getProducts(array('filter_manufacturer_id' => $manufacturer['manufacturer_id'])); //foreach ($products as $product) { //$output .= '<url>'; //$output .= '<loc>' . $this->url->link('product/product', 'manufacturer_id=' . $manufacturer['manufacturer_id'] . '&product_id=' . $product['product_id']) . '</loc>'; //$output .= '<changefreq>weekly</changefreq>'; //$output .= '<priority>1.0</priority>'; //$output .= '</url>'; } } $this->load->model('catalog/information'); $informations = $this->model_catalog_information->getInformations(); foreach ($informations as $information) { $output .= '<url>'; $output .= '<loc>' . $this->url->link('information/information', 'information_id=' . $information['information_id']) . '</loc>'; $output .= '<changefreq>weekly</changefreq>'; $output .= '<priority>0.5</priority>'; $output .= '</url>'; } $output .= '</urlset>'; $this->response->addHeader('Content-Type: application/xml'); $this->response->setOutput($output); } } protected function getCategories($parent_id, $current_path = '') { $output = ''; $results = $this->model_catalog_category->getCategories($parent_id); foreach ($results as $result) { if (!$current_path) { $new_path = $result['category_id']; } else { $new_path = $current_path . '_' . $result['category_id']; } $output .= '<url>'; $output .= '<loc>' . $this->url->link('product/category', 'path=' . $new_path) . '</loc>'; $output .= '<changefreq>weekly</changefreq>'; $output .= '<priority>0.7</priority>'; $output .= '</url>'; $products = $this->model_catalog_product->getProducts(array('filter_category_id' => $result['category_id'])); //foreach ($products as $product) { //$output .= '<url>'; //$output .= '<loc>' . $this->url->link('product/product', 'path=' . $new_path . '&product_id=' . $product['product_id']) . '</loc>'; //$output .= '<changefreq>weekly</changefreq>'; //$output .= '<priority>1.0</priority>'; //$output .= '</url>'; } $output .= $this->getCategories($result['category_id'], $new_path); } return $output; } }
  2. в журнале ошибок такая строка 2019-08-26 16:45:03 - PHP Warning: Division by zero in /home/test/sartest.ru/docs/catalog/controller/extension/module/filter_products.php on line 553 вот строка где ошибка $json['results'] = sprintf($this->language->get('text_pagination'), ($product_total) ? (($page - 1) * $limit) + 1 : 0, ((($page - 1) * $limit) > ($product_total - $limit)) ? $product_total : ((($page - 1) * $limit) + $limit), $product_total, ceil($product_total / $limit));

×
×
  • Створити...

Important Information

На нашому сайті використовуються файли cookie і відбувається обробка деяких персональних даних користувачів, щоб поліпшити користувальницький інтерфейс. Щоб дізнатися для чого і які персональні дані ми обробляємо перейдіть за посиланням . Якщо Ви натиснете «Я даю згоду», це означає, що Ви розумієте і приймаєте всі умови, зазначені в цьому Повідомленні про конфіденційність.