s06e02 - XML Sitemaps SUPPORT / QUESTIONS

Open to all! Ask other shopowners for help.
heatherbell
Senior Contributor
Posts: 2540
Joined: Mon Oct 07, 2019 4:39 am
Phoenix Version:
Has thanked: 35 times
Been thanked: 243 times

Re: s06e02 - XML Sitemaps

Post by heatherbell »

kudos wrote: Wed Apr 17, 2024 10:03 pm just upgraded my store to v1.9.1
Maybe you have not upgraded the addon.
There are no tep_draw_bootstrap_button functions in the current package:
viewtopic.php?p=7798#p7798

Tags:


Join The Code Co-op to get access to your library in the Code Co-op Forum
kudos
Member
Posts: 20
Joined: Sat Jan 16, 2021 8:48 pm
Phoenix Version:
Has thanked: 1 time

Re: s06e02 - XML Sitemaps

Post by kudos »

strange, i pulled files from the Pro package upgrade,
but the one you linked to, reuploaded all files and working no more errors now

thanks
rupruprup
Member
Posts: 44
Joined: Thu Nov 05, 2020 7:39 pm
Phoenix Version: v1.0.9.10
Has thanked: 6 times
Been thanked: 3 times

Re: s06e02 - XML Sitemaps DOWNLOADS

Post by rupruprup »

PHP Fatal error: Uncaught Error: Call to undefined method DOMDocument::setAttributeNode() in /includes/system/override/gb/xml_writer.php:79

on 1.0.9.4
User avatar
burt
Core Team
Posts: 4550
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: s06e02 - XML Sitemaps DOWNLOADS

Post by burt »

rupruprup wrote: Thu Aug 08, 2024 8:08 am PHP Fatal error: Uncaught Error: Call to undefined method DOMDocument::setAttributeNode() in /includes/system/override/gb/xml_writer.php:79

on 1.0.9.4
I have just tested on my 1.0.9.5 and it seemed to work without problems.
Download for correct version? app.php/tag/s06e02
I am not here to build for you.
I am here to build with you. Let's help each other.
rupruprup
Member
Posts: 44
Joined: Thu Nov 05, 2020 7:39 pm
Phoenix Version: v1.0.9.10
Has thanked: 6 times
Been thanked: 3 times

Re: s06e02 - XML Sitemaps SUPPORT / QUESTIONS

Post by rupruprup »

reinstalled it and now it works with the same version, anyway thanks for caring
14Steve14
Senior Contributor
Posts: 921
Joined: Fri Oct 25, 2019 7:01 pm
Phoenix Version: v1.0.9.1
Has thanked: 17 times
Been thanked: 103 times

Re: s06e02 - XML Sitemaps SUPPORT / QUESTIONS

Post by 14Steve14 »

We have just checked the validity of our site maps and are getting a error that the priotity is invalid. It only happens on one validator.

It is saying that rather than
<priority>1</priority>
it should be
<priority>1.0</priority>

Is there a way of changing this. In includes/system/override/gb/xml_writer.php I tried to change

Code: Select all

$priority = 1;
to 1.0 but nothing changed.

Is the change really required and if so how to make the change.
heatherbell
Senior Contributor
Posts: 2540
Joined: Mon Oct 07, 2019 4:39 am
Phoenix Version:
Has thanked: 35 times
Been thanked: 243 times

Re: s06e02 - XML Sitemaps SUPPORT / QUESTIONS

Post by heatherbell »

14Steve14 wrote: Wed Nov 13, 2024 10:24 am Is the change really required and if so how to make the change.
Technically, the sitemap priority element should use a decimal format. The priority values are intended to be between 0.0 and 1.0, so some validators may flag integers like 1 as invalid.
Try (untested):

Code: Select all

$priority = number_format(1.0, 1);
which should enforce the 1 decimal place format.
14Steve14
Senior Contributor
Posts: 921
Joined: Fri Oct 25, 2019 7:01 pm
Phoenix Version: v1.0.9.1
Has thanked: 17 times
Been thanked: 103 times

Re: s06e02 - XML Sitemaps SUPPORT / QUESTIONS

Post by 14Steve14 »

heatherbell wrote: Wed Nov 13, 2024 10:54 am
14Steve14 wrote: Wed Nov 13, 2024 10:24 am Is the change really required and if so how to make the change.
Technically, the sitemap priority element should use a decimal format. The priority values are intended to be between 0.0 and 1.0, so some validators may flag integers like 1 as invalid.
Try (untested):

Code: Select all

$priority = number_format(1.0, 1);
which should enforce the 1 decimal place format.
Thanks for the help.

No difference after the change so I asked AI and changed the following

Code: Select all

          $el4 = $doc->createElement('priority');
          $el4->nodeValue = 1;
          $item->appendChild($el4);
to

Code: Select all

          $el4 = $doc->createElement('priority');
          $el4->nodeValue = sprintf("%.1f", $priority); // Ensures priority is displayed as '1.0'
          $item->appendChild($el4);
Whether both changes were required, or whether this is the best way to achieve this, I don't know but now everything shows correctly in all the xml sitemaps.
User avatar
burt
Core Team
Posts: 4550
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: s06e02 - XML Sitemaps SUPPORT / QUESTIONS

Post by burt »

$el4->nodeValue = '1.0';

Might do it, which (if it works) would be the most simple way.
This changes the value to a `string = 1.0` rather than an `integer = 1`
I am not here to build for you.
I am here to build with you. Let's help each other.
User avatar
mhsuffolk
Contributor
Posts: 199
Joined: Sat Oct 26, 2019 9:13 am
Phoenix Version: v1.1.0.6
Has thanked: 12 times
Been thanked: 11 times

Re: s06e02 - XML Sitemaps SUPPORT / QUESTIONS

Post by mhsuffolk »

burt wrote: Wed Nov 13, 2024 1:19 pm $el4->nodeValue = '1.0';

Might do it, which (if it works) would be the most simple way.
This changes the value to a `string = 1.0` rather than an `integer = 1`
Yes I can confirm this works on 1.0.9.0. Produces this in the XML

Code: Select all

<priority>1.0</priority>


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply