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

Karenchiks

Newbie
  
  • Posts

    3
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Karenchiks's Achievements

Newbie

Newbie (1/14)

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

Recent Badges

1

Reputation

  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));
×
×
  • 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.