My XML Sitemap when i try to submit on google seach console i got error Invalid tag value: <lastmod> below is my sitemap link Version 3.0.3.8 need urgently help
https://www.gatesautomatic.com/sitemap.xml
worldi2002 wrote: ↑Wed Apr 16, 2025 6:08 pmHello Everyone here
My XML Sitemap when i try to submit on google seach console i got error Invalid tag value: <lastmod> below is my sitemap link Version 3.0.3.8 need urgently help
https://www.gatesautomatic.com/sitemap.xml
Code: Select all
<lastmod>-0001-11-30T00:00:00+03:41</lastmod>
Code: Select all
<lastmod>2024-11-15T12:23:00+00:00</lastmod>
Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig
class ControllerInformationSitemap extends Controller {
public function index() {
$this->load->language('information/sitemap');
$this->document->setTitle($this->language->get('heading_title'));
$data['breadcrumbs'] = array();
$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_home'),
'href' => $this->url->link('common/home')
);
$data['breadcrumbs'][] = array(
'text' => $this->language->get('heading_title'),
'href' => $this->url->link('information/sitemap')
);
$this->load->model('catalog/category');
$data['categories'] = array();
$categories_1 = $this->model_catalog_category->getCategories(0);
foreach ($categories_1 as $category_1) {
$level_2_data = array();
$categories_2 = $this->model_catalog_category->getCategories($category_1['category_id']);
foreach ($categories_2 as $category_2) {
$level_3_data = array();
$categories_3 = $this->model_catalog_category->getCategories($category_2['category_id']);
foreach ($categories_3 as $category_3) {
$level_3_data[] = array(
'name' => $category_3['name'],
'href' => $this->url->link('product/category', 'path=' . $category_1['category_id'] . '_' . $category_2['category_id'] . '_' . $category_3['category_id'])
);
}
$level_2_data[] = array(
'name' => $category_2['name'],
'children' => $level_3_data,
'href' => $this->url->link('product/category', 'path=' . $category_1['category_id'] . '_' . $category_2['category_id'])
);
}
$data['categories'][] = array(
'name' => $category_1['name'],
'children' => $level_2_data,
'href' => $this->url->link('product/category', 'path=' . $category_1['category_id'])
);
}
$data['special'] = $this->url->link('product/special');
$data['account'] = $this->url->link('account/account', '', true);
$data['edit'] = $this->url->link('account/edit', '', true);
$data['password'] = $this->url->link('account/password', '', true);
$data['address'] = $this->url->link('account/address', '', true);
$data['history'] = $this->url->link('account/order', '', true);
$data['download'] = $this->url->link('account/download', '', true);
$data['cart'] = $this->url->link('checkout/cart');
$data['checkout'] = $this->url->link('checkout/checkout', '', true);
$data['search'] = $this->url->link('product/search');
$data['contact'] = $this->url->link('information/contact');
$this->load->model('catalog/information');
$data['informations'] = array();
foreach ($this->model_catalog_information->getInformations() as $result) {
$data['informations'][] = array(
'title' => $result['title'],
'href' => $this->url->link('information/information', 'information_id=' . $result['information_id'])
);
}
$data['column_left'] = $this->load->controller('common/column_left');
$data['column_right'] = $this->load->controller('common/column_right');
$data['content_top'] = $this->load->controller('common/content_top');
$data['content_bottom'] = $this->load->controller('common/content_bottom');
$data['footer'] = $this->load->controller('common/footer');
$data['header'] = $this->load->controller('common/header');
$this->response->setOutput($this->load->view('information/sitemap', $data));
}
}
above is sitemap file can you check all is ok or anyone i will give admin access to correct it for me please
Hi can i give you my admin access can you fix this issue for me pleaseworldi2002 wrote: ↑Wed Apr 16, 2025 6:08 pmHello Everyone here
My XML Sitemap when i try to submit on google seach console i got error Invalid tag value: <lastmod> below is my sitemap link Version 3.0.3.8 need urgently help
https://www.gatesautomatic.com/sitemap.xml
can i give you admin access can you fix this problem for me pleaseJNeuhoff wrote: ↑Wed Apr 16, 2025 7:37 pmIt should be something like this:
Check that this file isn't modified or corrupted: catalog/controller/information/sitemap.phpCode: Select all
<lastmod>2024-11-15T12:23:00+00:00</lastmod>
Hello sir waiting for your replyJNeuhoff wrote: ↑Wed Apr 16, 2025 7:37 pmIt should be something like this:
Check that this file isn't modified or corrupted: catalog/controller/information/sitemap.phpCode: Select all
<lastmod>2024-11-15T12:23:00+00:00</lastmod>
Check your private messages
That is the wrong sitemap - that produces a human friendly one
catalog/controller/extension/feed/google_sitemap.php
Code: Select all
<?php
class ControllerExtensionFeedGoogleSitemap extends Controller {
public function index() {
if ($this->config->get('feed_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 .= ' <lastmod>' . date('Y-m-d\TH:i:sP', strtotime($product['date_modified'])) . '</lastmod>';
$output .= ' <priority>1.0</priority>';
if ($product['image']) {
$output .= ' <image:image>';
$output .= ' <image:loc>' . $this->model_tool_image->resize($product['image'], $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_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>';
}
$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) {
$output = '';
$results = $this->model_catalog_category->getCategories($parent_id);
foreach ($results as $result) {
$output .= '<url>';
$output .= ' <loc>' . $this->url->link('product/category', 'path=' . $result['category_id']) . '</loc>';
$output .= ' <changefreq>weekly</changefreq>';
$output .= ' <priority>0.7</priority>';
$output .= '</url>';
$output .= $this->getCategories($result['category_id']);
}
return $output;
}
}
Attachments
OC 3.0.3.8 : catalog/controller/extension/feed/google_sitemap.php
DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.
https://www.youtube.com/watch?v=zXIxDoCRc84
Check your database and time zones both in Opencart Settings and in the database - possibly your database became corrupted?
DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.
https://www.youtube.com/watch?v=zXIxDoCRc84
Code: Select all
<lastmod>' . date('c', strtotime($product['date_modified'])) . '</lastmod>
Code: Select all
foreach ($products as $product) {
$output .= '<url>';
$output .= '<loc>' . $this->url->link('product/product', 'product_id=' . $product['product_id']) . '</loc>';
$output .= '<lastmod>' . date('c', strtotime($product['date_modified'])) . '</lastmod>';
$output .= '<changefreq>weekly</changefreq>';
$output .= '<priority>1.0</priority>';
$output .= '</url>';
}
Got an urgent question that’s keeping you up at night? There might just be a magical inbox ready to help: khnaz35@gmail.com
Enjoy nature
Not yet still the same i need urgent helf someone i will give them access they will do it directlykhnaz35 wrote: ↑Thu Apr 17, 2025 12:20 amYou could do something like thisfor exampleCode: Select all
<lastmod>' . date('c', strtotime($product['date_modified'])) . '</lastmod>
Code: Select all
foreach ($products as $product) { $output .= '<url>'; $output .= '<loc>' . $this->url->link('product/product', 'product_id=' . $product['product_id']) . '</loc>'; $output .= '<lastmod>' . date('c', strtotime($product['date_modified'])) . '</lastmod>'; $output .= '<changefreq>weekly</changefreq>'; $output .= '<priority>1.0</priority>'; $output .= '</url>'; }
I need someone to do it for me direclty i dont understand it.by mona wrote: ↑Wed Apr 16, 2025 10:47 pmHas anyone come back to you?
Check your private messages
That is the wrong sitemap - that produces a human friendly one
catalog/controller/extension/feed/google_sitemap.php
Code: Select all
<?php class ControllerExtensionFeedGoogleSitemap extends Controller { public function index() { if ($this->config->get('feed_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 .= ' <lastmod>' . date('Y-m-d\TH:i:sP', strtotime($product['date_modified'])) . '</lastmod>'; $output .= ' <priority>1.0</priority>'; if ($product['image']) { $output .= ' <image:image>'; $output .= ' <image:loc>' . $this->model_tool_image->resize($product['image'], $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_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>'; } $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) { $output = ''; $results = $this->model_catalog_category->getCategories($parent_id); foreach ($results as $result) { $output .= '<url>'; $output .= ' <loc>' . $this->url->link('product/category', 'path=' . $result['category_id']) . '</loc>'; $output .= ' <changefreq>weekly</changefreq>'; $output .= ' <priority>0.7</priority>'; $output .= '</url>'; $output .= $this->getCategories($result['category_id']); } return $output; } }
catalog/controller/extension/feed/google_sitemap.php
is the same as the original file (as per download above and post) at the location
catalog/controller/extension/feed/google_sitemap.php
Your theme or SEO module may change it so again
you can go to the file
LOCATION OF MODIFICATION FOLDER => modifications/catalog/controller/extension/feed/google_sitemap.php
and check that it has not been edited.
Ftp details would be required for a developer to check
Since it is possible the issue is in your database
Database access would also be required.
Again you can check if that is correct by going to your database and checking the product table in the column DATE_MODIFIED
You can also post in the commercial section viewforum.php?f=88
DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.
https://www.youtube.com/watch?v=zXIxDoCRc84
Got an urgent question that’s keeping you up at night? There might just be a magical inbox ready to help: khnaz35@gmail.com
Enjoy nature
If you try to fail, but end up succeeding, which did you actually do?khnaz35 wrote: ↑Thu Apr 17, 2025 4:18 pmGot an urgent question that’s keeping you up at night? There might just be a magical inbox ready to help: khnaz35@gmail.com
Enjoy nature![]()
![]()
![]()
UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk
Users browsing this forum: Amazon [Bot], Google [Bot], maffe, Semrush [Bot] and 51 guests