Post by pson » Thu Jul 30, 2020 8:00 pm

Hi , this have probably been up several times , but if anyone could explain how I can edit this ?
It would be greatly appreciated :) Thanks
I am using OC Version 3.0.3.2

This is how it looks when generated :

This page contains the following errors:
error on line 1 at column 10834: xmlParseEntityRef: no name
Below is a rendering of the page up to the first error.


https://www.qprod.se/ weekly 1.0 https://www.qprod.se/1-rca-1-rca-hane-hane-15m weekly 2020-07-30T13:30:02+02:00 1.0 https://www.qprod.se/image/cache/catalo ... 00x800.jpg 1 RCA - 1 RCA Hane-Hane 1.5m 1 RCA - 1 RCA Hane-Hane 1.5m https://www.qprod.se/1-rca-2-rca-hane-honor weekly 2020-07-30T13:30:02+02:00 1.0 https://www.qprod.se/image/cache/catalo ... 00x800.jpg 1 RCA - 2 RCA Hane-Honor 1 RCA - 2 RCA Hane-Honor https://www.qprod.se/1.2.3-ambulans-9122-playmobil weekly 2020-07-30T13:30:02+02:00 1.0 https://www.qprod.se/image/cache/catalo ... 00x800.jpg 1.2.3, Ambulans 1.2.3, Ambulans https://www.qprod.se/1.2.3-bondgard-med ... -playmobil weekly 2020-07-30T13:30:02+02:00 1.0 https://www.qprod.se/image/cache/catalo ... 00x800.jpg 1.2.3, Bondgård med djur 1.2.3, Bondgård med djur https://www.qprod.se/1.2.3-traktor-med- ... -playmobil weekly 2020-07-30T13:30:02+02:00 1.0 https://www.qprod.se/image/cache/catalo ... 00x800.jpg 1.2.3, Traktor med släp 1.2.3, Traktor med släp https://www.qprod.se/116-netbook-windows-10 weekly 2020-07-30T13:30:02+02:00 1.0 https://www.qprod.se/image/cache/catalo ... 00x800.jpg 11,6" Netbook Windows 10 11,6" Netbook Windows 10 https://www.qprod.se/12-bluetooth-hoegt ... 04l-denver weekly 2020-07-30T13:30:02+02:00 1.0 https://www.qprod.se/image/cache/catalo ... 00x800.jpg 12" Bluetooth-högtalare rullba 12" Bluetooth-högtalare rullba https://www.qprod.se/1362-2g-svart-7376-doro weekly 2020-07-30T13:30:02+02:00 1.0 https://www.qprod.se/image/cache/catalo ... 00x800.jpg 1362 2G Svart 1362 2G Svart https://www.qprod.se/1362-2g-vit-7377-doro weekly 2020-07-30T13:30:02+02:00 1.0 https://www.qprod.se/image/cache/catalo ... 00x800.jpg 1362 2G Vit 1362 2G Vit https://www.qprod.se/1372-2g-grafit-gra-7569-doro weekly 2020-07-30T13:30:02+02:00 1.0 https://www.qprod.se/image/cache/catalo ... 00x800.jpg 1372 2G Grafit-grå 1372 2G Grafit-grå https://www.qprod.se/1372-2g-vit-7570-doro weekly 2020-07-30T13:30:02+02:00 1.0 https://www.qprod.se/image/cache/catalo ... 00x800.jpg 1372 2G Vit 1372 2G Vit https://www.qprod.se/141-netbook-windows-10 weekly 2020-07-30T13:30:02+02:00 1.0 https://www.qprod.se/image/cache/catalo ... 00x800.jpg 14,1" Netbook Windows 10 14,1" Netbook Windows 10 https://www.qprod.se/asus-156-fhd-i3-81 ... j075t-asus weekly 2020-07-30T13:30:02+02:00 1.0 https://www.qprod.se/image/cache/catalo ... 00x800.jpg 15,6" FHD i3-8145U 4GB/256GB/UHD620/W10 15,6" FHD i3-8145U 4GB/256GB/UHD620/W10 https://www.qprod.se/156-fhd-i5-8265u-8gb-256gb weekly 2020-07-30T13:30:02+02:00 1.0 https://www.qprod.se/image/cache/catalo ... 00x800.jpg 15,6" FHD i5-8265U/8GB/256GB 15,6" FHD i5-8265U/8GB/256GB https://www.qprod.se/156-full-hd-i3-101 ... 1770t-asus weekly 2020-07-30T13:30:02+02:00 1.0 https://www.qprod.se/image/cache/catalo ... 00x800.jpg 15,6" Full-HD i3-10110U/8GB/256GB/W10Home 15,6" Full-HD i3-10110U/8GB/256GB/W10Home https://www.qprod.se/173-hd-i3-8145u4gb ... x044t-asus weekly 2020-07-30T13:30:02+02:00 1.0 https://www.qprod.se/image/cache/catalo ... 00x800.jpg 17,3" HD+ i3-8145U/4GB/256GB/UHD620/W10Home 17,3" HD+ i3-8145U/4GB/256GB/UHD620/W10Home https://www.qprod.se/2-rca-2-rca-hane-hane-15m weekly 2020-07-30T13:30:02+02:00 1.0 https://www.qprod.se/image/cache/catalo ... 00x800.jpg 2 RCA - 2 RCA Hane-Hane 1.5m 2 RCA - 2 RCA Hane-Hane 1.5m https://www.qprod.se/2-rca-2-rca-hane-hane-25m weekly 2020-07-30T13:30:02+02:00 1.0 https://www.qprod.se/image/cache/catalo ... 00x800.jpg 2 RCA - 2 RCA Hane-Hane 2.5m 2 RCA - 2 RCA Hane-Hane 2.5m https://www.qprod.se/2-rca-2-rca-hane-hane-50m weekly 2020-07-30T13:30:02+02:00 1.0 https://www.qprod.se/image/cache/catalo ... 00x800.jpg 2 RCA - 2 RCA Hane-Hane 5.0m 2 RCA - 2 RCA Hane-Hane 5.0m https://www.qprod.se/2-rca-2-rca-hane-hona-50m weekly 2020-07-30T13:30:02+02:00 1.0 https://www.qprod.se/image/cache/catalo ... 00x800.jpg 2 RCA - 2 RCA Hane-Hona 5.0m 2 RCA - 2 RCA Hane-Hona 5.0m https://www.qprod.se/2-rislampor-batter ... 100-lundby weekly 2020-07-30T13:30:02+02:00 1.0 https://www.qprod.se/image/cache/catalo ... 00x800.png 2 Rislampor batteri 2 Rislampor batteri https://www.qprod.se/2-taklampor-batter ... 300-lundby weekly 2020-07-30T13:30:02+02:00 1.0 https://www.qprod.se/image/cache/catalo ... 00x800.png 2 Taklampor batteri 2 Taklampor batteri https://www.qprod.se/24ghz-helikopter-s107h-syma weekly 2020-07-30T13:30:02+02:00 1.0 https://www.qprod.se/image/cache/catalo ... 00x800.jpg 2,4GHz Helikopter 2,4GHz Helikopter https://www.qprod.se/2-in-1-auto-trainer-21061-messi weekly 2020-07-30T13:30:02+02:00 1.0 https://www.qprod.se/image/cache/catalo ... 00x800.jpg 2-in-1 Auto Trainer 2-in-1 Auto Trainer https://www.qprod.se/2-in-1-footvolley- ... 1060-messi weekly 2020-07-30T13:30:02+02:00 1.0 https://www.qprod.se/image/cache/catalo ... 00x800.jpg

Mvh
Pson


New member

Posts

Joined
Wed Jan 18, 2012 2:06 am

Post by uksitebuilder » Thu Jul 30, 2020 8:23 pm

Your sitemap seems to take an age to load, probably due to the number of items in it.

ImageImageImageImage

For Friendly Professional Support - Click Here


User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by ADD Creative » Thu Jul 30, 2020 8:25 pm

What version of OpenCart? Any modifications?

It's probably an unescaped & in your product data somewhere.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by letxobnav » Thu Jul 30, 2020 8:35 pm

since you have the & character in your product names, better use htmlspecialchars on that field when creating the xml.

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by pson » Thu Jul 30, 2020 8:44 pm

uksitebuilder wrote:
Thu Jul 30, 2020 8:23 pm
Your sitemap seems to take an age to load, probably due to the number of items in it.
Yes , I have 6000+ products
I am using OC Version 3.0.3.2

From the XML Validator it seem like it is removed :
<!DOCTYPE html>
<html style="height:100%">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" >
<title> 301 Moved Permanently
</title></head>
<body style="color: #444; margin:0;font: normal 14px/20px Arial, Helvetica, sans-serif; height:100%; background-color: #fff;">
<div style="height:auto; min-height:100%; "> <div style="text-align: center; width:800px; margin-left: -400px; position:absolute; top: 30%; left:50%;">
<h1 style="margin:0; font-size:150px; line-height:150px; font-weight:bold;">301</h1>
<h2 style="margin-top:20px;font-size: 30px;">Moved Permanently
</h2>
<p>The document has been permanently moved.</p>
</div></div></body></html>


This page contains the following errors:
error on line 6 at column 16: Opening and ending tag mismatch: meta line 0 and head

Mvh
Pson


New member

Posts

Joined
Wed Jan 18, 2012 2:06 am

Post by pson » Thu Jul 30, 2020 8:48 pm

ADD Creative wrote:
Thu Jul 30, 2020 8:25 pm
What version of OpenCart? Any modifications?

It's probably an unescaped & in your product data somewhere.
Thanks, I am using Version 3.0.3.2 , is there any easy way to find the & ?
I do have a lot of extensions , and I am using SEO generator, maybe the problem is from that extension

Mvh
Pson


New member

Posts

Joined
Wed Jan 18, 2012 2:06 am

Post by letxobnav » Thu Jul 30, 2020 9:04 pm

well, you can just browse to:

Code: Select all

https://www.qprod.se/index.php?route=extension/feed/google_sitemap
and view source to see the xml, search that for the & characters.
you can also just use:

Code: Select all

$product['name'] = htmlspecialchars($product['name'], ENT_COMPAT | ENT_XML1);
when generating the sitemap.

and since you have about 29000 urls in there, many useless as they are covered by canonical urls and will never be indexed, you might want to cache that.

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by ADD Creative » Fri Jul 31, 2020 12:58 am

pson wrote:
Thu Jul 30, 2020 8:48 pm
ADD Creative wrote:
Thu Jul 30, 2020 8:25 pm
What version of OpenCart? Any modifications?

It's probably an unescaped & in your product data somewhere.
Thanks, I am using Version 3.0.3.2 , is there any easy way to find the & ?
I do have a lot of extensions , and I am using SEO generator, maybe the problem is from that extension
You could directly search your database product_description name column using phpMyAdmin. Use Like %...% and search for & with space each side. Or you could view source on your sitemap in a browser and search for any & in that. Note you also have some &amp without a ;.

I've guessing that some of your products have been imported into OpenCart. It's a common problem to forget to escape with htmlspecialchars before entering into the database.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by pson » Fri Jul 31, 2020 3:06 am

ADD Creative wrote:
Fri Jul 31, 2020 12:58 am
pson wrote:
Thu Jul 30, 2020 8:48 pm
ADD Creative wrote:
Thu Jul 30, 2020 8:25 pm
What version of OpenCart? Any modifications?

It's probably an unescaped & in your product data somewhere.
Thanks, I am using Version 3.0.3.2 , is there any easy way to find the & ?
I do have a lot of extensions , and I am using SEO generator, maybe the problem is from that extension
You could directly search your database product_description name column using phpMyAdmin. Use Like %...% and search for & with space each side. Or you could view source on your sitemap in a browser and search for any & in that. Note you also have some &amp without a ;.

I've guessing that some of your products have been imported into OpenCart. It's a common problem to forget to escape with htmlspecialchars before entering into the database.
Thanks , ok, my products are "live" through a ftp feed so if I make the changes using phpMyAdmin i will probably have the problem later again .

Mvh
Pson


New member

Posts

Joined
Wed Jan 18, 2012 2:06 am

Post by pson » Fri Jul 31, 2020 3:12 am

letxobnav wrote:
Thu Jul 30, 2020 9:04 pm
well, you can just browse to:

Code: Select all

https://www.qprod.se/index.php?route=extension/feed/google_sitemap
and view source to see the xml, search that for the & characters.
you can also just use:

Code: Select all

$product['name'] = htmlspecialchars($product['name'], ENT_COMPAT | ENT_XML1);
when generating the sitemap.

and since you have about 29000 urls in there, many useless as they are covered by canonical urls and will never be indexed, you might want to cache that.
Thanks , unfortunately this is not my strongest side :( , do I add this

Code: Select all

$product['name'] = htmlspecialchars($product['name'], ENT_COMPAT | ENT_XML1);
in:
catalog/controller/extension/feed/google_sitemap.php ?

Mvh
Pson


New member

Posts

Joined
Wed Jan 18, 2012 2:06 am

Post by ADD Creative » Fri Jul 31, 2020 3:55 am

At the two line here.
https://github.com/opencart/opencart/bl ... hp#L22-L23

Replace.

Code: Select all

$product['name']
With.

Code: Select all

htmlspecialchars($product['name'], ENT_COMPAT | ENT_XML1, 'UTF-8')
However, you may be better fixing the code that imports into the database.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by pson » Fri Jul 31, 2020 4:42 am

ADD Creative wrote:
Fri Jul 31, 2020 3:55 am
At the two line here.
https://github.com/opencart/opencart/bl ... hp#L22-L23

Replace.

Code: Select all

$product['name']
With.

Code: Select all

htmlspecialchars($product['name'], ENT_COMPAT | ENT_XML1, 'UTF-8')
However, you may be better fixing the code that imports into the database.
Many many thanks :) , now it seems better

This XML file does not appear to have any style information associated with it. The document tree is shown below.
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">
<url>
<loc>https://www.qprod.se/</loc>
<changefreq>weekly</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://www.qprod.se/1-rca-1-rca-hane-hane-15m</loc>
<changefreq>weekly</changefreq>
<lastmod>2020-07-30T22:10:02+02:00</lastmod>
<priority>1.0</priority>
<image:image>
<image:loc>https://www.qprod.se/image/cache/catalo ... /image:loc>
<image:caption>1 RCA - 1 RCA Hane-Hane 1.5m</image:caption>
<image:title>1 RCA - 1 RCA Hane-Hane 1.5m</image:title>
</image:image>
</url>
<url>
<loc>https://www.qprod.se/1-rca-2-rca-hane-honor</loc>
<changefreq>weekly</changefreq>
<lastmod>2020-07-30T22:10:02+02:00</lastmod>
<priority>1.0</priority>
<image:image>
<image:loc>https://www.qprod.se/image/cache/catalo ... /image:loc>
<image:caption>1 RCA - 2 RCA Hane-Honor</image:caption>
<image:title>1 RCA - 2 RCA Hane-Honor</image:title>
</image:image>
</url>

Mvh
Pson


New member

Posts

Joined
Wed Jan 18, 2012 2:06 am

Post by letxobnav » Fri Jul 31, 2020 7:18 am

better get rid of:

Code: Select all

				$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>';
				}
and:

Code: Select all

			$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>';
			}
as they will produce non-canonical urls to your product pages which have a canonical url tag.
In simple words, those urls are useless in your sitemap as they will be discarded and only make your sitemap unnecessary large.

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by pson » Fri Jul 31, 2020 10:29 pm

Thanks all for good support :)
Google has accepted my sitemap .
have a good weekend !

Mvh
Pson


New member

Posts

Joined
Wed Jan 18, 2012 2:06 am
Who is online

Users browsing this forum: No registered users and 25 guests