Post by mbkilimci » Mon Apr 13, 2015 4:04 am

oc 2.0.2.0
have lot of sitemap errors

parent tag
tag

also google indexed few pages
any solutions ?

http://www.yunusbilgisayar.com/sitemap.xml

Attachments

Unnamed QQ Screenshot20150413040020.jpg

Unnamed QQ Screenshot20150413040020.jpg (118.76 KiB) Viewed 996 times


New member

Posts

Joined
Mon Apr 13, 2015 3:58 am

Post by mRC » Wed Apr 15, 2015 7:10 pm

I think this could be an image issue, check your product image file names, I did have the same issue and it was "&"" in the file name. Also white spaces in the file name like "my image.jpg".

I have seen your main page and have a blank image for product "Yaskawa Servo Drive" try adding images to blank products.

mRC
Active Member

Posts

Joined
Wed Nov 12, 2014 12:43 am

Post by chulcha » Wed Apr 15, 2015 8:17 pm

check in catalog/controller/feed/google_sitemap.php

Code: Select all

			$output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">';


Active Member

Posts

Joined
Fri Jul 18, 2014 4:39 pm

Post by mbkilimci » Fri Apr 17, 2015 8:06 pm

<?php
class ControllerFeedGoogleSitemap extends Controller {
public function index() {
if ($this->config->get('google_sitemap_status')) {
$output = '<?xml version="1.0" encoding="UTF-8"?>';
$output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">';

$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>';
if ($product['image']) {
$output .= '<image:image>';
$output .= '<image:loc>' . $this->model_tool_image->resize($product['image'], $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height')) . '</image:loc>';
$output .= '<image:caption>' . $product['name'] . '</image:caption>';
$output .= '<image:title>' . $product['name'] . '</image:title>';
$output .= '</image:image>';
}
$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;
}
}

New member

Posts

Joined
Mon Apr 13, 2015 3:58 am
Who is online

Users browsing this forum: No registered users and 13 guests